fix(image): add /usr/bin/env so shebang scripts exec in the container #89
No reviewers
Labels
No labels
epic
in-review
ready-for-agent
ready-for-human
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
weiwen/evie!89
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fm/evie-usr-bin-env-image"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Root cause
nix
dockerToolsimages only contain the store paths listed incontentsplus whateverextraCommandscreates, so/usr/binnever existed inevie:latest. The kernel resolves ashebang interpreter by absolute path, so any script starting with
#!/usr/bin/env ...fails toexec with ENOENT before the interpreter is ever consulted.
The scheduled briefings run exactly such scripts on the daemon/sudo path
(
argv=["run", ".../prompts/morning-briefing.py"], first line#!/usr/bin/env -S uv run --script),so on every fire the daemon logged:
The scripts,
uv,python3andchromiumwere all present in the image. Only/usr/bin/envwasmissing. The NixOS host provided it, which is why this only broke after the Docker cutover.
Fix
eviedaemonImage'sextraCommandsnow creates/usr/bin/envas a symlink to coreutils'env(a multi-call binary that dispatches on argv0, so an
env-named link behaves asenv).Verification
nix build .#eviedaemonImagesucceeds; the symlink lands in the customisation layer:Loaded the built image and ran a real
uv run --scriptshebang script inside it:where
shebang-check.pybegins#!/usr/bin/env -S uv run --script. Before this change the sameinvocation is the ENOENT seen in production.
just checkis green (clippy-D warnings+ 490 tests).Deploy note
A temporary
/usr/bin/envbind-mount hotfix is currently live in~/evie-docker-deploykeepingthe schedules working. It can be retired once this image lands and is redeployed.
Follow-up (out of scope here)
The bwrap sandbox binds only
/nix, so sandboxed children still have no/usr/bin/env. That is aseparate surface (
sandbox_setenv_args/ bind args insrc/pi.rs) and was deliberately nottouched. Worth a follow-up if any sandboxed script relies on that shebang.