Skip to content

Commit 299cb89

Browse files
committed
Hack: For now point to hermetic, but not deterministic python
1 parent 11d8473 commit 299cb89

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

python/repositories.bzl

+10-11
Original file line numberDiff line numberDiff line change
@@ -162,18 +162,17 @@ def _python_repository_impl(rctx):
162162
fail("The current user has CAP_DAC_OVERRIDE set, please drop this capability when using the hermetic Python interpreter. See https://github.com/bazelbuild/rules_python/pull/713.")
163163

164164
python_bin = "python.exe" if ("windows" in platform) else "bin/python3"
165-
print(native.bazel_version)
166165
if _parse_native_bazel_version(native.bazel_version) >= (5,0,0):
167-
# abs_python_bin_path = rctx.path(python_bin)
168-
# stub_shebang_assignment = "stub_shebang = \"#!{}\"".format(abs_python_bin_path)
169-
170-
execroot = "/".join(str(rctx.path(".")).replace("\\", "/").split("/")[:-2])
171-
print(execroot)
172-
python_bin_path = str(rctx.path(python_bin)).removeprefix(execroot + "/")
173-
print(python_bin_path)
174-
shebang_line = "#!./" + python_bin_path
175-
print(shebang_line)
176-
stub_shebang_assignment = "stub_shebang = '{}',".format(shebang_line)
166+
abs_python_bin_path = rctx.path(python_bin)
167+
stub_shebang_assignment = "stub_shebang = \"#!{}\"".format(abs_python_bin_path)
168+
169+
#execroot = "/".join(str(rctx.path(".")).replace("\\", "/").split("/")[:-2])
170+
#print(execroot)
171+
#python_bin_path = str(rctx.path(python_bin)).removeprefix(execroot + "/")
172+
#print(python_bin_path)
173+
#shebang_line = "#!./" + python_bin_path
174+
#print(shebang_line)
175+
#stub_shebang_assignment = "stub_shebang = '{}',".format(shebang_line)
177176
else:
178177
stub_shebang_assignment = ""
179178

0 commit comments

Comments
 (0)