-
Notifications
You must be signed in to change notification settings - Fork 717
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
I think there might be a bug with the version matching #3052
Comments
This is because bindgen automatically targets the latest rust available as it has no way to detect the rust version of your project (yet). So you have to set the version using |
Ah check, that's inconvenient. |
If you're using a |
This hardly looks like a fix. When you're building a project that use a crate that uses bindgen (quite common in fact), your project does not have any control over the |
BTW, I'm curious what algorithm is used to select the target Rust version: when building inside docker.io/library/rust:1.77-buster, I would expect that |
See #3049 (comment) |
Using bindgen in a crate is an implementation detail. If the crate you're using asserts that they have a specific MSRV and they don't, that's a bug in the crate. If they don't have a MSRV, then they just don't.
Well, basically because there is no canonical way to know this, you can maybe grab it from the And that's for the users that actually use bindgen as a library, a lot of people just use the standalone CLI application. |
How many really use it standalone, as opposed to driven by the library? The library, when it's not using the CLI, could just use the rustc version it's being compiled with, via rustc_version, rustversion or similar crate. The library, when it is using the CLI, could pass the rustc version it's being compiled with to the CLI as an argument. And for the people that do use the CLI entirely in standalone mode, bindgen could default to the most recent version, and those people could also use the version flag to give a specific rust version if they so want. |
Erf, that CLI option already exists... |
How about changing RustTarget::default to return the version of the rust compiler in use when the __cli feature is not enabled? |
Originally posted by @Kriskras99 in #3015 (comment)
The text was updated successfully, but these errors were encountered: