Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion xcodeproj/internal/templates/bazel_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ readonly bazel_cmd

readonly base_pre_config_flags=(
# Be explicit about our desired Xcode version
"--xcode_version=$XCODE_PRODUCT_BUILD_VERSION"
Copy link
Contributor

Choose a reason for hiding this comment

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

Is using $DEVELOPER_DIR a new capability for Bazel? I don't recall this working before.

Since DEVELOPER_DIR could just be /Applications/Xcode.app/Contents/Developer, I believe this has the issue of Bazel caching which version this resolves to, so if the Xcode installed at that spot changes, Bazel still thinks it's compiling with a different version.

Also, --xcode_version= impacts analysis, and this will result in a cache miss from the version used in xcodeproj/internal/templates/runner.sh.

Copy link
Author

Choose a reason for hiding this comment

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

I think it came with that change: bazelbuild/bazel@d2e8c82

Copy link
Author

Choose a reason for hiding this comment

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

But yes; I agree with your comment about bazel not noticing Xcode changing. That could be a problem for the general case actually 🤔 let me think about it. I wish there was a way to override it somehow

"--xcode_version=$DEVELOPER_DIR"

# Set `DEVELOPER_DIR` in case a bazel wrapper filters it
"--repo_env=DEVELOPER_DIR=$DEVELOPER_DIR"
Expand Down