Skip to content

Update Rust toolchain to 1.93.1 and add wasm32-linera-chain target#5646

Draft
deuszx wants to merge 13 commits intotestnet_conwayfrom
rust-1.93-toolchain
Draft

Update Rust toolchain to 1.93.1 and add wasm32-linera-chain target#5646
deuszx wants to merge 13 commits intotestnet_conwayfrom
rust-1.93-toolchain

Conversation

@deuszx
Copy link
Copy Markdown
Contributor

@deuszx deuszx commented Mar 9, 2026

Motivation

Right now we're stuck on a quite old 1.88 toolchain. This is increasing becoming a problem when certain dependencies have version conflicts that are hard to resolve or only possible to resolve on newer toolchains.

Proposal

  • Bump stable toolchain to 1.93.1 and nightly to nightly-2026-03-01.
  • Introduce a custom wasm32-linera-chain target that disables bulk-memory and nontrapping-fptoint opcodes (0xFC prefix) for on-chain Wasm applications.
  • Update wasmer/wasm-instrument to git forks with probestack and bulk-memory support
  • Add the target spec and cargo config to the project template so that linera project new produces projects ready to build for the chain target.
  • Update application templates so that new projects use proper targets and toolchains

Test Plan

CI

Release Plan

Links

@ma2bd
Copy link
Copy Markdown
Contributor

ma2bd commented Mar 9, 2026

We really should work on main for this kind of changes

@deuszx deuszx force-pushed the rust-1.93-toolchain branch 4 times, most recently from 44c1fe0 to 2b701d6 Compare March 10, 2026 11:01
@deuszx deuszx mentioned this pull request Mar 10, 2026
deuszx and others added 12 commits March 10, 2026 13:40
Bump stable toolchain to 1.93.1 and nightly to nightly-2026-03-01.
Introduce a custom wasm32-linera-chain target that disables
bulk-memory and nontrapping-fptoint opcodes (0xFC prefix) for
on-chain Wasm applications. Update wasmer/wasm-instrument to git
forks with probestack and bulk-memory support, unpin ruzstd, and
remove bridge-e2e MSRV workarounds that are no longer needed.
Add the target spec and cargo config to the project template so
that `linera project new` produces projects ready to build for
the chain target.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The 4 changes:
1. linera-witty-macros/src/wit_interface.rs:205 — **return_type = actual_output (avoid needless Box allocation)
2. linera-witty/src/runtime/wasmer/mod.rs:126 — StoreMut<'_> (explicit elided lifetime)
3. linera-witty/src/runtime/wasmtime/mod.rs:44 — StoreContext<'_, UserData>
4. linera-witty/src/runtime/wasmtime/mod.rs:50 — StoreContextMut<'_, UserData>
@deuszx deuszx force-pushed the rust-1.93-toolchain branch from 3a49676 to a34257b Compare March 10, 2026 12:41
@deuszx deuszx requested a review from Twey March 10, 2026 12:50
Comment on lines +69 to +71
- name: Install nightly toolchain for wasm builds
run: |
rustup toolchain install $(sed -n 's/^channel = "\(.*\)"/\1/p' toolchains/nightly/rust-toolchain.toml) --component rust-src
Copy link
Copy Markdown
Contributor

@Twey Twey Mar 10, 2026

Choose a reason for hiding this comment

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

I don't love parsing TOML with sed 😅 We do this generally by linking the toolchain to rust-toolchain.toml.

I wonder if it's time to always use a nightly toolchain. We can still be compatible with stable Rust by forbidding #![feature] flags in the core code — @ma2bd for interest.

unset RUSTUP_TOOLCHAIN RUSTFLAGS
cd examples
cargo build --locked --release --target wasm32-unknown-unknown
cargo build --locked --release --target wasm32-linera-chain
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We can (and should) put this in .cargo/config.toml so we don't need to specify it here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

IIRC, the issue was that .cargo/config.toml was being ignored in the CI b/c of some ENV overwrites.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think its RUSTFLAGS specifically are a bit fiddly. But the target should be fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants