-
-
Notifications
You must be signed in to change notification settings - Fork 15.4k
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-cache: init at 0.3.4 #77310
cargo-cache: init at 0.3.4 #77310
Conversation
Co-authored-by: Evan Stoll <evanjsx@gmail.com>
1094290
to
e74db03
Compare
@GrahamcOfBorg build cargo-cache |
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.
Unfortunately, tests are failing:
running 1 test
test run_tests ... FAILED
failures:
---- run_tests stdout ----
REGEX:
CARGO_HOME .*./xyxyxxxyyyxxyxyxqwertywasd. is not an existing directory!\n
OUTPUT:
CARGO_HOME "/build/source/./xyxyxxxyyyxxyxyxqwertywasd" is not an existing directory!
src = fetchFromGitHub { | ||
owner = "matthiaskrgr"; | ||
repo = pname; | ||
# TODO: use v${version} when a tag is available |
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 requested this at matthiaskrgr/cargo-cache#79 and maintainer immediately tagged the release. It should now be available as 0.3.4
, without the v
.
--skip CargoCachePaths \ | ||
--skip alternative_registry_works \ | ||
--skip cargo_new_and_run_local |
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.
After cursory look at these tests, my impression is that alternative_registry_works
requires internet access, and the other two could probably be made to work by setting HOME = "."
?
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.
Hi, yes, a couple of the cargo-cache tests require internet because I download crates/registry indices or initialize a new $CARGO_HOME
at test-runtime.
So, I guess you are running I did a quick experiment and these should be the tests that require internet connectivity:
Maybe I can add some kind of feature flag that only runs offline-tests and skips those. |
Yes, we are building in a sandboxed environment. Having a feature flag for that would be great! But just knowing the affected tests is very useful, thank you :) |
So, I added the |
@matthiaskrgr I will update this PR after the release. Thank you! |
I did not see this before creating matthiaskrgr/cargo-cache#84 The diff I testeddiff --git a/pkgs/development/tools/rust/cargo-cache/default.nix b/pkgs/development/tools/rust/cargo-cache/default.nix
index 8dee10fe2f3..5215f971cbe 100644
--- a/pkgs/development/tools/rust/cargo-cache/default.nix
+++ b/pkgs/development/tools/rust/cargo-cache/default.nix
@@ -7,26 +7,22 @@ rustPlatform.buildRustPackage rec {
src = fetchFromGitHub {
owner = "matthiaskrgr";
repo = pname;
- # TODO: use v${version} when a tag is available
- rev = "f3d113cc74644c4581c127e16b03e319677d669f";
- sha256 = "1bc9c1r964w0766k3yhf79d30ldv37vyiji8wnqspk5sl2gzn0iq";
+ rev = "v${version}";
+ sha256 = "0xhm7jlqq9nl1r8plx51x7aisza665f28d9h649b62904mx2ad7k";
};
- cargoSha256 = "1wzl8xvn3i5qgc4zmdqdh4kd8ww2ll2g14w4rf31i9lvq1ipa031";
+ cargoSha256 = "09vsalxh07bk1d48iyl0ncyzsscxlnf0dn96a2vbb1lin2qa2axm";
buildInputs = lib.optional stdenv.isDarwin libiconv;
checkPhase = ''
- cargo test -- \
- --skip CargoCachePaths \
- --skip alternative_registry_works \
- --skip cargo_new_and_run_local
+ cargo test --features offline_tests
'';
meta = with lib; {
- description = "Manage cargo cache";
+ description = "manage cargo cache (\${CARGO_HOME}, ~/.cargo/), print sizes of dirs and remove dirs selectively";
homepage = "https://github.com/matthiaskrgr/cargo-cache";
- license = with licenses; [ asl20 mit ];
+ license = with licenses; [ asl20 /* or */ mit ];
maintainers = with maintainers; [ filalex77 ];
};
} The still-failing tests
|
Huge derp. Nix Expression for
|
Thank you @evanjs for your help! I applied your diff in 382d612 and added you as co-author. Thanks again! |
diff --git a/pkgs/development/tools/rust/cargo-cache/default.nix b/pkgs/development/tools/rust/cargo-cache/default.nix
index 8c9bc4bffe5..f3756fe9468 100644
--- a/pkgs/development/tools/rust/cargo-cache/default.nix
+++ b/pkgs/development/tools/rust/cargo-cache/default.nix
@@ -2,16 +2,16 @@
rustPlatform.buildRustPackage rec {
pname = "cargo-cache";
- version = "0.4.3";
+ version = "0.5.1";
src = fetchFromGitHub {
owner = "matthiaskrgr";
repo = pname;
rev = version;
- sha256 = "0xhm7jlqq9nl1r8plx51x7aisza665f28d9h649b62904mx2ad7k";
+ sha256 = "02d593w1x8160p4m3jwm1dyvv383cy7njijlcaw49jczxv5isqbi";
};
- cargoSha256 = "0gqhyav3dk8rbkcnq9m66z8gv60ipvc556zri6m1hps5jrffsfik";
+ cargoSha256 = "0wpg0phfavd8fxl36nvanldiysy5xpk99qpnsc1jd6dw4ml01mbi";
buildInputs = lib.optional stdenv.isDarwin libiconv;
@jonringer @marsam think we could get this merged after it's bumped to |
382d612
to
afdb826
Compare
@GrahamcOfBorg eval |
Motivation for this change
https://users.rust-lang.org/t/cargo-cache-0-3-4-faster-cargo-home-caching-on-ci
The tag for 0.3.4 is missing.
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)This change is