fix(exec): HostMode always installs modal itself (calque#200) - #201
Merged
Conversation
… venv (calque#200) Found via a real calque spawn-run run against AI-Almanac's forecasts_app.py, right after calque#198's sibling-function fix correctly shipped an extra that bare-references modal: "@Enter failed: No module named 'modal'". uvPythonArgv (run.go, dry-run's own mechanism) has an explicit design decision to always include "modal" in its --with list -- a real script's body routinely references modal.Secret/modal.Volume/etc. directly even though Modal's SDK is never itself a pip_install(...) entry in the script's own .image chain. bootstrap.go's HostMode branch had no equivalent: its uv pip install step was entirely gated behind len(PipPackages) > 0, so a run with no --pip flags (spawn-run has no --pip flag at all) installed zero packages, not even modal. HostMode now always merges "modal" into the installed package set (deduped/sorted, mirroring uvPythonArgv's exact discipline). The git-availability check (for a --pip git-URL spec) now only runs when a real --pip package was supplied, since modal alone needs no git.
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
calque spawn-runrun against AI-Almanac'sforecasts_app.py, right after calque#198's sibling-function fix correctly shipped an extra that bare-referencesmodal:@enter failed: No module named 'modal'.run.go'suvPythonArgv(dry-run's own mechanism) has an explicit design decision: always include"modal"in its--withlist, since a real script's body routinely referencesmodal.Secret/modal.Volume/etc. directly even though Modal's SDK is never itself apip_install(...)entry in the script's own.imagechain.internal/exec/bootstrap.go's HostMode branch (used byreal/fleetrun/spawn-run) had no equivalent guarantee — itsuv pip installstep was entirely gated behindlen(PipPackages) > 0, so a run with no--pipflags (the common case;spawn-runhas no--pipflag at all) installed ZERO packages, not evenmodal."modal"into the installed package set, deduped/sorted, mirroringuvPythonArgv's exact discipline. The git-availability check (for a--pipgit-URL spec) now only runs when a real--pippackage was actually supplied, sincemodalalone needs no git.Files touched
internal/exec/bootstrap.go— the actual fix.internal/exec/bootstrap_demo_test.go— updated the now-stale "no-deps host-mode has nothing to pip-install" assertion to the corrected behavior, plus two new tests (modal merged in alongside real--pippackages; not duplicated if--pip modalis passed explicitly).CHANGELOG.md.Test plan
go build ./... && go vet ./... && gofmt -l . && go test -count=1 ./...— all passgolangci-lint run ./...— 0 issuesruff check .— all checks passed