test: pass PYTHONPATH to the test52 subprocess - #4
Merged
Conversation
The child process starts with no env of its own. rules_python builds the runner's sys.path in-process through its bootstrap, so the child cannot import cppjit when the package is a consumer's external bazel module. The CMake lanes export PYTHONPATH, which masked the gap. Co-developed-with-the-help-of: Claude Code (Fable 5, human in the loop)
Test Results
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
test52fails in a consumer's Bazel build withModuleNotFoundError: No module named 'cppjit'.[sys.executable, "-c", repro]with noenv, so the child starts with a baresys.path.sys.pathin-process through its bootstrap. It sets noPYTHONPATH, so the child inherits nothing. The CMake lanes exportPYTHONPATH, so the defect does not show there.sys.pathasPYTHONPATH. Thesitecustomizedirectory is on that path, so the child also gets theLD_LIBRARY_PATHanchoring.Gates:
ruff0.16.3:ruff checkandruff format --checkare clean.bazelisk test //:test_regressionis green in this workspace.--override_moduleon this commit.test52passes; it does not xfail.The same hunk is on the upstream
opstr-null-guardbranch, sotest/test_regression.pystays byte-identical between the two.🤖 Done with the help of Claude Code (Fable 5, human in the loop)