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

Fix: avoid accidental load of unnecessary Xcode setting lines #105

Merged

Conversation

shoamano83
Copy link
Contributor

The original implementation grep-ed "CONFIGURATION", therefore it captured any lines that contain the word, not just the line starting with CONFIGURATION=. This PR fixes the issue so that relax now captures CONFIGURATION= line only.

Background: we faced a weird build issue where Swift compilation failed after I added

OTHER_SWIFT_FLAGS = "$(inherited) -D CONFIGURATION_XXX";

line in project.pbxproj file. Looking at the code, I noticed that relax captured this setting and exported it, which caused Xcode to use wrong OTHER_SWIFT_FLAGS option.

The original implementation grep-ed "CONFIGURATION", therefore
it captured any lines that contain the word, not just the line
starting with "CONFIGURATION=".

This commit fixes the behavior so it only captures
"CONFIGURATION=" line. Same change is applied to all keywords.
@@ -332,16 +332,16 @@ __load_xcode_build_settings () {
s/$/'/;
" | \
grep \
-e "CONFIGURATION\|INFOPLIST_PATH\|PRODUCT_SETTINGS_PATH\|SRCROOT"\
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me double check the intention of original implementation ... was this to capture the line CONFIGURATION= only, or was this meant to capture other lines such as CONFIGURATION_BUILD_DIR= and PODS_CONFIGURATION_BUILD_DIR= ?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it was, relax uses only CONFIGURATION environment variable, not other variables including the word 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, and thank you!

@scenee
Copy link
Owner

scenee commented Jul 4, 2024

Thank you so much. This PR makes sense. Unfortunately, CI jobs are failed because they are too old to work on the current GitHub Actions environment. However it should work correctly after this change and then I merged this into the master branch.

@scenee scenee merged commit 5db32d9 into scenee:master Jul 4, 2024
0 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants