CosmWasm / optimizer

Dockerfile and script to deterministically produce the smallest possible Wasm for your Rust contract
Apache License 2.0
118 stars 57 forks source link

Set RUSTUP_TOOLCHAIN to the default version of the docker image #133

Open webmaster128 opened 11 months ago

webmaster128 commented 11 months ago

When a project uses the file rust-toolchain.toml or rust-toolchain (https://rust-lang.github.io/rustup/overrides.html#the-toolchain-file), it is possible for the project to override the optimizer's Rust version. What will happen is that a different Rust version is downloaded and used during the build. However, the toolchain will be incomplete with missing target wasm32-unknown-unknown.

Now looking at the order of toolchains used we see that setting e.g. export RUSTUP_TOOLCHAIN=1.72.0 overrides a project-specific setting. This ensure always the version of the optimizer is used, which is what we want.