buildRustPackage with rustChannelOf { channel = "nightly"; date = "2019-05-07"; } succeeds while date = "2019-05-08" (and later) fails:
error: failed to acquire package cache lock
Caused by:
failed to open: /homeless-shelter/.cargo/.package-cache
{ mozilla ? import (builtins.fetchTarball https://github.com/mozilla/nixpkgs-mozilla/archive/50bae918794d3c283aeb335b209efd71e75e3954.tar.gz)
, pkgs ? import <nixpkgs> { overlays = [ mozilla ]; }
}:
let
nightlyRustPlatform =
let
nightly = pkgs.rustChannelOf {
date = "2019-05-08";
channel = "nightly";
};
in
pkgs.makeRustPlatform {
rustc = nightly.rust;
cargo = nightly.rust;
};
in
Please run nix-shell -p nix-info --run "nix-info -m" and paste the
results.
- system: `"x86_64-linux"`
- host os: `Linux 4.19.42, NixOS, 19.03.172604.7cd2e4ebe8c (Koi)`
- multi-user?: `yes`
- sandbox: `yes`
- version: `nix-env (Nix) 2.2.2`
- channels(root): `"nixos-19.03.172604.7cd2e4ebe8c,
nixos-unstable-19.09pre179307.bc94dcf5002"`
- channels(mw): `""`
- nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
Should have been fixed by https://github.com/rust-lang/cargo/pull/6940, but it seems to be only a partial fix, as /homeless-shelter/.cargo/.package-cache is still looked up.
I have temporarilly patched the issue by adding this inside buildRustPackage.
+ preConfigure = ''
+ export HOME=`mktemp -d`
+ '';
+
If it appears that cargo will always need a HOME, and that it cannot be forced to work without it, then this patch could go inside buildRustPackage definition.
Looks like a duplicate of #61192
Thank you for your contributions.
This has been automatically marked as stale because it has had no activity for 180 days.
If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.
Here are suggestions that might help resolve this more quickly:
Most helpful comment
I have temporarilly patched the issue by adding this inside buildRustPackage.
If it appears that cargo will always need a HOME, and that it cannot be forced to work without it, then this patch could go inside buildRustPackage definition.