Fix make build: invoke prepare-sandbox-build-context.py via venv - #2643
Merged
Conversation
`scripts/prepare-sandbox-build-context.py` has a `#!/usr/bin/env python3` shebang. The build recipe invoked it directly, which resolves to system python — and system python has no PyYAML, so the script aborts with "Error: PyYAML is required" before any docker build runs. CI's test-integration job hit this after `uv sync --extra dev` populated `.venv/` but `make build` skipped it. Switch to `$(PYTHON)`, which already resolves to `.venv/bin/python` when the venv exists (the same pattern used by `make test` / `make lint` / `make security`), and gate the target on `sync-venv-if-uv` so a fresh worktree provisions the venv before the script runs.
Contributor
|
egg review completed. View run logs |
4 tasks
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.
Summary
make buildwas failing in the integration-tests CI job with:Observed on PR #2642 (run 25752177721).
Root cause
scripts/prepare-sandbox-build-context.pyhas a#!/usr/bin/env python3shebang. Thebuildrecipe invoked it directly:That resolves to system
python3, which has no PyYAML — so_load_repos_config()aborts before anydocker buildruns. The.github/workflows/test-integration.ymljob doesuv sync --extra devfirst, which populates.venv/with the project's pinned PyYAML, butmake buildbypassed it.This is the same pattern other targets (
test,lint,security) avoid by routing through$(PYTHON)(Makefile:21), which resolves to.venv/bin/pythonwhen the venv exists and falls back topython3otherwise.Fix
$(PYTHON)so the venv's interpreter (and pinned PyYAML) is used.buildonsync-venv-if-uvso a fresh worktree provisions.venvbefore the script runs — same prereq pattern astest/lint/security.Test plan
make buildin the integration-tests job — it must reach thedocker buildsteps (the failure mode was the script aborting before any image build).