-
Notifications
You must be signed in to change notification settings - Fork 332
Force nightly for cargo expand #415
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
Force nightly for cargo expand #415
Conversation
Build failing due to timeout
|
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.
You need to remove an .swp
file that snuck in. The build issue should be resolved now.
There's technically other ways to make this work (though obviously not recommended) like RUSTC_BOOTSTRAP=1
or such, so I'm a bit reluctant to do this.
Also this inadverently can make users of cbindgen depend on nightly features which is not great... :/
5814178
to
e9924f5
Compare
Whoops, sorry about the I agree it's not ideal but current users of cbindgen don't need nightly unless they use the "expand" functionality which is already required due to the use of the unstable compiler flags. Changing the expand logic to not need nightly was out of scope of what I was trying to do here. I was just fixing an issue that arose in my usage of cbindgen. This pull request doesn't actually change the requirements of the user, it just fixes the "expand" functionality so that it works on a code base using stable. Before this pull request users needed to use nightly to use "expand" and after this pull request they will still need nightly, except it just won't error out if the target crate is not a nightly crate. Worth noting that EDIT |
149c64b
to
e9924f5
Compare
Right, my point is that I'm not convinced that it should work on a codebase using stable :) |
My codebase is a perfect example of this. I rely heavily on macros to generate a lot of the FFI crap needed for my codebase's C api. I have no actual need for nightly, but these macros must be expanded in order to properly map out the interface to my code. Now, for the time being, I can move my codebase to nightly, but it would be much easier if this allowed you to override nightly, or call |
Having the same issue here. Part of the FFI is derived using macros (e.g. deriving FFI friendly structs from Rust native ones and implementing |
I also don't think this should be done, not without an option at least. |
Yeah, I think we should close this without change for now. |
Hi, is there any possibilities something like this gets implemented? Thanks! |
Problem
The "cargo expand" functionality requires a nightly compiler (see #38). However, if running
cbindgen
against a crate on a stable toolchain then cbindgen will fail with the following error:Solution
The solution is to force "cargo expand" to run using an installed nightly toolchain by adding an additional argument to the command line:
+nightly
. This allows one to run cbindgen's expand macros logic using an installed nightly toolchain while keeping the actual crate on a stable toolchain.