Skip to content

Commit eb0a7c0

Browse files
committed
Add workaround for buggy zip file bootstrap.
1 parent c1c8394 commit eb0a7c0

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

tests/runtime_env_toolchain/toolchain_runs_test.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,20 @@
1010
class RunTest(unittest.TestCase):
1111
def test_ran(self):
1212
rf = runfiles.Create()
13-
settings_path = rf.Rlocation(
14-
"rules_python/tests/support/current_build_settings.json"
15-
)
13+
try:
14+
settings_path = rf.Rlocation(
15+
"rules_python/tests/support/current_build_settings.json"
16+
)
17+
except ValueError as e:
18+
# The current toolchain being used has a buggy zip file bootstrap, which
19+
# leaves RUNFILES_DIR pointing at the first stage path and not the module
20+
# path.
21+
if platform.system() != "Windows" or "does not lie under the runfiles root" not in str(e):
22+
raise e
23+
settings_path = "./tests/support/current_build_settings.json"
24+
1625
settings = json.loads(pathlib.Path(settings_path).read_text())
26+
1727
if platform.system() == "Windows":
1828
self.assertEqual(
1929
"/_magic_pyruntime_sentinel_do_not_use", settings["interpreter_path"]

0 commit comments

Comments
 (0)