Skip to content

fix(make): ensure venv.execute succeeds on re-runs by resetting venv permissions#193

Open
xgantan wants to merge 1 commit intorenderedtext:masterfrom
xgantan:fix-python3-venv-execute
Open

fix(make): ensure venv.execute succeeds on re-runs by resetting venv permissions#193
xgantan wants to merge 1 commit intorenderedtext:masterfrom
xgantan:fix-python3-venv-execute

Conversation

@xgantan
Copy link

@xgantan xgantan commented Feb 9, 2026

Since Python 3.13, python3 -m venv can create read-only files, causing subsequent runs to fail. Pre-set write permissions on existing venv dir before recreating.

Before

$ make packer.init
make venv.execute COMMAND='cd packer/linux && packer init .'
make[1]: Entering directory '/.../agent-aws-stack'
python3 -m venv venv && \
. venv/bin/activate && \
pip install --upgrade pip && \
pip install -r requirements.txt && \
cd packer/linux && packer init . && \
deactivate && \
cd -
Error: [Errno 13] Permission denied: '/.../agent-aws-stack/venv/bin/activate.csh'
make[1]: *** [Makefile:60: venv.execute] Error 1
make[1]: Leaving directory '/.../agent-aws-stack'
make: *** [Makefile:130: packer.init] Error 2

After

$ make packer.init
make venv.execute COMMAND='cd packer/linux && packer init .'
make[1]: Entering directory '/home/xg/Workspaces/agent-aws-stack'
[ -d venv ] && chmod -R u+w venv || true && \
python3 -m venv venv && \
. venv/bin/activate && \
pip install --upgrade pip && \
pip install -r requirements.txt && \
cd packer/linux && packer init . && \
deactivate && \
cd -
...
Requirement already satisfied: pycparser in ./venv/lib/python3.13/site-packages (from cffi>=2.0.0->cryptography->ansible-core~=2.15.5->ansible==8.5.0->-r requirements.txt (line 1)) (3.0)
/.../agent-aws-stack
make[1]: Leaving directory '/.../agent-aws-stack'

@xgantan xgantan force-pushed the fix-python3-venv-execute branch 3 times, most recently from c8c932e to 54dd6c9 Compare February 9, 2026 21:34
…permissions

`python3 -m venv` can create read-only files, causing subsequent runs to
fail. Pre-set write permissions on existing venv dir before recreating.
@xgantan xgantan force-pushed the fix-python3-venv-execute branch from 54dd6c9 to 392ceb0 Compare February 9, 2026 21:48
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