Skip to content
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

Warning 'couldn't find pc file', coming from swift dependencies. #1059

Closed
patburns opened this issue Mar 3, 2020 · 10 comments
Closed

Warning 'couldn't find pc file', coming from swift dependencies. #1059

patburns opened this issue Mar 3, 2020 · 10 comments
Labels
dependency-management Issues with CocoaPods, Carthage, or SPM integration

Comments

@patburns
Copy link

patburns commented Mar 3, 2020

Opening this ticket because this warning was difficult to trace and maybe I'll save someone else time who's hits this:

If you include Apollo-ios as a swift package you'll get the follow warning during the Resolve Swift Packages steps of Xcodes automated build process:

Resolve Package Graph 'couldn't find pc file'.

This error has little context and it's unclear where the warning is coming from. We had many swift packages so to figure this out I had to remove the packages until I figured out that the warning was coming from Apollo-ios's dependencies. Well actually it's dependencies dependencies:

Apollo depends on:
daltoniam/Starscream#719
Which depends on:
apple/swift-nio-zlib-support#3

I'm hoping we can figure out how to fix this issue at the source in swift-nio-zlib-support.

Screen Shot 2020-03-03 at 3 45 14 PM

@designatednerd
Copy link
Contributor

weird! When using SPM I've generally had it grab that transient dependency without issue. What swift-tools-version are you using?

@designatednerd designatednerd added the dependency-management Issues with CocoaPods, Carthage, or SPM integration label Mar 3, 2020
@patburns
Copy link
Author

patburns commented Mar 4, 2020

Thanks for the fast response. I suppose I have whatever xcode 11.3.1 installs by default? Are there some command line tools I need to update? Swift printed out the follow when I asked for the version:

➜ swift -v Apple Swift version 5.1.3 (swiftlang-1100.0.282.1 clang-1100.0.33.15) Target: x86_64-apple-darwin19.3.0 /Applications/Xcode.app/Contents/Developer/usr/bin/lldb "--repl=-enable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -color-diagnostics" Welcome to Apple Swift version 5.1.3 (swiftlang-1100.0.282.1 clang-1100.0.33.15).

@designatednerd
Copy link
Contributor

This would be whatever you've got declared in the comment at the top of your Package.swift file.

@patburns
Copy link
Author

patburns commented Mar 4, 2020

Ah, to be honest I'm new to SwiftPM. We configured this with xcode by dropping dependencies in Xcode. So to my knowledge we don't have a top level Package.swift file.

Screen Shot 2020-03-03 at 4 12 16 PM

@designatednerd
Copy link
Contributor

Ahhh, ok - makes sense that there wouldn't be a Package.swift since Xcode is handling it for you.

I would try going to File > Swift Packages > Reset Package Caches - I'm not sure what's happening with the dependency resolution there, but it seems like something bumped its head on the initial fetch.

@patburns
Copy link
Author

patburns commented Mar 4, 2020

Thanks for the suggestion. I didn't know about that menu. Unfortunately, the error is still present.

@designatednerd
Copy link
Contributor

What about a version of the SDK 0.22 or higher - I did some major renovations in 22 so that might make a couple things clearer? If it doesn't, can you please share the Package.resolved that lives at [YourProject].xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved?

@patburns
Copy link
Author

patburns commented Mar 4, 2020

Thanks for the suggestion. I tried upping the version and the issue persisted. However, after seeing the comment on the attached thread. this morning. It dawned on me that maybe I just need to install pkg-config and it will make swift-nio-zlib-support happy.

For me this was as simple as using brew to install pkg-confg:
brew install pkg-config

This fixed me up. Thanks for the help on figuring this out. At least someone googling around will figure out how to silence this warning. I'm going to follow up on the thread in the starscream thread to see if they have any ideas of how they could avoid this. I'm not sure there is much to do at your layer. Maybe add a note in your docs?

@designatednerd
Copy link
Contributor

Weird! Some other tooling must have installed that on my end, it's in my /usr/local/bin. Do you mind if we close this thread out?

@patburns
Copy link
Author

patburns commented Mar 4, 2020

No problem at all! Have a nice week!

@patburns patburns closed this as completed Mar 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependency-management Issues with CocoaPods, Carthage, or SPM integration
Projects
None yet
Development

No branches or pull requests

2 participants