Skip to content

Commit

Permalink
Run realpath on the $DEVELOPER_DIR and $SDKROOT paths in the su…
Browse files Browse the repository at this point in the history
…bstitution test.

In some cases, we've observed inconsistencies among the paths; sometimes we get the symlink SDK (`MacOSX.sdk`) and sometimes we get the versioned directory (`MacOSX14.2.sdk`). Either is valid, but make the test deterministic by always running `realpath`.

PiperOrigin-RevId: 613179143
  • Loading branch information
allevato authored and swiple-rules-gardener committed Mar 6, 2024
1 parent 2177431 commit 8edac7c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/apple_support_test.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ set -eu
OUTPUT_FILE="$1" ; shift
echo "XCODE_PATH_ENV=$DEVELOPER_DIR" > "$OUTPUT_FILE"
echo "SDKROOT_PATH_ENV=$SDKROOT" >> "$OUTPUT_FILE"
echo "XCODE_PATH_ENV=$(realpath $DEVELOPER_DIR)" > "$OUTPUT_FILE"
echo "SDKROOT_PATH_ENV=$(realpath $SDKROOT)" >> "$OUTPUT_FILE"
for arg in "$@"; do
if [[ "$arg" == @* ]]; then
Expand Down Expand Up @@ -86,8 +86,8 @@ function assert_not_contains() {{
exit 1
}}
XCODE_PATH_ENV="$DEVELOPER_DIR"
SDKROOT_PATH_ENV="$SDKROOT"
XCODE_PATH_ENV=$(realpath "$DEVELOPER_DIR")
SDKROOT_PATH_ENV=$(realpath "$SDKROOT")
for file in "${{FILES[@]}}"; do
assert_contains_line "$file" "XCODE_PATH_ENV=$XCODE_PATH_ENV"
Expand Down

0 comments on commit 8edac7c

Please sign in to comment.