A compiler in the web container
Runs 12 and 13 failed the same way, and 12 is yours rather than mine — the
three test jobs were green in both and `web` died before it fetched anything:
toolchain: this needs cc on PATH and cannot fetch them
tools/build-web.sh: line 63: flutter: command not found
`require_host_tools` gates on `cc` because `nim c` shells out to one. It is one
gate for every toolchain user rather than one per subcommand, so the web build
is held to it as well — and `debian:13-slim` has no compiler. The container's
own comment said the image owed the toolchain "a C runtime", which was true
until the toolchain started wanting a C compiler.
So: gcc, and the comment says why it is there for a container that never
compiles any Nim. The `dev` container already carries build-essential and
needed nothing.
Verified by running it rather than by reading it — `just modal web` now gets
past the gate, fetches flutter, jdk, clojure and nim, and prints
`✓ Built build/web`.
The alternative, if the gate is meant to be narrower than this: check for cc
only on the paths that use Nim. That is a change to your design rather than to
a container, so I have not made it.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>32aed8b parent: 36bdfc5 modified
.modal/web/container.toml +8 -2 | @@ -4,7 +4,13 @@ description = "the Flutter web build, incremental, from a pinned toolchain" | ||
| 4 | 4 | # `debian:13-slim` and not `arch-nix`: there is no nix in this container any |
| 5 | 5 | # more. The build is `tools/build-web.sh`, which fetches its own Flutter, JDK |
| 6 | 6 | # and Clojure CLI by pinned sha256, so what the image owes it is curl, git, |
| 7 | -# tar and a C runtime — and the smallest image that has them is the right one. | |
| 7 | +# tar and a C compiler — and the smallest image that has them is the right one. | |
| 8 | +# | |
| 9 | +# gcc for the `cc` that `require_host_tools` gates on. This container never | |
| 10 | +# compiles Nim, but the check is one gate for every toolchain user rather than | |
| 11 | +# one per subcommand, and a web build without a compiler is what failed CI: | |
| 12 | +# `toolchain: this needs cc on PATH and cannot fetch them`, and then flutter | |
| 13 | +# not found, because the gate exits before anything is fetched. | |
| 8 | 14 | registry = "debian:13-slim" |
| 9 | 15 | # A Sandbox, not a Function: it runs on a real VM, the command is the |
| 10 | 16 | # sandbox's own process so it dies when the command does, and only a Sandbox |
| @@ -27,7 +33,7 @@ include = ["."] | ||
| 27 | 33 | # SDK and the toolchain tarballs arrive as; rsync for the sync below; |
| 28 | 34 | # ca-certificates so curl can verify what it fetches. |
| 29 | 35 | setup = [ |
| 30 | - "apt-get update && apt-get install -y --no-install-recommends ca-certificates curl git rsync tar unzip xz-utils && rm -rf /var/lib/apt/lists/*", | |
| 36 | + "apt-get update && apt-get install -y --no-install-recommends ca-certificates curl gcc git rsync tar unzip xz-utils && rm -rf /var/lib/apt/lists/*", | |
| 31 | 37 | ] |
| 32 | 38 | # The build state a local checkout carries, wanted by nothing out here: this |
| 33 | 39 | # container builds into a volume of its own, and the clojure caches |
| @@ -4,7 +4,13 @@ description = "the Flutter web build, incremental, from a pinned toolchain" | |||
| 4 | # `debian:13-slim` and not `arch-nix`: there is no nix in this container any | 4 | # `debian:13-slim` and not `arch-nix`: there is no nix in this container any |
| 5 | # more. The build is `tools/build-web.sh`, which fetches its own Flutter, JDK | 5 | # more. The build is `tools/build-web.sh`, which fetches its own Flutter, JDK |
| 6 | # and Clojure CLI by pinned sha256, so what the image owes it is curl, git, | 6 | # and Clojure CLI by pinned sha256, so what the image owes it is curl, git, |
| 7 | -# tar and a C runtime — and the smallest image that has them is the right one. | 7 | +# tar and a C compiler — and the smallest image that has them is the right one. |
| 8 | +# | ||
| 9 | +# gcc for the `cc` that `require_host_tools` gates on. This container never | ||
| 10 | +# compiles Nim, but the check is one gate for every toolchain user rather than | ||
| 11 | +# one per subcommand, and a web build without a compiler is what failed CI: | ||
| 12 | +# `toolchain: this needs cc on PATH and cannot fetch them`, and then flutter | ||
| 13 | +# not found, because the gate exits before anything is fetched. | ||
| 8 | registry = "debian:13-slim" | 14 | registry = "debian:13-slim" |
| 9 | # A Sandbox, not a Function: it runs on a real VM, the command is the | 15 | # A Sandbox, not a Function: it runs on a real VM, the command is the |
| 10 | # sandbox's own process so it dies when the command does, and only a Sandbox | 16 | # sandbox's own process so it dies when the command does, and only a Sandbox |
| @@ -27,7 +33,7 @@ include = ["."] | |||
| 27 | # SDK and the toolchain tarballs arrive as; rsync for the sync below; | 33 | # SDK and the toolchain tarballs arrive as; rsync for the sync below; |
| 28 | # ca-certificates so curl can verify what it fetches. | 34 | # ca-certificates so curl can verify what it fetches. |
| 29 | setup = [ | 35 | setup = [ |
| 30 | - "apt-get update && apt-get install -y --no-install-recommends ca-certificates curl git rsync tar unzip xz-utils && rm -rf /var/lib/apt/lists/*", | 36 | + "apt-get update && apt-get install -y --no-install-recommends ca-certificates curl gcc git rsync tar unzip xz-utils && rm -rf /var/lib/apt/lists/*", |
| 31 | ] | 37 | ] |
| 32 | # The build state a local checkout carries, wanted by nothing out here: this | 38 | # The build state a local checkout carries, wanted by nothing out here: this |
| 33 | # container builds into a volume of its own, and the clojure caches | 39 | # container builds into a volume of its own, and the clojure caches |