Install wasm32v1-none target at container runtime#2553
Conversation
There was a problem hiding this comment.
💡 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".
There was a problem hiding this comment.
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.shthat runsrustup target add wasm32v1-nonebefore executing the CLI command. - Update
Dockerfileto copy the new entrypoint script and set it as the containerENTRYPOINT(wrappingstellar).
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. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
What
Add
rustup target add wasm32v1-nonetoentrypoint.shso the target is installed against whichever Rust toolchain is active inside the running container, aftercd /sourcehonors anyrust-toolchain.tomlin the mounted project.Why
The Docker image runs
rustup target add wasm32v1-noneat image-build time, which only installs the target for the toolchain that was the default inrust:latestwhen the image was built. When a contract pins a different Rust toolchain (viarust-toolchain.toml,rustup override, orRUST_TOOLCHAIN), rustup auto-installs that toolchain inside the container without thewasm32v1-nonetarget, causing builds to fail with: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 addis a no-op when the target is already present, so the default-toolchain case is unaffected.This is also a blocker for #2506 (
--dockeroption for reproducible builds).Close #2545
Known limitations
N/A