-
-
Notifications
You must be signed in to change notification settings - Fork 421
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
ffi: Cache cbindgen intermediates from build to build #13
Conversation
Jack, were you seeing issues without this setting? |
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.
I found this necessary when running cbindgen
from the command line - on the first build it would succeed, and then if run again without making any change to the source, you get an error like this
RROR: Parsing crate `libsignal-ffi`: couldn't run `cargo rustc --pretty=expanded`: Compile(" Fresh unicode-xid v0.2.1\n Fresh cfg-if v0.1.10\n...
I assume this is some bug in cbindgen. However with the header generation integrated into build.rs this may not matter anymore. It was obnoxious at the time because I was doing fast iteration and sometimes would do things like
$ cbindgen
#oops forgot to redirect to a file
$ cbindgen > signal_ffi.h # fails
# make spurious edit to lib.rs
$ cbindgen > signal_ffi.h # works
Given that the integration into build.rs is slowing down the build, I might undo that…but regardless, I haven't seen the same error. Maybe it's a nightly vs. stable issue, or something fixed by a newer nightly rustc or cbindgen? What's the whole error message? |
This is rustc 1.47.0 and cbindgen 0.14.4. Looks like cbindgen 0.15 is out I'll see if that fixes it. |
Nope |
It's your nightly compiler version that matters, since otherwise it'll reject the --pretty=expanded option altogether. |
rustc 1.49.0-nightly (8dae8cdcc 2020-10-12) I was already seeing this in August though so it's not a recent regression. |
I wonder what's different about your configuration vs. mine. Oh well, I'll put it back if we switch away from build.rs, then. |
No description provided.