Skip to content

A lightweight WebAssembly runtime that is fast, secure, and standards-compliant

Don't break cwasm ABIs in patch releases by default (#11687)

Alex Crichton8218e903a28c
diff --git a/crates/wasmtime/src/engine/serialization.rs b/crates/wasmtime/src/engine/serialization.rs
index 314d326f46..c38d26671b 100644
--- a/crates/wasmtime/src/engine/serialization.rs
+++ b/crates/wasmtime/src/engine/serialization.rs
@@ -97,7 +97,7 @@ pub fn check_compatible(engine: &Engine, mmap: &[u8], expected: ObjectKind) -> R
match &engine.config().module_version {
ModuleVersionStrategy::WasmtimeVersion => {
let version = core::str::from_utf8(version)?;
- if version != env!("CARGO_PKG_VERSION") {
+ if version != env!("CARGO_PKG_VERSION_MAJOR") {
bail!(
"Module was compiled with incompatible Wasmtime version '{}'",
version
@@ -128,7 +128,7 @@ pub fn append_compiler_info(engine: &Engine, obj: &mut Object<'_>, metadata: &Me
let mut data = Vec::new();
data.push(VERSION);
let version = match &engine.config().module_version {
- ModuleVersionStrategy::WasmtimeVersion => env!("CARGO_PKG_VERSION"),
+ ModuleVersionStrategy::WasmtimeVersion => env!("CARGO_PKG_VERSION_MAJOR"),
ModuleVersionStrategy::Custom(c) => c,
ModuleVersionStrategy::None => "",
};
diff --git a/docs/contributing-release-process.md b/docs/contributing-release-process.md
index 2d790fccbb..4ca51d117f 100644
--- a/docs/contributing-release-process.md
+++ b/docs/contributing-release-process.md
@@ -85,6 +85,17 @@ of criteria. It's done on an as-needed basis. Two requirements, however are:
Wasmtime will not release a patch release until all versions have been
equally patched to ensure that releases remain consistent.
+* Patch releases must not contain API-breaking changes in public crates. The
+ list of `PUBLIC_CRATES` in `scripts/publish.rs` is the list of crates to worry
+ about in terms of breaking changes.
+
+* Wasm-level ABI-breaking changes are by default not allowed in patch releases.
+ Users are expected to, for example, be able to load `*.cwasm` artifacts from
+ before the patch release is made. If an ABI-breaking change is necessary then
+ be sure to update `crates/wasmtime/src/engine/serialization.rs` and the
+ `WasmtimeVersion` matching strategy to modify the string to ensure older
+ artifacts cannot be loaded.
+
Making a patch release is somewhat more manual than a major version, but like
before there's automation to help guide the process as well and take care of
more mundane bits.