-
Notifications
You must be signed in to change notification settings - Fork 361
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
Fix build issues by removing nested PINOperation.xcodeproj #282
Fix build issues by removing nested PINOperation.xcodeproj #282
Conversation
So…turns out the first approach (using Cartfile.private) doesn't actually work when integrating PINCache in another project 😛 Updated to move the embedded PINOperation.xcodeproj to a workspace, and confirmed that this fixes the build errors I was seeing downstream. |
Thanks for putting this up! I think the |
Hmm, looks like this is still failing even after updating the Makefile. I think we'll have to figure out why it's failing before this can be merged. |
PINCache does not _embed_ PINOperation, only links it such that the binary declares it needs PINOperation to run. This permits Xcode to recognize the dependency relationship in the workspace.
@garrettmoon thanks & good catch! I guess what I didn't realize was that PINCache didn't link against PINOperation (so Xcode didn't see an implicit dependency relationship between them). I've gone ahead and made PINCache link (but not embed) PINOperation. The Make commands are succeeding for me now, and I've verified in a downstream project that PINCache still builds :) Worth noting here that linking here does change the PINCache binary by indicating that it depends on PINOperation.framework. But this change shouldn't be meaningful, since PINCache will always fail to load at runtime if PINOperation is missing. |
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.
Looks good to me, thank you!
Hello! Here's a quick fix for Carthage users:
This change replaces the PINOperation.xcodeproj nested inside PINCache.xcodeproj with a workspace containing both projects. It doesn't impact building of PINCache itself, and it fixes a duplicate target error users will get if they try to build both projects within Xcode.
Background
Currently, PINCache checks
Carthage/Checkouts/PINOperation
into git, but it also lists PINOperation in its Cartfile. As a result, Carthage users who depend on PINCache will get two distinct copies of PINOperation checked out:PINCache.xcodeproj embeds the second PINOperation and has target dependencies on it. This causes a couple issues:
If you build using
carthage build
, PINOperation compiles twice: once when building PINOperation (the carthage dependency), and once when building PINCache.If you add PINOperation and PINCache's xcodeprojs to a workspace and try to build from there, you get a build error because Xcode has loaded both PINOperation projects, and therefore sees duplicate targets:
Alternatives
Instead of creating an xcworkspace, I think this could also be fixed by:
Carthage/Checkouts/PINOperation
from git, so that on a user's machine the directory will be a symlink back to whatever version of PINOperation Carthage checked out.Testing done
make carthage
still resolves and builds successfullycarthage bootstrap
built successfully.