-
Notifications
You must be signed in to change notification settings - Fork 2
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
Linux Support #6
Comments
Vapor docker file for reference: https://github.com/vapor/template/blob/main/Dockerfile |
hi i checked this issue mayube the reason could be related to the inability to find 'CFBooleanGetTypeID' and 'CFGetTypeID' in scope. These are Core Foundation functions in Swift, and the error indicates that the compiler cannot find them during the build process. Importing CoreFoundation: Compiler Flags: Swift Version: Library Updates: if yu have any problem ask |
Thanks for your answer, @kamleshboi69! I've tried simply importing CoreFoundation but that doesn't solve it yet. I've found this thread on the Swift forums that I'm researching now: https://forums.swift.org/t/static-linking-on-linux-in-swift-5-3-1/41989 |
I've tried running without the compiler flags, however no luck. It fails with the same fatal error. I'm on the latest swift-version 5.9, which is also indicated on json-apple's Package.swift: Here is a cut out of my dependencies: [
// 💧 A server-side Swift web framework.
.package(url: "https://github.com/vapor/vapor.git", from: "4.92.1"),
.package(url: "https://github.com/vapor/queues-redis-driver.git", from: "1.1.1"),
.package(url: "https://github.com/orlandos-nl/IkigaJSON.git", from: "2.2.1"),
.package(url: "https://github.com/shareup/json-apple.git", from: "1.4.0"),
], => all are updated to the latest version. By the way, is this the proper way of adding json-apple to an executable target? .executableTarget(
name: "App",
dependencies: [
.product(name: "Vapor", package: "vapor"),
.product(name: "QueuesRedisDriver", package: "queues-redis-driver"),
.product(name: "IkigaJSON", package: "IkigaJSON"),
.product(name: "JSON", package: "json-apple"),
]
), |
I'm finding the definition of CFBooleanGetTypeId and CFGetTypeId in swift-corelibs-foundation: https://github.com/apple/swift-corelibs-foundation/blob/main/Sources/Foundation/NSNumber.swift |
Through this thread: https://forums.swift.org/t/foundation-on-linux-cfbooleangettypeid-cfgettypeid/2736/14 |
I've setup a simple repro repo here: https://github.com/abegehr/json-apple-vapor
Fails with the same error:
|
I got the simple repro to work: |
The package looks great and is easy to use!
However running on Linux as part of the vanilla Dockerfile for Vapor fails:
The referenced symbol is in swift-corelibs-foundation: https://github.com/apple/swift-corelibs-foundation/blob/dbca8c7ddcfd19f7f6f6e1b60fd3ee3f748e263c/CoreFoundation/Base.subproj/CFRuntime.c#L732
The text was updated successfully, but these errors were encountered: