grind(): os.path.join(work, abs_path) discards worktree in bwrap sandbox #2
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Analysis
In
grind()(the--oncemode ofbullpen-grinder), whentest_relis an absolute path,os.path.join(work, test_rel)discards the worktree path and returns the absolute path instead. This path doesn't exist inside the bwrap sandbox because/tmpis a fresh tmpfs.The bug
In
grind()on boltzmann at/usr/local/bin/bullpen-grinder, line 301:When
test_relis an absolute path like/tmp/bullpen-build/mneme-namespace-ranking/tests/test_namespace_query.py, Python'sos.path.joindiscards the first argument if the second is absolute:This means it looks for the file at the original repo path, NOT inside the worktree.
Then inside
run_tests(), bwrap runs the test inside a sandbox with--tmpfs /tmp(line 170 of bullpen-grinder):The original repo at
/tmp/bullpen-build/...is under/tmpwhich is shadowed by the fresh tmpfs. Only the worktree atworkis bound.Impact
When the coordinator resolves
test_relto an absolute path (e.g. via the full-absolute SPEC formatSPEC: /tmp/.../tests/test_file.py), the grinder can't find the test file inside the sandbox and fails immediately with:Workaround
Ensure
test_relis always a relative path (e.g.tests/test_file.py). The named-file fallback in_resolve_test_relreturns relative paths fromgit ls-files, which work correctly.Room reference
INVALID TICKET ❌ — / ...does not exist in /tmp/bullpen-build/.../tmp/grind-result-1784965351.txt,/tmp/grind-result-1784964238.txt,/tmp/grind-result-1784963754.txtall show this error patternHosts
grind()runs here; code in/usr/local/bin/bullpen-grinderSuggested fix
In
grind(), before usingtest_rel, strip the REPO prefix iftest_relis absolute:This converts
/tmp/bullpen-build/mneme-namespace-ranking/tests/test_file.pytotests/test_file.py, which then works correctly withos.path.join(work, ...).