Repository navigation
fix(build): stop forcing a relink on every incremental build #529
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
Open
+80
−19
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,30 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| # Ignore errors while inserting environment variables (some could be readonly) | ||
| (echo "set +e"; echo "set +o posix"; export; echo "set -o posix"; echo "set -e";) > ./.build_env_vars.sh | ||
| ENV_FILE=./.build_env_vars.sh | ||
| (echo "set +e"; echo "set +o posix"; export; echo "set -o posix"; echo "set -e";) > "$ENV_FILE.tmp" | ||
| if cmp -s "$ENV_FILE.tmp" "$ENV_FILE"; then | ||
| rm "$ENV_FILE.tmp" | ||
| else | ||
| mv "$ENV_FILE.tmp" "$ENV_FILE" | ||
| fi | ||
|
|
||
| # create temporary empty metadata files for XCode LD/LDPLUSPLUS flag analysis | ||
| # create temporary empty metadata files for XCode LD/LDPLUSPLUS flag analysis. | ||
| # Never touch existing ones: the link step reads them, so a newer timestamp | ||
| # would make Xcode relink on every build. | ||
| for arch in $VALID_ARCHS | ||
| do : | ||
| touch "$CONFIGURATION_BUILD_DIR/metadata-$arch.bin" | ||
| [ -e "$CONFIGURATION_BUILD_DIR/metadata-$arch.bin" ] || touch "$CONFIGURATION_BUILD_DIR/metadata-$arch.bin" | ||
| done | ||
|
|
||
| # The metadata generator reads these during linking, which Xcode would skip when | ||
| # only they changed. | ||
| FILTERS_STAMP="$CONFIGURATION_BUILD_DIR/metadata-filters.stamp" | ||
| FILTERS_HASH=$(cd "$SRCROOT" && shasum whitelist.mdg blacklist.mdg 2>/dev/null || true) | ||
| if [ ! -e "$FILTERS_STAMP" ] || [ "$FILTERS_HASH" != "$(cat "$FILTERS_STAMP")" ]; then | ||
| for arch in $VALID_ARCHS | ||
| do : | ||
| touch "$CONFIGURATION_BUILD_DIR/metadata-$arch.bin" | ||
| done | ||
| printf '%s' "$FILTERS_HASH" > "$FILTERS_STAMP" | ||
|
rigor789 marked this conversation as resolved.
Resolved
|
||
| fi | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,30 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| # Ignore errors while inserting environment variables (some could be readonly) | ||
| (echo "set +e"; echo "set +o posix"; export; echo "set -o posix"; echo "set -e";) > ./.build_env_vars.sh | ||
| ENV_FILE=./.build_env_vars.sh | ||
| (echo "set +e"; echo "set +o posix"; export; echo "set -o posix"; echo "set -e";) > "$ENV_FILE.tmp" | ||
| if cmp -s "$ENV_FILE.tmp" "$ENV_FILE"; then | ||
| rm "$ENV_FILE.tmp" | ||
| else | ||
| mv "$ENV_FILE.tmp" "$ENV_FILE" | ||
| fi | ||
|
|
||
| # create temporary empty metadata files for XCode LD/LDPLUSPLUS flag analysis | ||
| # create temporary empty metadata files for XCode LD/LDPLUSPLUS flag analysis. | ||
| # Never touch existing ones: the link step reads them, so a newer timestamp | ||
| # would make Xcode relink on every build. | ||
| for arch in $VALID_ARCHS | ||
| do : | ||
| touch "$CONFIGURATION_BUILD_DIR/metadata-$arch.bin" | ||
| [ -e "$CONFIGURATION_BUILD_DIR/metadata-$arch.bin" ] || touch "$CONFIGURATION_BUILD_DIR/metadata-$arch.bin" | ||
| done | ||
|
|
||
| # The metadata generator reads these during linking, which Xcode would skip when | ||
| # only they changed. | ||
| FILTERS_STAMP="$CONFIGURATION_BUILD_DIR/metadata-filters.stamp" | ||
| FILTERS_HASH=$(cd "$SRCROOT" && shasum whitelist.mdg blacklist.mdg 2>/dev/null || true) | ||
| if [ ! -e "$FILTERS_STAMP" ] || [ "$FILTERS_HASH" != "$(cat "$FILTERS_STAMP")" ]; then | ||
| for arch in $VALID_ARCHS | ||
| do : | ||
| touch "$CONFIGURATION_BUILD_DIR/metadata-$arch.bin" | ||
| done | ||
| printf '%s' "$FILTERS_HASH" > "$FILTERS_STAMP" | ||
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.