-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
[gym] correctly inherit OTHER_SWIFT_FLAGS when using option 'analyze_build_time' #19737
[gym] correctly inherit OTHER_SWIFT_FLAGS when using option 'analyze_build_time' #19737
Conversation
61e281e
to
18e1397
Compare
Ok, figured out that I had a REALLY old fork of fastlane and updated my PR. |
18e1397
to
829cce2
Compare
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.
One small question otherwise this looks good 😊
@@ -43,7 +43,7 @@ def options | |||
options << "-scmProvider system" | |||
end | |||
options << config[:xcargs] if config[:xcargs] | |||
options << "OTHER_SWIFT_FLAGS=\"-Xfrontend -debug-time-function-bodies\"" if config[:analyze_build_time] | |||
options << "OTHER_SWIFT_FLAGS=\"\\\$(value) -Xfrontend -debug-time-function-bodies\"" if config[:analyze_build_time] |
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'm not too familiar with this but is $(value)
the same thing as $(inherited)
? 🙃
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 don't know where or if there is official documentation for it, but $(value)
expands to the current build setting value. So it's sort of the command-line equivalent of $(inherited)
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.
Ohhhhhh, cool cool! I see what this is doing now 🤯 Thank you for the explanation 🥰
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.
Thank you so much for debugging this and making this change! Really appreciate it 🙌
Hey @icecrystal23 👋 Thank you for your contribution to fastlane and congrats on getting this pull request merged 🎉 Please let us know if this change requires an immediate release by adding a comment here 👍 |
Congratulations! 🎉 This was released as part of fastlane 2.200.0 🚀 |
Checklist
bundle exec rspec
from the root directory to see all new and existing tests pass (well, sort of. Tests unrelated to my change were failing, but the test for the code I changed was passing when run in isolation)bundle exec rubocop -a
to ensure the code style is validMotivation and Context
We had an issue with the Apollo SDK when using CocoaPods. Turns out the root cause of that bug was the OTHER_SWIFT_FLAGS not being successfully inherited here. See details of that bug here: apollographql/apollo-ios#2047
Description
Added an additional escape character to the $ on "$(inherited)" OTHER_SWIFT_FLAGS so that it successfully gets passed to xcodebuild rather than being evaluated too early.
Testing Steps
I tested
gym
on an example project with a custom OTHER_SWIFT_FLAGS setting and ensured that the actualCompileSwiftSources
command in the build log had the custom flag in addition to the build time analysis ones.