Skip to content

Install wasm32v1-none target at container runtime#2553

Merged
leighmcculloch merged 10 commits into
mainfrom
fix-docker-wasm32v1-none-toolchain
May 6, 2026
Merged

Install wasm32v1-none target at container runtime#2553
leighmcculloch merged 10 commits into
mainfrom
fix-docker-wasm32v1-none-toolchain

Conversation

@leighmcculloch
Copy link
Copy Markdown
Member

What

Add rustup target add wasm32v1-none to entrypoint.sh so the target is installed against whichever Rust toolchain is active inside the running container, after cd /source honors any rust-toolchain.toml in the mounted project.

Why

The Docker image runs rustup target add wasm32v1-none at image-build time, which only installs the target for the toolchain that was the default in rust:latest when the image was built. When a contract pins a different Rust toolchain (via rust-toolchain.toml, rustup override, or RUST_TOOLCHAIN), rustup auto-installs that toolchain inside the container without the wasm32v1-none target, causing builds to fail with:

error[E0463]: can't find crate for `core`
  = note: the `wasm32v1-none` target may not be installed

Installing the target at runtime, after cd /source, ensures rustup resolves the toolchain the project actually requires and adds the target to it. rustup target add is a no-op when the target is already present, so the default-toolchain case is unaffected.

This is also a blocker for #2506 (--docker option for reproducible builds).

Close #2545

Known limitations

N/A

@github-project-automation github-project-automation Bot moved this to Backlog (Not Ready) in DevX May 5, 2026
@leighmcculloch leighmcculloch marked this pull request as ready for review May 5, 2026 19:46
Copilot AI review requested due to automatic review settings May 5, 2026 19:46
@leighmcculloch leighmcculloch enabled auto-merge (squash) May 5, 2026 19:48
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4ad2eef006

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread entrypoint.sh Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Docker image entrypoint so wasm32v1-none is installed at container runtime, aiming to ensure the target is added for whichever Rust toolchain is active inside the mounted project (e.g., when rust-toolchain.toml pins a non-default toolchain).

Changes:

  • Add a new entrypoint.sh that runs rustup target add wasm32v1-none before executing the CLI command.
  • Update Dockerfile to copy the new entrypoint script and set it as the container ENTRYPOINT (wrapping stellar).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
entrypoint.sh New runtime entrypoint that installs the wasm target then execs the requested command.
Dockerfile Switches container entrypoint to the new script and adjusts binary permissions/copy steps.

Comment thread Dockerfile
Comment thread entrypoint.sh
Comment thread entrypoint.sh Outdated
@leighmcculloch leighmcculloch merged commit 5ccca23 into main May 6, 2026
211 checks passed
@leighmcculloch leighmcculloch deleted the fix-docker-wasm32v1-none-toolchain branch May 6, 2026 02:07
@github-project-automation github-project-automation Bot moved this from Backlog (Not Ready) to Done in DevX May 6, 2026
Comment thread entrypoint.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Docker image fails to build contracts when a non-default Rust toolchain is active (wasm32v1-none missing)

3 participants