Skip to content

Commit 2a9b6a4

Browse files
committed
fix(shell): provide C linker for Rust browser install
- Add build-essential to generated project images before cargo install - Assert Dockerfile templates keep the cc toolchain needed by Rust build scripts Root cause: cargo install of rust-browser-connection failed in E2E images with linker 'cc' not found.
1 parent 733be1d commit 2a9b6a4

4 files changed

Lines changed: 10 additions & 8 deletions

File tree

packages/app/src/lib/core/templates/dockerfile-prelude.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
// COMPLEXITY: O(1)/O(1)
1010
const dockerGitBaseImage = "konard/box-js:2.1.1"
1111

12-
// CHANGE: include tmux in generated project images for durable terminal multiplexing.
13-
// WHY: stable project SSH links attach to persisted tmux sessions instead of one-off shell processes.
12+
// CHANGE: include tmux and build-essential in generated project images for durable sessions and Rust crate installation.
13+
// WHY: stable project SSH links need persisted tmux sessions, and cargo install of proc-macro/build-script dependencies requires a C linker.
1414
// QUOTE(ТЗ): n/a
1515
// REF: PR-309
1616
// SOURCE: n/a
1717
// PURITY: CORE
18-
// INVARIANT: generated base image contains the terminal multiplexer required by project SSH sessions.
18+
// INVARIANT: generated base image contains both the terminal multiplexer and cc toolchain required before Rust browser CLI installation.
1919
// COMPLEXITY: O(1)/O(1)
2020
const renderDockerfileBase = (): string =>
2121
`ARG DOCKER_GIT_BASE_IMAGE=${dockerGitBaseImage}
@@ -48,7 +48,7 @@ RUN set -eu; \
4848
done; \
4949
apt-get -o Acquire::Retries=3 install -y --no-install-recommends \
5050
openssh-server git gh ca-certificates curl unzip bsdutils sudo tmux \
51-
make docker.io docker-compose-v2 bash-completion zsh zsh-autosuggestions xauth \
51+
make build-essential docker.io docker-compose-v2 bash-completion zsh zsh-autosuggestions xauth \
5252
ncurses-term jq \
5353
&& rm -rf /var/lib/apt/lists/*`
5454

packages/app/tests/docker-git/core-templates.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ describe("app planFiles", () => {
6363
expect(dockerfile.contents).toContain(
6464
"cargo install --git https://github.com/ProverCoderAI/rust-browser-connection"
6565
)
66+
expect(dockerfile.contents).toContain("make build-essential docker.io")
6667
expect(dockerfile.contents).toContain("docker-git-playwright-mcp")
6768
expect(entrypoint.contents).toContain("docker_git_start_rust_browser_connection")
6869
expect(entrypoint.contents).toContain("docker-git-browser-connection")

packages/lib/src/core/templates/dockerfile-prelude.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
// COMPLEXITY: O(1)/O(1)
1010
const dockerGitBaseImage = "konard/box-js:2.1.1"
1111

12-
// CHANGE: include tmux in generated project images for durable terminal multiplexing.
13-
// WHY: stable project SSH links attach to persisted tmux sessions instead of one-off shell processes.
12+
// CHANGE: include tmux and build-essential in generated project images for durable sessions and Rust crate installation.
13+
// WHY: stable project SSH links need persisted tmux sessions, and cargo install of proc-macro/build-script dependencies requires a C linker.
1414
// QUOTE(ТЗ): n/a
1515
// REF: PR-309
1616
// SOURCE: n/a
1717
// PURITY: CORE
18-
// INVARIANT: generated base image contains the terminal multiplexer required by project SSH sessions.
18+
// INVARIANT: generated base image contains both the terminal multiplexer and cc toolchain required before Rust browser CLI installation.
1919
// COMPLEXITY: O(1)/O(1)
2020
const renderDockerfileBase = (): string =>
2121
`ARG DOCKER_GIT_BASE_IMAGE=${dockerGitBaseImage}
@@ -48,7 +48,7 @@ RUN set -eu; \
4848
done; \
4949
apt-get -o Acquire::Retries=3 install -y --no-install-recommends \
5050
openssh-server git gh ca-certificates curl unzip bsdutils sudo tmux \
51-
make docker.io docker-compose-v2 bash-completion zsh zsh-autosuggestions xauth \
51+
make build-essential docker.io docker-compose-v2 bash-completion zsh zsh-autosuggestions xauth \
5252
ncurses-term jq \
5353
&& rm -rf /var/lib/apt/lists/*`
5454

packages/lib/tests/core/templates.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ describe("renderDockerfile", () => {
8989

9090
expect(dockerfile).toContain("ARG DOCKER_GIT_BASE_IMAGE=konard/box-js:2.1.1")
9191
expect(dockerfile).toContain("FROM ${DOCKER_GIT_BASE_IMAGE}")
92+
expect(dockerfile).toContain("make build-essential docker.io")
9293
expect(dockerfile).toContain(
9394
"#checkov:skip=CKV_DOCKER_8: docker-git entrypoint must start as root to prepare SSH/auth/bootstrap and run sshd"
9495
)

0 commit comments

Comments
 (0)