Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion python/private/python_bootstrap_template.txt
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,13 @@ def Main():
print_verbose("initial cwd:", os.getcwd())
print_verbose("initial environ:", mapping=os.environ)
print_verbose("initial sys.path:", values=sys.path)
print_verbose("STAGE2_BOOTSTRAP:", STAGE2_BOOTSTRAP)
print_verbose("PYTHON_BINARY:", PYTHON_BINARY)
print_verbose("PYTHON_BINARY_ACTUAL:", PYTHON_BINARY_ACTUAL)
print_verbose("IS_ZIPFILE:", IS_ZIPFILE)
print_verbose("RECREATE_VENV_AT_RUNTIME:", RECREATE_VENV_AT_RUNTIME)
print_verbose("WORKSPACE_NAME :", WORKSPACE_NAME )

args = sys.argv[1:]

new_env = {}
Expand All @@ -391,6 +398,7 @@ def Main():
# matters if `_main` doesn't exist (which can occur if a binary
# is packaged and needs no artifacts from the main repo)
main_rel_path = os.path.normpath(STAGE2_BOOTSTRAP)
print_verbose("main_rel_path:", main_rel_path)

if IsRunningFromZip():
module_space = CreateModuleSpace()
Expand All @@ -399,6 +407,8 @@ def Main():
module_space = FindModuleSpace(main_rel_path)
delete_module_space = False

print_verbose("runfiles root:", module_space)

if os.environ.get("RULES_PYTHON_TESTING_TELL_MODULE_SPACE"):
new_env["RULES_PYTHON_TESTING_MODULE_SPACE"] = module_space

Expand All @@ -419,7 +429,10 @@ def Main():

program = python_program = FindPythonBinary(module_space)
if python_program is None:
raise AssertionError('Could not find python binary: ' + repr(PYTHON_BINARY))
raise AssertionError("Could not find python binary: {} or {}".format(
repr(PYTHON_BINARY),
repr(PYTHON_BINARY_ACTUAL)
))

# Some older Python versions on macOS (namely Python 3.7) may unintentionally
# leave this environment variable set after starting the interpreter, which
Expand Down