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.
pchickey
left a comment
There was a problem hiding this comment.
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.