Skip to content

Commit cc3c9b4

Browse files
committed
pass logger to the newly added code
1 parent 707ba7d commit cc3c9b4

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

python/private/pypi/whl_library.bzl

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ _CPPFLAGS = "CPPFLAGS"
3030
_COMMAND_LINE_TOOLS_PATH_SLUG = "commandlinetools"
3131
_WHEEL_ENTRY_POINT_PREFIX = "rules_python_wheel_entry_point"
3232

33-
def _get_xcode_location_cflags(rctx):
33+
def _get_xcode_location_cflags(rctx, logger = None):
3434
"""Query the xcode sdk location to update cflags
3535
3636
Figure out if this interpreter target comes from rules_python, and patch the xcode sdk location if so.
@@ -46,6 +46,7 @@ def _get_xcode_location_cflags(rctx):
4646
rctx,
4747
op = "GetXcodeLocation",
4848
arguments = [repo_utils.which_checked(rctx, "xcode-select"), "--print-path"],
49+
logger = logger,
4950
)
5051
if xcode_sdk_location.return_code != 0:
5152
return []
@@ -67,6 +68,7 @@ def _get_xcode_location_cflags(rctx):
6768
environment = {
6869
"DEVELOPER_DIR": xcode_root,
6970
},
71+
logger = logger,
7072
).stdout
7173
xcode_sdks = json.decode(xcode_sdks_json)
7274
potential_sdks = [
@@ -110,6 +112,7 @@ def _get_toolchain_unix_cflags(rctx, python_interpreter, logger = None):
110112
"-c",
111113
"import sys; print(f'{sys.version_info[0]}.{sys.version_info[1]}', end='')",
112114
],
115+
logger = logger,
113116
)
114117
_python_version = stdout
115118
include_path = "{}/include/python{}".format(
@@ -199,8 +202,8 @@ def _create_repository_execution_environment(rctx, python_interpreter, logger =
199202
is_wheel = rctx.attr.filename and rctx.attr.filename.endswith(".whl")
200203
if not (rctx.attr.download_only or is_wheel):
201204
cppflags = []
202-
cppflags.extend(_get_xcode_location_cflags(rctx))
203-
cppflags.extend(_get_toolchain_unix_cflags(rctx, python_interpreter))
205+
cppflags.extend(_get_xcode_location_cflags(rctx, logger = logger))
206+
cppflags.extend(_get_toolchain_unix_cflags(rctx, python_interpreter, logger = logger))
204207
env[_CPPFLAGS] = " ".join(cppflags)
205208
return env
206209

0 commit comments

Comments
 (0)