Fastly compute rust edition2024 fix

From divinevideo/divine-mobile · View interactive version

Fastly compute rust edition2024 fix is an AI agent skill from the GitHub repository divinevideo/divine-mobile. Fix Fastly Compute Rust build failures caused by edition2024 dependencies. Use when: (1) cargo build fails with "feature `edition2024` is required", (2) wit-bindgen or wasip2 crates fail to download/parse, (3) Fastly SDK pulls in incompatible transitive dependencies, (4) Build worked before but fail

How to use this skill

Skill file

Fastly Compute Rust Edition2024 Dependency Fix

Problem

Fastly Compute Rust projects fail to build with errors about edition2024 being required,

even when using stable Rust. The error appears when transitive dependencies (especially

wit-bindgen 0.51+ and wasip2 1.0.2+) require Rust 1.87+ which isn't stable yet.

Context / Trigger Conditions

Solution

Pin the problematic transitive dependencies in your Cargo.toml:

[dependencies]
# Fastly Compute SDK - pin to specific version
fastly = "=0.11.12"

# Pin these to avoid edition2024 requirement
wit-bindgen = "=0.46.0"
wasip2 = "=1.0.1"

# Also pin these if you use k256 or crypto
k256 = { version = "=0.13.3", features = ["schnorr"] }
base64ct = "=1.6.0"

Also update rust-toolchain.toml to include both WASM targets:

[toolchain]
channel = "1.83.0"
targets = ["wasm32-wasi", "wasm32-wasip1"]

Then:

rm Cargo.lock
rustup target add wasm32-wasip1
cargo build --target wasm32-wasi

Verification

Build should complete without edition2024 errors:

cargo build --target wasm32-wasi 2>&1 | grep -i "edition2024"
# Should return nothing (no matches)

Example

Before fix (Cargo.toml):

[dependencies]
fastly = "0.11"  # Allows 0.11.x which pulls wit-bindgen 0.51+

After fix (Cargo.toml):

[dependencies]
fastly = "=0.11.12"
wit-bindgen = "=0.46.0"
wasip2 = "=1.0.1"

Notes

References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.