-
Notifications
You must be signed in to change notification settings - Fork 23
WIP: Initial work to add modifiers to Cargo.toml and env variable options #117
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
base: main
Are you sure you want to change the base?
Conversation
gdesmott
left a comment
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.
Thanks for your contribution.
I have no objection adding such feature but would like a bit more context as I never used those kinds of modifiers.
Adding @xclaesse and @nirbheek in case they know more about modifiers and have some input.
Once we agree on the API we'll need it properly documented in the general documentation at the top of lib.rs.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #117 +/- ##
==========================================
+ Coverage 91.00% 91.62% +0.62%
==========================================
Files 3 3
Lines 2089 2270 +181
==========================================
+ Hits 1901 2080 +179
- Misses 188 190 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
gdesmott
left a comment
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.
Looks generally ok.
Can you please rebase your branch on top of main? Feel free to squash commits while doing so.
| //! - `SYSTEM_DEPS_$NAME_SEARCH_NATIVE` to override the [`cargo:rustc-link-search=native`](https://doc.rust-lang.org/cargo/reference/build-scripts.html#cargorustc-link-searchkindpath) flag; | ||
| //! - `SYSTEM_DEPS_$NAME_SEARCH_FRAMEWORK` to override the [`cargo:rustc-link-search=framework`](https://doc.rust-lang.org/cargo/reference/build-scripts.html#cargorustc-link-searchkindpath) flag; | ||
| //! - `SYSTEM_DEPS_$NAME_LIB` to override the [`cargo:rustc-link-lib`](https://doc.rust-lang.org/cargo/reference/build-scripts.html#rustc-link-lib) flag; | ||
| //! - `SYSTEM_DEPS_$NAME_MOD` to add a link modifier to the [`cargo:rustc-link-mod`](https://doc.rust-lang.org/cargo/reference/build-scripts.html#rustc-link-lib) flag; |
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.
| //! - `SYSTEM_DEPS_$NAME_MOD` to add a link modifier to the [`cargo:rustc-link-mod`](https://doc.rust-lang.org/cargo/reference/build-scripts.html#rustc-link-lib) flag; | |
| //! - `SYSTEM_DEPS_$NAME_MODIFIERS` to add a link modifier to the [`cargo:rustc-link-mod`](https://doc.rust-lang.org/cargo/reference/build-scripts.html#rustc-link-lib) flag; |
As that's the name used in https://doc.rust-lang.org/cargo/reference/build-scripts.html#rustc-link-lib.
And mod as its own meaning in Rust.
| /// frameworks the linker should link on | ||
| pub frameworks: Vec<String>, | ||
| /// frameworks the linker should link on and their modifiers | ||
| pub frameworks: Vec<(String, String)>, |
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 think having a struct instead of a tuple here would make things clearer.
| pub(crate) name: Option<String>, | ||
| pub(crate) fallback_names: Option<Vec<String>>, | ||
| pub(crate) optional: Option<bool>, | ||
| pub(crate) modifier: Option<String>, |
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.
| pub(crate) modifier: Option<String>, | |
| pub(crate) modifiers: Option<String>, |
No?
This PR adds the ability to use modifiers in
Cargo.tomland Environment variable overrides.resolves: #118