mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-04-02 02:11:06 +00:00
Switch from version strings to schema versions
Should help reduce some churn a bit!
This commit is contained in:
parent
1db5b3fb50
commit
98030e0e4a
@ -163,7 +163,7 @@ fn extract_programs(module: &mut Module) -> Vec<shared::Program> {
|
|||||||
panic!("failed to decode what looked like wasm-bindgen data: {}", e)
|
panic!("failed to decode what looked like wasm-bindgen data: {}", e)
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
if p.version != version {
|
if p.schema_version != shared::SCHEMA_VERSION {
|
||||||
panic!("
|
panic!("
|
||||||
|
|
||||||
it looks like the Rust project used to create this wasm file was linked against
|
it looks like the Rust project used to create this wasm file was linked against
|
||||||
|
@ -351,6 +351,7 @@ impl Program {
|
|||||||
})
|
})
|
||||||
}),
|
}),
|
||||||
("version", &|a| a.str(&shared::version())),
|
("version", &|a| a.str(&shared::version())),
|
||||||
|
("schema_version", &|a| a.str(&shared::SCHEMA_VERSION)),
|
||||||
]);
|
]);
|
||||||
a.cnt
|
a.cnt
|
||||||
};
|
};
|
||||||
|
@ -5,6 +5,8 @@ extern crate fnv;
|
|||||||
use std::char;
|
use std::char;
|
||||||
use std::hash::{Hash, Hasher};
|
use std::hash::{Hash, Hasher};
|
||||||
|
|
||||||
|
pub const SCHEMA_VERSION: &str = "0";
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Deserialize)]
|
||||||
pub struct Program {
|
pub struct Program {
|
||||||
pub exports: Vec<Export>,
|
pub exports: Vec<Export>,
|
||||||
@ -12,6 +14,7 @@ pub struct Program {
|
|||||||
pub imports: Vec<Import>,
|
pub imports: Vec<Import>,
|
||||||
pub custom_type_names: Vec<CustomTypeName>,
|
pub custom_type_names: Vec<CustomTypeName>,
|
||||||
pub version: String,
|
pub version: String,
|
||||||
|
pub schema_version: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Deserialize)]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user