-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Fix building and testing on FreeBSD; Add FreeBSD platform support #8193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
06b4a78
a41805a
572bc91
00266b7
c425839
bea75c5
a4b170a
2fe8014
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -201,7 +201,7 @@ let package = Package( | |
name: "Basics", | ||
dependencies: [ | ||
"_AsyncFileSystem", | ||
.target(name: "SPMSQLite3", condition: .when(platforms: [.macOS, .iOS, .tvOS, .watchOS, .visionOS, .macCatalyst, .linux])), | ||
.target(name: "SPMSQLite3", condition: .when(platforms: [.macOS, .iOS, .tvOS, .watchOS, .visionOS, .macCatalyst, .linux, .custom("freebsd")])), | ||
.product(name: "SwiftToolchainCSQLite", package: "swift-toolchain-sqlite", condition: .when(platforms: [.windows, .android])), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Great to see this port moving forward. 🥲 Have you tried using this SQLite package instead? The only reason most OSs above don't is that this is new: I switched my upcoming native 6.1 toolchain for Android over to using it and was able to remove the external libsqlite package dependency of this Swift toolchain as a result. I suggest you try the same, will require patching llbuild also. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, I just saw your comment. This sounds like a good idea! Thanks! |
||
.product(name: "DequeModule", package: "swift-collections"), | ||
.product(name: "OrderedCollections", package: "swift-collections"), | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,11 +16,12 @@ public enum SystemPackageProviderDescription: Hashable, Codable, Sendable { | |
case apt([String]) | ||
case yum([String]) | ||
case nuget([String]) | ||
case pkg([String]) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is FreeBSD's
Here's some of my thoughts:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is also in my mind, originally I name this I'm not sure about OpenBSD tho, and currently the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK, might be worth starting a Swift evolution thread on the naming. In the meantime you could land this behind an API availability of 999.0 |
||
} | ||
|
||
extension SystemPackageProviderDescription { | ||
private enum CodingKeys: String, CodingKey { | ||
case brew, apt, yum, nuget | ||
case brew, apt, yum, nuget, pkg | ||
} | ||
|
||
public func encode(to encoder: Encoder) throws { | ||
|
@@ -38,6 +39,9 @@ extension SystemPackageProviderDescription { | |
case let .nuget(a1): | ||
var unkeyedContainer = container.nestedUnkeyedContainer(forKey: .nuget) | ||
try unkeyedContainer.encode(a1) | ||
case let .pkg(a1): | ||
var unkeyedContainer = container.nestedUnkeyedContainer(forKey: .pkg) | ||
try unkeyedContainer.encode(a1) | ||
} | ||
} | ||
|
||
|
@@ -63,6 +67,10 @@ extension SystemPackageProviderDescription { | |
var unkeyedValues = try values.nestedUnkeyedContainer(forKey: key) | ||
let a1 = try unkeyedValues.decode([String].self) | ||
self = .nuget(a1) | ||
case .pkg: | ||
var unkeyedValues = try values.nestedUnkeyedContainer(forKey: key) | ||
let a1 = try unkeyedValues.decode([String].self) | ||
self = .pkg(a1) | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,6 +38,7 @@ public struct PlatformRegistry { | |
.macOS, | ||
.macCatalyst, | ||
.openbsd, | ||
.freebsd, | ||
.tvOS, | ||
.visionOS, | ||
.wasi, | ||
|
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: may be worth a comment that the /usr vs /usr/local separation is a formal FreeBSD policy for all ports not part of the base system, otherwise this difference may look suspicious to future readers (it was to me, as I mentioned to you elsewhere)