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

Add BAZEL_SKIP_XCODE_FETCH to reduce toolchain configuration time #191

Closed
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
10 changes: 7 additions & 3 deletions crosstool/osx_cc_configure.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,13 @@ def configure_osx_toolchain(repository_ctx):
Label("@build_bazel_apple_support//crosstool:wrapped_clang.cc"),
))

(xcode_toolchains, xcodeloc_err) = run_xcode_locator(repository_ctx, xcode_locator)
if not xcode_toolchains:
return False
skip_xcode_fetch = "BAZEL_SKIP_XCODE_FETCH" in repository_ctx.os.environ and repository_ctx.os.environ["BAZEL_SKIP_XCODE_FETCH"] == "1"
Copy link
Contributor

Choose a reason for hiding this comment

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

What do you think about using bool to evaluate the environment variable value? It allows folks to pick their favorite representation.

Copy link
Member Author

Choose a reason for hiding this comment

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

this is what the upstream CC toolchain vars enforce so I figure we might as well keep the same behavior

xcode_toolchains = []
xcodeloc_err = ""
if not skip_xcode_fetch:
(xcode_toolchains, xcodeloc_err) = run_xcode_locator(repository_ctx, xcode_locator)
if not xcode_toolchains:
return False

# For Xcode toolchains, there's no reason to use anything other than
# wrapped_clang, so that we still get the Bazel Xcode placeholder
Expand Down