-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
cargo: Run build.rs to get extra --cfg args #13779
base: master
Are you sure you want to change the base?
Conversation
Introduce a global Cargo interpreter state that keeps track of enabled features on each crate. Before generating AST of a Cargo subproject, it downloads every sub-subproject and resolves the set of features enabled on each of them recursively. When it later generates AST for one its dependencies, its set of features and dependencies is already determined.
The library name defaults to its package name, but it can be different. For example: - package name: cairo-sys-rs - library name: cairo-sys - dependency name: ffi
In the case the main project has a .wrap file for a cargo subproject, that subproject's Cargo.lock must be loaded before we can recursively fetch all its dependencies.
This returns --target value from rustc command line, or the native target.
f169b16
to
ed2e434
Compare
ed2e434
to
db26175
Compare
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.
As I've said before, we should not be doing this. At all. We cannot reliably run build.rs, the garden path of cases that actually (and really slowly) manage to successfully run also do not need to be a build.rs so using meson/meson.build will be a superior experience, etc.
The system-deps patch does look quite nice though :) and it's very good that we can do it without build.rs.
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.
Basically, what you actually want is rust-lang/cargo#7178 and to have people opt into that via run_command()
, which we already document as an escape hatch to do whatever you want as long as meson doesn't take responsibility for it.
Based on top of #12952.