Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit df308be

Browse filesBrowse files
authored
safely check for standalone interpreter sentinel files (bazel-contrib#750)
1 parent 4984423 commit df308be
Copy full SHA for df308be

File tree

1 file changed

+3
-1
lines changed
Filter options

1 file changed

+3
-1
lines changed

‎python/pip_install/pip_repository.bzl

Copy file name to clipboardExpand all lines: python/pip_install/pip_repository.bzl
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,12 @@ def _maybe_set_xcode_location_cflags(rctx, environment):
7373
Pip won't be able to compile c extensions from sdists with the pre built python distributions from indygreg
7474
otherwise. See https://github.com/indygreg/python-build-standalone/issues/103
7575
"""
76+
python_interpreter_workspace = rctx.path(Label("@{}//:WORKSPACE".format(rctx.attr.python_interpreter_target.workspace_name))).dirname
7677
if (
7778
rctx.os.name.lower().startswith("mac os") and
7879
rctx.attr.python_interpreter_target != None and
79-
rctx.path(Label("@{}//:{}".format(rctx.attr.python_interpreter_target.workspace_name, STANDALONE_INTERPRETER_FILENAME))) and
80+
# This is a rules_python provided toolchain.
81+
rctx.execute(["ls", "{}/{}".format(python_interpreter_workspace, STANDALONE_INTERPRETER_FILENAME)]).return_code == 0 and
8082
not environment.get(CPPFLAGS)
8183
):
8284
xcode_sdk_location = rctx.execute(["xcode-select", "--print-path"])

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.