Repository navigation
fix(image): bake template .venv into Nix image - #745
Merged
Merged
Conversation
The image advertises UV_PROJECT_ENVIRONMENT/VIRTUAL_ENV at /root/assets/workspace/.venv but never created it, so consumer post-create.sh aborted under set -e on the first .venv/bin/activate step. Pre-create the venv from the baked CPython in the bootstrap layer (hermetic, no deps). Refs: #735
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
The Nix-built image sets
UV_PROJECT_ENVIRONMENT/VIRTUAL_ENVto/root/assets/workspace/.venvbut never created that venv (the old Debian image did). The published 0.3.x consumerpost-create.shrunssed -i .../.venv/bin/activateas its first venv step and aborts underset -euo pipefail(exit 2) when the file is missing — so git setup, gh auth, pre-commit install, andjust syncnever run. Reproduced on 4/4 non-TypeScript consumers.Change
flake.nix: the bootstrap layer (which already creates/opt/pre-commit-cache,/workspace,/usr/local/bin,/tmp) now pre-creates the project virtualenv from the baked CPython:${python}/bin/python3 -m venv "$out/root/assets/workspace/.venv"— hermetic, network-free, no packages (the consumer'sjust sync/uvpopulates it).$outprefix baked intoactivate/pyvenv.cfgsoVIRTUAL_ENVresolves to the runtime path/root/assets/workspace/.venvinside the container. The advertised env vars are unchanged (the path is already writable —assetsiscp -r'd, not a store symlink).tests/test_image.py: newTestFileStructure::test_template_venv_bakedasserts/root/assets/workspace/.venv/bin/activateexists (runs in the CIimagesuite).CHANGELOG.md## Unreleased→### Fixedentry[#735], mirrored intoassets/workspace/.devcontainer/CHANGELOG.mdviasync_manifest.py.Verification
nix eval --raw .#devcontainerImage.drvPath --accept-flake-config→/nix/store/k5vkv59hx1ln62lvbcwivhyh3pqbg4gy-devcontainer.tar.gz.drv(flake evaluates).imagesuite (no local build — sandbox has no network).Closes #735