Skip to content

Commit

Permalink
Respond to review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
shs96c committed Dec 18, 2024
1 parent 0997cc1 commit f4c5b61
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ Unreleased changes template.
* Bazel 6 support is dropped and Bazel 7.4.1 is the minimum supported
version, per our Bazel support matrix. Earlier versions are not
tested by CI, so functionality cannot be guaranteed.
* Use `xcrun xcodebuild --showsdks` to find XCode root

{#v0-0-0-fixed}
### Fixed
Expand Down
25 changes: 15 additions & 10 deletions python/private/pypi/whl_library.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,18 @@ def _get_xcode_location_cflags(rctx):
# This is a full xcode installation somewhere like /Applications/Xcode13.0.app/Contents/Developer
# so we need to change the path to to the macos specific tools which are in a different relative
# path than xcode installed command line tools.
xcode_sdks_json = rctx.execute([
"xcrun",
"xcodebuild",
"-showsdks",
"-json",
], environment = {
"DEVELOPER_DIR": xcode_root,
}).stdout
xcode_sdks_json = repo_utils.execute_checked(
rctx,
op = "LocateXCodeSDKs",
arguments = [
repo_utils.which_checked(rctx, "xcrun"),
"xcodebuild",
"-showsdks",
"-json",
],
environment = {
"DEVELOPER_DIR": xcode_root,
}).stdout
xcode_sdks = json.decode(xcode_sdks_json)
potential_sdks = [
sdk
Expand Down Expand Up @@ -190,8 +194,9 @@ def _create_repository_execution_environment(rctx, python_interpreter, logger =
# Gather any available CPPFLAGS values
#
# We may want to build in an environment without a cc toolchain.
# In those cases, we're limited to --donwload-only, but we should respect that here.
if not rctx.attr.download_only:
# In those cases, we're limited to --download-only, but we should respect that here.
is_wheel = rctx.attr.filename and rctx.attr.filename.endswith(".whl")
if not (rctx.attr.download_only or is_wheel):
cppflags = []
cppflags.extend(_get_xcode_location_cflags(rctx))
cppflags.extend(_get_toolchain_unix_cflags(rctx, python_interpreter))
Expand Down

0 comments on commit f4c5b61

Please sign in to comment.