-
-
Notifications
You must be signed in to change notification settings - Fork 767
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
rust hook requires --path
attribute
#1112
Comments
heh that's annoying, yeah let's update to the latest install construct |
I think the change would look like? diff --git a/pre_commit/languages/rust.py b/pre_commit/languages/rust.py
index e09d007..c036739 100644
--- a/pre_commit/languages/rust.py
+++ b/pre_commit/languages/rust.py
@@ -84,7 +84,11 @@ def install_environment(prefix, version, additional_dependencies):
for package in packages_to_install:
cmd_output(
- 'cargo', 'install', '--bins', '--root', directory, *package,
+ 'cargo', 'install',
+ '--bins',
+ '--root', directory,
+ '--path', directory,
+ *package,
cwd=prefix.prefix_dir
) This install the bin in the |
Seems right to me, there's pretty good tests for this so hopefully the test suite should agree 👍 |
102: pre-commit r=zimbatm a=zimbatm Add pre-commit to the project so we keep the syntax nicely formatted. This is a bit of a warmup. Once pre-commit/pre-commit#1112 is fixed it will be possible to expose nixpkgs-fmt as a pre-commit hook as well! Co-authored-by: zimbatm <zimbatm@zimbatm.com>
102: pre-commit r=zimbatm a=zimbatm Add pre-commit to the project so we keep the syntax nicely formatted. This is a bit of a warmup. Once pre-commit/pre-commit#1112 is fixed it will be possible to expose nixpkgs-fmt as a pre-commit hook as well! Co-authored-by: zimbatm <zimbatm@zimbatm.com>
The puzzling thing to me is why I can't reproduce this with our testsuite, we have a tiny little rust package that should also trigger this but doesn't seem to 🤔 -- I did figure out a fix though I'll add it to your PR 👍 |
Cargo has changed how packages get installed and requires an extra
--path <destination>
attribute.Symptom:
I guess the fix should be done where here:
pre-commit/pre_commit/languages/rust.py
Line 87 in 9c6a1d8
Do we want to make pre-commit compatible with multiple versions of cargo or just the latest one?
/cc @asottile @chriskuehl
The text was updated successfully, but these errors were encountered: