Skip to content

Conversation

@xdoardo
Copy link
Contributor

@xdoardo xdoardo commented Apr 22, 2025

As per title. This PR introduces two (equally-shaped) types in wasmer_config (to refer to the annotation observed from a Wasmer manifest) and in wasmer_types::target (for the actual types to pass to engines) that represent annotations from users, which can be used to specify suggested compiler optimizations. For example:

# ....
[[module]]
name = "php"
source = "sapi/cli/php.wasm"
abi = "wasi"
annotations.suggested_compiler_optimizations = { pass_params = true }
# ...

This PR also adds the code necessary to serialize and deserialize this metadata in the manifest (and keep it in the related webc).

@xdoardo xdoardo requested a review from syrusakbary as a code owner April 22, 2025 14:27
@promptless
Copy link

promptless bot commented Apr 22, 2025

📝 Documentation updates detected! A separate PR for documentation updates has been made here: wasmerio/docs.wasmer.io#127

// Note: This type is a copy of `wasmer_config::package::SuggestedCompilerOptimizations`, so to
// avoid dependencies on `wasmer_config` for crates that already depend on `wasmer_types`.
#[derive(Clone, Debug, PartialEq, Eq, Default)]
pub struct SuggestedCompilerOptimizations {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
pub struct SuggestedCompilerOptimizations {
pub struct UserCompilerOptimizations {

@xdoardo xdoardo merged commit e823456 into llvm-pass-params Apr 23, 2025
83 of 84 checks passed
@xdoardo xdoardo deleted the feat/suggested-opts branch April 23, 2025 06:58
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