Skip to content

Commit 5871f36

Browse files
committed
Stop using APPLE_SDK_VERSION_OVERRIDE
Bazel is still setting it, but it's been deprecated for quite some time. Other tools like Buildbarn also no longer use it to resolve copies of Xcode during the build. bazelbuild/bazel@0af1cba buildbarn/bb-remote-execution@97cfb22 The existing logic is a bit problematic when trying to use these rules in combination with SDKs that don't follow the '${name}${version}' structure.
1 parent 16566f3 commit 5871f36

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

foreign_cc/private/framework.bzl

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -340,15 +340,12 @@ def get_env_prelude(ctx, installdir, data_dependencies, tools_env):
340340

341341
# This logic mirrors XcodeLocalEnvProvider#querySdkRoot in bazel itself
342342
if "APPLE_SDK_PLATFORM" in cc_env:
343-
platform = cc_env["APPLE_SDK_PLATFORM"]
344-
version = cc_env["APPLE_SDK_VERSION_OVERRIDE"]
345-
sdk = "{}{}".format(platform.lower(), version)
346343
env_snippet.extend([
347344
# TODO: This path needs to take cc_env["XCODE_VERSION_OVERRIDE"] into account
348345
# Declare and export separately so bash doesn't ignore failures from the commands https://github.com/koalaman/shellcheck/wiki/SC2155
349346
"developer_dir_tmp=\"$(xcode-select --print-path)\"",
350347
"export DEVELOPER_DIR=\"$developer_dir_tmp\"",
351-
"sdkroot_tmp=\"$(xcrun --sdk {} --show-sdk-path)\"".format(sdk),
348+
"sdkroot_tmp=\"$(xcrun --sdk {} --show-sdk-path)\"".format(cc_env["APPLE_SDK_PLATFORM"].lower()),
352349
"export SDKROOT=\"$sdkroot_tmp\"",
353350
"export CMAKE_OSX_ARCHITECTURES={}".format(ctx.fragments.apple.single_arch_cpu),
354351
])

0 commit comments

Comments
 (0)