Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wasmtime toplevel module: re-export wasmparser. #9485

Merged
merged 1 commit into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions crates/wasmtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -278,3 +278,19 @@ call-hook = []
# Enables support for "memory protection keys" which can be used in conjunction
# with the pooling allocator on x64 to compact linear memory allocations.
memory-protection-keys = ["pooling-allocator"]

# Enables a re-export of wasmparser, so that an embedder of Wasmtime can use
# exactly the version of the parser library that Wasmtime does. Sometimes this
# is necessary, e.g. to guarantee that there will not be any mismatches in
# which modules are accepted due to Wasm feature configuration or support
# levels.
#
# Note that when this feature is enabled, the version of wasmparser that is
# re-exported is *not subject to semver*: we reserve the right to make patch
# releases of Wasmtime that bump the version of wasmparser used, and hence the
# version re-exported, in semver-incompatible ways. This is the tradeoff that
# the embedder needs to opt into: in order to stay exactly in sync with an
# internal detail of Wasmtime, the cost is visibility into potential internal
# version changes. This is why the re-export is guarded by a feature flag which
# is off by default.
Comment on lines +282 to +295
Copy link
Member

Choose a reason for hiding this comment

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

Thanks for writing this up!

reexport-wasmparser = []
18 changes: 18 additions & 0 deletions crates/wasmtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,24 @@ use sync_nostd as sync;
#[doc(no_inline)]
pub use anyhow::{Error, Result};

/// A re-exported instance of Wasmtime's `wasmparser` dependency.
///
/// This may be useful for embedders that also use `wasmparser`
/// directly: it allows embedders to ensure that they are using the same
/// version as Wasmtime, both to eliminate redundant dependencies on
/// multiple versions of the library, and to ensure compatibility in
/// validation and feature support.
///
/// Note that this re-export is *not subject to semver*: we reserve the
/// right to make patch releases of Wasmtime that bump the version of
/// wasmparser used, and hence the version re-exported, in
/// semver-incompatible ways. This is the tradeoff that the embedder
/// needs to opt into: in order to stay exactly in sync with an internal
/// detail of Wasmtime, the cost is visibility into potential internal
/// version changes.
#[cfg(feature = "reexport-wasmparser")]
pub use wasmparser;

fn _assert_send_and_sync<T: Send + Sync>() {}

fn _assertions_lib() {
Expand Down