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
Include dependent vendored frameworks in linker flags #9045
Conversation
I'd like @segiddins to review this since he made the change in #8314 |
+1 on @dnkoutso's comment, we had a bunch of regressions when changing this so would like to be 100% sure we get this right |
Of course! Based on some cursory glancing, it should fix #8519. |
No, I don't think so - that was specifically related to libraries instead of frameworks. This only targets frameworks that wouldn't otherwise be compiled since those will get included in the "Link Binary With Libraries" phase, but I'm definitely no expert on all this stuff. |
.gitmodules
Outdated
@@ -6,7 +6,7 @@ | |||
url = https://github.com/tonymillion/Reachability.git | |||
[submodule "spec/cocoapods-integration-specs"] | |||
path = spec/cocoapods-integration-specs | |||
url = https://github.com/CocoaPods/cocoapods-integration-specs.git |
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.
will need to point back to master
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.
yes @drcapulet will need to revert this
if non_library_xcconfig? | ||
frameworks.concat dependent_targets_to_link.flat_map { |pt| pt.build_settings.frameworks_to_import } | ||
end | ||
targets_to_link = library_xcconfig? ? dependent_targets.reject(&:should_build?) : dependent_targets_to_link |
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.
for unbbuilt dependent targets, should we only be linking dynamic frameworks here, instead of dynamic and static?
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.
Yes, updated.
f8bb371
to
01cfd6a
Compare
@drcapulet needs a rebase to fix CHANGELOG conflict. |
Also would need to rebase off of |
01cfd6a
to
08d6c07
Compare
if library_xcconfig? | ||
# We know that this library target is being built dynamically based | ||
# on the guard above, so include any vendored static frameworks. | ||
frameworks.concat vendored_static_frameworks.map { |l| File.basename(l, '.framework') } if target.should_build? |
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.
does this mean that a vendored static framework will be linked twice? Once for this dynamic framework and once on the app target itself?
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.
This line is just moved around, but no - since this is a dynamic library target, when it gets compiled it needs to include any vendored static frameworks, and then the whole dynamic library will get linked into it's parent (either app or another library).
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.
If I recall correctly CocoaPods will link that vendored static framework to the app target as well not just the dynamic library target.
From its early days CocoaPods had a very (kinda annoying) naive approach to just link everything to the app level target.
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.
I can verify my own question this week.
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.
I guess you are right this was already happening before. I will still verify though
@drcapulet needs a rebase. I will try to land it for a beta.2. |
44d31a2
to
f00074d
Compare
f00074d
to
640168b
Compare
@drcapulet can you rebase to fix the |
640168b
to
d687325
Compare
d687325
to
fac1242
Compare
Still having issues installing vendors frameworks in 1.8.0 :/ |
@dnkoutso should I open a new issue? I am still having issues installing vendored frameworks via 1.8.1.. We are still locked down to using 1.5.3. Getting the same compile time errors:
|
I think this may be causing us to have duplicate symbol errors, as most of our vendored frameworks are static and therefore we do NOT want them included in linker flags outside the project vendoring them. I will investigate and create an issue (and maybe a PR to fix) if I can repro for you. |
Accompanying PR to CocoaPods/cocoapods-integration-specs#242.