Skip to content

Commit 2d7ff9d

Browse files
authored
chore: clarify type of paths for some system_python variables (#3665)
Clarify that some variables are runfiles-root relative paths so that their values aren't confused to be "main repo" runfiles relative paths like "../foo"
1 parent 73cad42 commit 2d7ff9d

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

python/private/python_bootstrap_template.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ import sys
1010
import os
1111
import subprocess
1212
import uuid
13-
# runfiles-relative path
1413
# NOTE: The sentinel strings are split (e.g., "%stage2" + "_bootstrap%") so that
1514
# the substitution logic won't replace them. This allows runtime detection of
1615
# unsubstituted placeholders, which occurs when native py_binary is used in
1716
# external repositories. In that case, we fall back to %main% which Bazel's
1817
# native rule does substitute.
1918
_STAGE2_BOOTSTRAP_SENTINEL = "%stage2" + "_bootstrap%"
19+
# runfiles-root-relative path
2020
STAGE2_BOOTSTRAP="%stage2_bootstrap%"
2121

2222
# NOTE: The fallback logic from stage2_bootstrap to main is only present
@@ -35,13 +35,13 @@ if not STAGE2_BOOTSTRAP:
3535
print("ERROR: %stage2_bootstrap% (or %main%) was not substituted.", file=sys.stderr)
3636
sys.exit(1)
3737

38-
# runfiles-relative path to venv's python interpreter
38+
# runfiles-root-relative path to venv's python interpreter
3939
# Empty string if a venv is not setup.
4040
PYTHON_BINARY = '%python_binary%'
4141

4242
# The path to the actual interpreter that is used.
4343
# Typically PYTHON_BINARY is a symlink pointing to this.
44-
# runfiles-relative path, absolute path, or single word.
44+
# runfiles-root-relative path, absolute path, or single word.
4545
# Used to create a venv at runtime, or when a venv isn't setup.
4646
PYTHON_BINARY_ACTUAL = "%python_binary_actual%"
4747

0 commit comments

Comments
 (0)