-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Disabling of -Zunstable-options --pretty=expanded breaks cbindgen #43697
Comments
The approach for you would be to ask for a stable flag for this of some sort. We’ve already stabilised a few on request, e.g. --emit=mir. |
See also #43364. |
We really should not stabilise I think an ideal solution is that cbindgen should not be looking at expanded code, but at the AST post-expansion (or the TokenStream, though that is not easy right now) - I assume cbindgen has to do some parsing of its own? However, that is also unstable (and actually likely to change, c.f., the output of --pretty expanded), so not very practical. Another solution might be using a shim compiler driver - this is what the RLS will do - see https://github.com/nrc/rls-rustc. That would mean that building cbindgen would need a nightly compiler, but running it (i.e., compiling webrender or whatever) would work with a stable toolchain (unless the output of --pretty expanded changes between versions). How does the shim solution sound? |
@jrmuizel do either of the above solutions sound reasonable to you? |
I think we should be able to work something out. |
Triage: this is a very old issue. was something worked out? Can we close it? |
cbindgen needs to parse macro expanded rust code in order to generate C/C++ bindings. The removal of --pretty=expanded breaks this. What's the suggested path forward here? Not having this forces binding generation to be done with a nightly tool chain and the results checked in to the tree instead of being done at build time.
The text was updated successfully, but these errors were encountered: