GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — feat: allow rust hooks to specify crate features by Terseus · Pull Request #3235 · pre-commit/pre-commit ConversationNow the rust hooks can use the parameter The features must start with the string "--feature=" following the name of the feature; e.g. "--feature=full". Fixes #3230
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
asottile
reviewed
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please rebase out the unrelated formatting changes -- those are not welcome
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Comment on lines
+144
to
+141
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we can probably just filter out anything that starts with
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. Now the rust hooks can use the parameter `additional_dependencies` to receive build-time features for the crate. The features must start with the string "--feature=" following the name of the feature; e.g. "--feature=full". Fixes pre-commit#3230
Terseus
force-pushed
the
feature/3230-pass-features-to-cargo
branch
from
19f46ae to
bd153a6
Compare
asottile
reviewed
Comment on lines
+77
to
+78
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think this should be here at all?
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You're right, the features never reach this function.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think you should need a
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What I've implemented uses a custom syntax, so e.g. Is that what you're suggesting? In that case, every value in
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. We've replaced the previous "--feature=" format with a single parameter "--" which marks the start of the "cargo install" arguments, so now we can use "-- --features foo", "-- --locked", etc. Fixes pre-commit#3162
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Member
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
|
There was an error while loading. Please reload this page.
Features, they have the syntax "--features feat1 feat2 feat3". |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
afaict that's not valid: it'd have to be |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@asottile The current implementation can accept any |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
What about |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I tried Why
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
pre-commit/pre_commit/languages/rust.py Lines 124 to 129 in 0f8f383
This is exactly what the feature selection for |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
in 2024 yeah I'm all for killing the |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
personally I'd rather be more constrained such that if we need to do something later we have the opportunity to do so rather than being stuck with "allow arbitrary arguments" decision today. not to mention completely arbitrary arguments likely allows one to break out of the intended isolation |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
The reason behind this originally was to allow you to override specific library versions used to build the hook binary if needed, similar to how you can use |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I opened #3278. Thanks for the historic rationale. The cargo docs don't really preserve historic info like that, so I was completely unaware. I've only been using rust for about a year, but you could probably tell that already 😜 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
Allow to pass features to cargo install in rust hooks
There was an error while loading. Please reload this page.