Background
The py preset's user story (user_stories/py.md) builds and tests the sample (aspect build / aspect test) but intentionally does not bazel run the py_binary, unlike every other language's story which runs its sample. This is a workaround.
Why
aspect_rules_py (2.0.0-alpha.3) uses the hermetic_launcher stub for py_binary. Running a py_binary via bazel run aborts with ERROR: execve failed with errno 2: under bazel run the launcher gets a relative argv[0], cwd inside the runfiles tree, and no RUNFILES_DIR, so <argv[0]>.runfiles discovery fails and the venv-python rlocation never resolves.
bazel test is unaffected (it sets RUNFILES_DIR), which is why the story uses build+test.
Action (once the launcher fix is released)
- Wait for hermetic-launcher#44 to land + release, then for rules_py to bump
hermetic_launcher and cut a release including it.
- Bump
aspect_rules_py in template/MODULE.bazel to that release.
- Revert the
py.md workaround so the story runs the sample, e.g.:
output=$(bazel run //hello/py:hello)
echo "$output" | grep -q "Hello, world!"
and the cmd/greet section's bazel run //cmd/greet:main check.
Verify
sh user_stories/py.md passes end-to-end with the bazel run steps restored, and the py + kitchen-sink preset CI legs stay green.
Background
The
pypreset's user story (user_stories/py.md) builds and tests the sample (aspect build/aspect test) but intentionally does notbazel runthepy_binary, unlike every other language's story which runs its sample. This is a workaround.Why
aspect_rules_py(2.0.0-alpha.3) uses thehermetic_launcherstub forpy_binary. Running apy_binaryviabazel runaborts withERROR: execve failed with errno 2: underbazel runthe launcher gets a relativeargv[0], cwd inside the runfiles tree, and noRUNFILES_DIR, so<argv[0]>.runfilesdiscovery fails and the venv-python rlocation never resolves.bazel testis unaffected (it setsRUNFILES_DIR), which is why the story uses build+test.Action (once the launcher fix is released)
hermetic_launcherand cut a release including it.aspect_rules_pyintemplate/MODULE.bazelto that release.py.mdworkaround so the story runs the sample, e.g.:cmd/greetsection'sbazel run //cmd/greet:maincheck.Verify
sh user_stories/py.mdpasses end-to-end with thebazel runsteps restored, and the py + kitchen-sink preset CI legs stay green.