-
Couldn't load subscription status.
- Fork 243
Refactor the wit-bindgen crate for being suitable again to include with the Rust standard library
#1369
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
Refactor the wit-bindgen crate for being suitable again to include with the Rust standard library
#1369
Conversation
This has long since become unnecessary, so delete it.
This was originally done a long time ago at this point to split out the "abi stable bits" from `wit-bindgen` for the purpose of `cargo component` where one version of the macro was used in the binary itself and a different version might be linked at runtime. Over time though this has proven effectively intractable and isn't really serving much purpose any more. This commit instead merges everything into the `wit-bindgen` crate. This should make it easier to integrate elsewhere and additionally integrate into Rust's standard library.
Generate a bare-bones `bitflags!` macro.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excited to see the separate -rt crate go away!
|
Noting this here as I just looked it up: bitflags used to support being built as a dependency of std, but it appears they recently removed that code. I think the minimal version here is fine for now, though in the future if this lands in upstream Rust, we may want to ask bitflags to re-introduce that code. |
|
Oh good find! I can't really blame them though as it's weird esoteric code for one user, and for this it'd be for just one user of one platform. Given that this only affects the Rust standard library's use of the |
presumably after bytecodealliance#1369, the following build feature combo fails to build: ```bash cargo build -p wit-bindgen --no-default-features --features async ```
presumably after #1369, the following build feature combo fails to build: ```bash cargo build -p wit-bindgen --no-default-features --features async ```
Over time with WASIp2 and WASIp3 the
wit-bindgencrate has become unsuitable for inclusion in libstd. The goal of this commit is to fix all of these issues in favor of an eventual update of Rust'swasm32-wasip2target to use thewasicrate directly. The high-level changes here are:wit-bindgen-runtime-crate andwit-bindgen-macro-crate is removed. This means old compat hacks are removed and additionallywit-bindgen-rtis merged back intowit-bindgen.bitflags-the-dep is added by adding a dummybitflags!definition which is used when the crate dependency is disabled. The bare-bones version gives just enough for bindings generation and basic usability.This is tested with libstd and it at least gets to the point of building libstd itself when the
wasicrate is regenerated with these changes.