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

Improve failed exports logic #789

Merged
merged 2 commits into from
Sep 22, 2021
Merged
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
7 changes: 5 additions & 2 deletions foreign_cc/private/framework.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,11 @@ def get_env_prelude(ctx, lib_name, data_dependencies, target_root):
sdk = "{}{}".format(platform.lower(), version)
env_snippet.extend([
# TODO: This path needs to take cc_env["XCODE_VERSION_OVERRIDE"] into account
"export DEVELOPER_DIR=\"$(xcode-select --print-path)\"",
"export SDKROOT=\"$(xcrun --sdk {} --show-sdk-path)\"".format(sdk),
# Declare and export separately so bash doesn't ignore failures from the commands https://github.com/koalaman/shellcheck/wiki/SC2155
"developer_dir_tmp=\"$(xcode-select --print-path)\"",
"export DEVELOPER_DIR=\"$developer_dir_tmp\"",
"sdkroot_tmp=\"$(xcrun --sdk {} --show-sdk-path)\"".format(sdk),
"export SDKROOT=\"$sdkroot_tmp\"",
])

cc_toolchain = find_cpp_toolchain(ctx)
Expand Down