Forwarding cargo features into the wasm
- Dominant language
- Rust
- Stars
- 1.5k
- Forks
- 31
- PR merge metrics
- No merged PRs in 30d
Description
I have a macro I want to run through watt (in fact, I need to in order to break a self-dependency bootstrap cycle). However, I additionally want to have the macro emit slightly more or less depending on enabled features of my facade crate.
(Specifically, because I'm writing a proc macro that targets working with syn, I want to support disabling the bits covered by syn features. In the future, I can maybe emit [`#[cfg(accessible(::my_runtime::syn::path)]`](https://github.com/rust-lang/rust/issues/64797), but for now, this is covered by my runtime having equivalent feature flags.)
I have it... theoretically working, but the hack to call one of 24 different symbols is... not pretty at best.


It'd be really nice if watt would support passing through a second FFI-safe argument so we can inform the proc macro about some more state. The author would be responsible for making sure that cargo still understands all of the inputs to the proc macro for when it needs to be rerun.
Contributor guide
No contributing guide indexed for this repository
Research direction
No source files, tests, or entry points are named. Start by reviewing watt's proc-macro FFI boundary and how Cargo feature state reaches the facade crate. Done means feature state can be passed through safely and feature changes still cause the proc macro to rerun.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust, wasm
- Domain
- build-system, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100