Skip to content

test: pass PYTHONPATH to the test52 subprocess - #4

Merged
conrade-ctc merged 1 commit into
ctc-masterfrom
ctc35-test52-pythonpath
Aug 31, 2026
Merged

test: pass PYTHONPATH to the test52 subprocess#4
conrade-ctc merged 1 commit into
ctc-masterfrom
ctc35-test52-pythonpath

Conversation

@conrade-ctc

Copy link
Copy Markdown
Collaborator

test52 fails in a consumer's Bazel build with ModuleNotFoundError: No module named 'cppjit'.

  • Symptom: the test spawns [sys.executable, "-c", repro] with no env, so the child starts with a bare sys.path.
  • Cause: rules_python builds the runner's sys.path in-process through its bootstrap. It sets no PYTHONPATH, so the child inherits nothing. The CMake lanes export PYTHONPATH, so the defect does not show there.
  • Fix: give the child the parent's sys.path as PYTHONPATH. The sitecustomize directory is on that path, so the child also gets the LD_LIBRARY_PATH anchoring.

Gates:

  • Pinned ruff 0.16.3: ruff check and ruff format --check are clean.
  • bazelisk test //:test_regression is green in this workspace.
  • Green through the consumer's Bazel build with --override_module on this commit. test52 passes; it does not xfail.

The same hunk is on the upstream opstr-null-guard branch, so test/test_regression.py stays byte-identical between the two.

🤖 Done with the help of Claude Code (Fable 5, human in the loop)

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)
@conrade-ctc
conrade-ctc merged commit 01af13e into ctc-master Aug 31, 2026
7 of 8 checks passed
@github-actions

Copy link
Copy Markdown

Test Results

Configuration Result
macos-26-intel-llvm21-py3.14-cxx20 = 1 failed, 441 passed, 46 skipped, 85 xfailed, 32 xpassed, 100 warnings in 106.68s (0:01:46) =
macos-26-llvm21-py3.14-cxx20 ==== 443 passed, 39 skipped, 93 xfailed, 30 xpassed, 100 warnings in 55.06s ====
ubuntu-24.04-llvm21-py3.14-cxx20-vg ====== 559 passed, 26 skipped, 18 xfailed, 2 xpassed in 67.95s (0:01:07) =======
ubuntu-24.04-llvm22-py3.14-cxx20 ====== 558 passed, 26 skipped, 20 xfailed, 1 xpassed in 104.75s (0:01:44) ======
ubuntu-24.04-llvm22-py3.14-cxx20-cling ====== 549 passed, 26 skipped, 27 xfailed, 3 xpassed in 96.31s (0:01:36) =======
ubuntu-24.04-llvm22-py3.14-cxx23 ====== 579 passed, 4 skipped, 21 xfailed, 1 xpassed in 104.74s (0:01:44) =======

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant