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
Having problems expanding macros with build.rs #758
Comments
Which version of cbindgen are you running as a dependency? I think #747 should've fixed this. |
Seems that this error is different:
and in the cargo file
Also
|
If you can put together a test-case I can look into it. |
Test case as in a little repo to reproduce the error? I've put the minimal failing example in this repo https://github.com/iquerejeta/cbindgen-test Thanks for looking into it! |
I'm running into the same thing recently. While I have not had an error yet, it does take a long time when using EDIT: Forgot to update that it works fine with cbindgen cli but just stalls when using it as a build dependency. Havent had time to dive into it to debug it (since i have a workaround by just calling cbindgen directly but is an annoying process) but curious as to why its an issue now unless its something that was introduced into 0.23. |
Anyone have updates on this? I'm running into the same issue on |
Its still an issue the last I checked. I think the solution is to either build with nightly (believe i have tested this but cannot confirm right now) or just run cbindgen directly or in your build.rs |
I've resorted to running cbindgen in the build.rs as so:
but even so, the build times are very long (almost 10 minutes) because of this invocation of cbindgen. |
I encountered a problem with the expansion of macros using build.rs. Here is a minimal example to point out the problems I'm having. I have the following
lib.rs
.with the following
cbindgen.toml
If I run
rustup run nightly cbindgen ./ --config cbindgen.toml --crate testing --output bindings.h
, the macros are expanded, and I get the expected filebindings.h
.However, if I try to expand macros and build the binding using a
build.rs
file, the compilation takes a lot and returns an error at the end of it. The build files I've tried are the following:and
When running
RUST_BACKTRACE=1 cargo build
I get a ton of lines like this (not copying all because would be huge):and the final lines of the error are
Is this a known issue? Or am I maybe doing something wrong?
Thank you!
The text was updated successfully, but these errors were encountered: