-
Notifications
You must be signed in to change notification settings - Fork 114
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
Remove "Check for Nested Frameworks" build phase #8134
Remove "Check for Nested Frameworks" build phase #8134
Conversation
You can test the changes from this Pull Request by:
|
); | ||
runOnlyForDeploymentPostprocessing = 0; | ||
shellPath = "/bin/sh -euo pipefail"; | ||
shellScript = "${PROJECT_DIR}/../Scripts/check-nested-frameworks.sh\n"; | ||
shellScript = "${PROJECT_DIR}/../Scripts/check-nested-frameworks.sh\n\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; |
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.
What would happen on a clean build if the script fails? 🤔 Does Xcode exit as well (equivalent to set -e
) or runs the echo
command anyway?
exit 1 |
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.
Oh that's a good point, Xcode will run the echo
no matter if check-nested-frameworks.sh
exits with 0 or other value, so will always print "SUCCESS" to the output file.
In this case, we could write the result of the input file into the output file.
echo `${SCRIPT_INPUT_FILE_0}` > ${SCRIPT_OUTPUT_FILE_0}
So when we go to the check-for-nested-frameworks.txt
file, we can see the actual message that the script returned.
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.
Oh, interesting.
In this case, we could write the result of the input file into the output file.
echo `${SCRIPT_INPUT_FILE_0}` > ${SCRIPT_OUTPUT_FILE_0}
Have you considered using tee
?
./${SCRIPT_INPUT_FILE_0} | tee ${SCRIPT_OUTPUT_FILE_0}
Also, I can't see an input file in the list in this diff. Perhaps this would achieve logging the script run result to file?
${PROJECT_DIR}/../Scripts/check-nested-frameworks.sh | tee ${SCRIPT_OUTPUT_FILE_0}
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.
Have you considered using tee?
I didn't know that one, thanks!
Thank you for looking into this @iamgabrielma 🙌 I looked at the script for the nested framework recently, and thought "do we still need it?" The script states to be addressing an issue in Xcode 12. Is the issue still present in Xcode 14? woocommerce-ios/Scripts/check-nested-frameworks.sh Lines 3 to 5 in 0217932
If the issue is gone. Should we keep the check just in case, or remove it in favor of a slightly faster build and under the assumption that, were the bug to come back, we'll know about it via Test Flight anyway and be able to re-introduce the script? |
Thanks for taking a look @mokagio !
You're right, in this case I'd say it would be preferable to remove it to reduce the clutter and make the build faster, specially since at the moment we're also requiring Xcode 14 or newer. |
@mokagio , from #8098 it would seem that we're gravitating towards running SwiftLint in every build, in this case no changes would be needed besides unchecking the "Based on dependency analysis" in the Build Phase. If that's case, I think I can reduce this PR to only removing the |
Yes. Thanks! |
Description
This PR addresses the current warnings regarding the WooCommerce target build phase:
If we do not specify input or output files, Xcode will runs these scripts every time we build the target, regardless of modification status during incremental builds. As this could have a significant impact on compile time, we want Xcode to only run the scripts on the files that actually change.
As this script was added to fix an issue with Xcode 12.4, and is no longer a problem, this PR deals with removing the script and build phase that runs it.
Changes
check-nested-frameworks.sh
scriptTesting instructions
Screenshots