Skip to content

Fix make build: invoke prepare-sandbox-build-context.py via venv - #2643

Merged
jwbron merged 1 commit into
mainfrom
egg/fix-make-build-pyyaml
May 12, 2026
Merged

Fix make build: invoke prepare-sandbox-build-context.py via venv#2643
jwbron merged 1 commit into
mainfrom
egg/fix-make-build-pyyaml

Conversation

@jwbron

@jwbron jwbron commented May 12, 2026

Copy link
Copy Markdown
Owner

Summary

make build was failing in the integration-tests CI job with:

==> Preparing sandbox build context from repositories.yaml...
Error: PyYAML is required. Install with: pip install pyyaml
make: *** [Makefile:463: build] Error 1

Observed on PR #2642 (run 25752177721).

Root cause

scripts/prepare-sandbox-build-context.py has a #!/usr/bin/env python3 shebang. The build recipe invoked it directly:

@scripts/prepare-sandbox-build-context.py repo-deps

That resolves to system python3, which has no PyYAML — so _load_repos_config() aborts before any docker build runs. The .github/workflows/test-integration.yml job does uv sync --extra dev first, which populates .venv/ with the project's pinned PyYAML, but make build bypassed it.

This is the same pattern other targets (test, lint, security) avoid by routing through $(PYTHON) (Makefile:21), which resolves to .venv/bin/python when the venv exists and falls back to python3 otherwise.

Fix

  • Route the script through $(PYTHON) so the venv's interpreter (and pinned PyYAML) is used.
  • Gate build on sync-venv-if-uv so a fresh worktree provisions .venv before the script runs — same prereq pattern as test/lint/security.

Test plan

`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.
@jwbron
jwbron merged commit cf0f9aa into main May 12, 2026
14 checks passed
@james-in-a-box

Copy link
Copy Markdown
Contributor

egg review completed. View run logs

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