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
[SR-2215] Error linking C wrapper module in Kitura when using generated Xcode project #5414
Comments
Sounds like a Jordan thing. |
That really sounds like the module map is wrong. |
…or rather, we should build a dylib rather than a framework for C targets in the Xcode generator, or maybe the package manager should provide the "link" command in the module map rather than the user. |
Both the compiler and Xcode are behaving as expected. |
SwiftPM generates correct modulemap for swift-build (dylibs) and Xcode (framework) project if the C library layout is supported. I'll suggest let swiftpm generate modulemap for you so it works with both Xcode and swift-build. All you have to do is move the public headers to include directory (and ofc remove the current modulemap). |
Comment by Ian Partridge (JIRA) Thank you @aciidb0mb3r! With this hint we were able to fix the issue on Kitura's side. 👍 |
Sounds like we'll still want some way to allow custom module maps with Xcode support, but it's no longer urgent. |
@ddunbar @abertelrud
|
I am not sure either. We don't officially support Swift dylibs in Xcode, which makes me question whether we should use them. On the other hand, it isn't clear our model is strong enough to actually support this... in particular with regard to RPATH-type things, which currently there is no way to specify. |
Fixed in #630 |
Environment
Xcode 7.3.1 with 6/20 snapshot.
Additional Detail from JIRA
md5: e34bd2d7172d8df3b0648a6d11c0214e
duplicates:
Issue Description:
Running swift build using the CLI successfully compiles Kitura, including the step to link CHTTPParser. However, using the generated Xcode project to build Kitura results in the compilation failing with the following error:
ld: library not found for -lCHttpParser for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
This issue is described further in the following Github issues:
Kitura/Kitura#634
Kitura/Kitura#574
Also, here the results of some initial investigation from our team: If one looks carefully at the failing ld command, the build tried to link in the CHTTPParser framework, which should been enough. It’s just that it also tried to link in CHTTPParser.dynlib, which was found in the modulemap file for CHTTPParser.
The text was updated successfully, but these errors were encountered: