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

Annotations #372

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Conversation

yoshuawuyts
Copy link
Member

Depends on #371. Adds support for component-native annotations. I wasn't quite sure what to put in the "language field" for the top-level component, but I figured "Rust" would be a good fit. Thanks!

Before

$ wasm-tools metadata show component.wasm

╭──────────────┬─────────────────────────╮
│ KIND         ┆ VALUE                   │
╞══════════════╪═════════════════════════╡
│ kind         ┆ component               │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
│ name         ┆ <unknown>               │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
│ range        ┆ 0x0..0x2c9f9b           │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
│ processed-by ┆ wit-component [0.216.0] │
╰──────────────┴─────────────────────────╯

After

$ wasm-tools metadata show component.wasm
╭──────────────┬───────────────────────────────────────────────────╮
│ KIND         ┆ VALUE                                             │
╞══════════════╪═══════════════════════════════════════════════════╡
│ kind         ┆ component                                         │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
│ name         ┆ rust-wasi-hello                                   │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
│ range        ┆ 0x0..0x5d35f1                                     │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
│ author       ┆ Yosh Wuyts <[email protected]>                    │                                                
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
│ version      ┆ 0.0.0                                             │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
│ processed-by ┆ wit-component [0.225.0]                           │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
│ processed-by ┆ cargo-component [0.20.0-dev (7057351 2025-02-17)] │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
│ language     ┆ Rust                                              │
╰──────────────┴───────────────────────────────────────────────────╯

@yoshuawuyts
Copy link
Member Author

Oh shoot, as mentioned in bytecodealliance/wasm-pkg-tools#150 (comment) we should not create authors in the producers until bytecodealliance/wasm-tools#2054 has landed. Making a note here so I don't forget.

@yoshuawuyts
Copy link
Member Author

fixed the author bits of the PR. Once #371 has been merged this should be good to go now!

@yoshuawuyts yoshuawuyts marked this pull request as ready for review February 21, 2025 00:47
@yoshuawuyts
Copy link
Member Author

#371 has been merged; this is now ready for review

@yoshuawuyts
Copy link
Member Author

Tests seem to be failing because Rust 1.58 has shipped, warning that unsafe fn (unsafe to call) no longer implies unsafe {} (may call unsafe) in the generated wit-bindgen bindings.

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.

1 participant