Skip to content

Commit f4c5b61

Browse files
committed
Respond to review comments
1 parent 0997cc1 commit f4c5b61

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ Unreleased changes template.
5555
* Bazel 6 support is dropped and Bazel 7.4.1 is the minimum supported
5656
version, per our Bazel support matrix. Earlier versions are not
5757
tested by CI, so functionality cannot be guaranteed.
58+
* Use `xcrun xcodebuild --showsdks` to find XCode root
5859

5960
{#v0-0-0-fixed}
6061
### Fixed

python/private/pypi/whl_library.bzl

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,18 @@ def _get_xcode_location_cflags(rctx):
5555
# This is a full xcode installation somewhere like /Applications/Xcode13.0.app/Contents/Developer
5656
# so we need to change the path to to the macos specific tools which are in a different relative
5757
# path than xcode installed command line tools.
58-
xcode_sdks_json = rctx.execute([
59-
"xcrun",
60-
"xcodebuild",
61-
"-showsdks",
62-
"-json",
63-
], environment = {
64-
"DEVELOPER_DIR": xcode_root,
65-
}).stdout
58+
xcode_sdks_json = repo_utils.execute_checked(
59+
rctx,
60+
op = "LocateXCodeSDKs",
61+
arguments = [
62+
repo_utils.which_checked(rctx, "xcrun"),
63+
"xcodebuild",
64+
"-showsdks",
65+
"-json",
66+
],
67+
environment = {
68+
"DEVELOPER_DIR": xcode_root,
69+
}).stdout
6670
xcode_sdks = json.decode(xcode_sdks_json)
6771
potential_sdks = [
6872
sdk
@@ -190,8 +194,9 @@ def _create_repository_execution_environment(rctx, python_interpreter, logger =
190194
# Gather any available CPPFLAGS values
191195
#
192196
# We may want to build in an environment without a cc toolchain.
193-
# In those cases, we're limited to --donwload-only, but we should respect that here.
194-
if not rctx.attr.download_only:
197+
# In those cases, we're limited to --download-only, but we should respect that here.
198+
is_wheel = rctx.attr.filename and rctx.attr.filename.endswith(".whl")
199+
if not (rctx.attr.download_only or is_wheel):
195200
cppflags = []
196201
cppflags.extend(_get_xcode_location_cflags(rctx))
197202
cppflags.extend(_get_toolchain_unix_cflags(rctx, python_interpreter))

0 commit comments

Comments
 (0)