WIP: Initial work to add modifiers to Cargo.toml and env variable options#117
WIP: Initial work to add modifiers to Cargo.toml and env variable options#117deg4uss3r wants to merge 4 commits intogdesmott:mainfrom
Conversation
gdesmott
left a comment
There was a problem hiding this comment.
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.
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.
| //! - `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.
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.
| 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