Nixpkgs: buildRustPackage fails with recent nightly Cargo

Created on 17 May 2019  路  4Comments  路  Source: NixOS/nixpkgs

Issue description

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

Steps to reproduce

{ 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

Technical details

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`
stale rust

Most helpful comment

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.

All 4 comments

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:

  1. Search for maintainers and people that previously touched the related code and @ mention them in a comment.
  2. Ask on the NixOS Discourse.
  3. Ask on the #nixos channel on irc.freenode.net.
Was this page helpful?
0 / 5 - 0 ratings

Related issues

domenkozar picture domenkozar  路  3Comments

yawnt picture yawnt  路  3Comments

ob7 picture ob7  路  3Comments

copumpkin picture copumpkin  路  3Comments

tomberek picture tomberek  路  3Comments