Skip to content

Annotations #372

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

Merged
merged 6 commits into from
Mar 14, 2025
Merged

Annotations #372

merged 6 commits into from
Mar 14, 2025

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
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.

@yoshuawuyts
Copy link
Member Author

bytecodealliance/wit-bindgen#1183 should fix this I believe.

@pchickey
Copy link
Contributor

Just needs a rebase on main now

@yoshuawuyts
Copy link
Member Author

rebased; now just waiting on CI to pass

@yoshuawuyts
Copy link
Member Author

I don't have merge rights on this, but I think it's ready to be merged!

@pchickey pchickey merged commit 64fe2da into bytecodealliance:main Mar 14, 2025
6 checks passed
@yoshuawuyts yoshuawuyts deleted the annotations branch April 30, 2025 12:17
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.

2 participants