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-6514] Using libSwiftPM
in Xcode Project is blocked by error: missing required module 'clibc'
.
#4850
Comments
@aciidb0mb3r is this because we need the special command line arguments to point to the module maps? I have also hit this problem trying to use a SwiftPM package from a playground, and it is pretty annoying. Fixing it may not be easy though. |
I think this is failing because you're depending on SwiftPM product. Try depending on "Utility". |
Oh, are you adding dependency to the generated Xcode project? |
@aciidb0mb3r Yes, I'm trying. Using system module may be biggest barrier on using generated Xcode project as dependency. |
We need to generate copy header phases in the generated Xcode project to fix this issue. |
I implement generating copy header phase on #1406
That is caused by that {{clibc}} is system module. |
Try setting enable modules off |
Error: |
The only workaround I found was:
|
FYI, generated {{SwiftPM.xcodeproj}} will be able to be built in xcworkspace by following changes: |
Here is a workaround. In clibc target: Script: Input Files: |
@aciidb0mb3r The workaround seems not perfect ./swift-source/swiftpm/Sources/clibc/include/clibc.h:1:10: Include of non-modular header inside framework module 'clibc': '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/fts.h' |
I recently published a documentation on using libSwiftPM. You shouldn't have these issues anymore when directly depending on SwiftPM: https://github.com/apple/swift-package-manager/blob/master/Documentation/libSwiftPM.md Xcode project generation: https://github.com/apple/swift-package-manager/blob/master/Examples/package-info/Makefile#L23 |
@aciidb0mb3r should `Utilities/bootstrap build-runtimes` works with Swift 4.2.1 ? |
Did you use the makefile to generate the project? |
the Makefile is in the Example. I don't use that example. I'm trying to build Xcode usable SwiftPM. Tried with `swift-DEVELOPMENT-SNAPSHOT-2018-11-01-a` and still failed. I do: and it has the same problem with clibc as any previous version |
As I said in the previous comment, you need to generate the Xcode project using: $ swift package generate-xcodeproj --xcconfig-overrides config.xcconfig See: https://github.com/apple/swift-package-manager/blob/master/Examples/package-info/Makefile#L23 |
Hm... I don't understand why is the `config.xcconfig` somewhere in the Examples if it's required for SwiftPM.xcodeproj? |
Oh, you want to build SwiftPM itself as opposed to using it as dependency? Then you just need: `Utilities/bootstrap --generate-xcodeproj`. See more info here: https://github.com/apple/swift-package-manager/blob/master/Documentation/Development.md#developing-using-xcode |
@aciidb0mb3r it did the job. |
Yeah, adding as a subproject doesn't work out of the box since clibc contains a custom modulemap. Adding header search path to `swiftpm/Sources/clibc/include` in the top-level project should fix that. |
I didn't find it easy to set up. I summarize my thoughts on forum https://forums.swift.org/t/how-to-use-libswiftpm-dylib/18529 in case it needs more discussion |
This is still hitting people that consume libSwiftPM @swift-ci create |
Since libSwiftPM doesn't have a versioned stable API other than in |
Attachment: Download
Environment
swift 4.0.2-RELEASE
Additional Detail from JIRA
md5: 9cba4834f2c2ee99f4952a52b7775c26
Issue Description:
Example: jpsim/SourceKitten#454
Build log: https://circleci.com/gh/jpsim/SourceKitten/757
The text was updated successfully, but these errors were encountered: