Skip to content

nix-build --run-env with --add-root not working as expected #250

Closed

Description

@cillianderoiste

With Nix 1.3

~/Projects/MyEnv $ nix-build --run-env '<nixpkgs>' -A irssi

works fine but when I try it with add-root I get surprising results:

~/Projects/MyEnv $ nix-build --run-env '<nixpkgs>' -A irssi --add-root myroot error: creating a garbage collector root (/nix/store/27irakzga2m3wiv7977hafjr8kaa3plb-stdenv.drv) in the Nix store is forbidden (are you running nix-build inside the store?) /run/current-system/sw/bin/nix-build: failed to build all dependencies

with --indirect

~/Projects/MyEnv $  nix-build --run-env '<nixpkgs>' -A irssi --add-root  myroot --indirect  
error: path `/home/goibhniu/Projects/MyEnv/--indirect' is not a valid garbage collector root; it's not in the directory `/nix/var/nix/gcroots'
/run/current-system/sw/bin/nix-build: failed to build all dependencies

By accident I ran:

~/Projects/MyEnv $  nix-build --run-env '<nixpkgs>' -A irssi --indirect --add-root  ./myroot --indirect

which did something interesting:

~/Projects/MyEnv $ ls -l                                                 
total 4
lrwxrwxrwx 1 goibhniu users 50 Jan  8 23:12 --indirect -> /nix/store/b48470bj4b8d4x6z5rr62924n30cwsiq-stdenv
lrwxrwxrwx 1 goibhniu users 55 Jan  8 23:12 --indirect-2 -> /nix/store/ahg5mlj2mlp7yfl3x875pq95ar763vgj-ncurses-5.9
lrwxrwxrwx 1 goibhniu users 56 Jan  8 23:12 --indirect-3 -> /nix/store/043zrsanirjh8nbc5vqpjn93hhrf107f-bash-4.2-p24
lrwxrwxrwx 1 goibhniu users 58 Jan  8 23:12 --indirect-4 -> /nix/store/h0q955qx57zck3b73mg6f4x3951qhs5p-openssl-1.0.0i
lrwxrwxrwx 1 goibhniu users 55 Jan  8 23:12 --indirect-5 -> /nix/store/v4m3gahx1iz53v51rdinh0lcmipn1p4j-perl-5.14.2
lrwxrwxrwx 1 goibhniu users 64 Jan  8 23:12 --indirect-6 -> /nix/store/xy74fdawwpyfzag4m8sgm63x2k9lkagk-irssi-0.8.15.tar.bz2
lrwxrwxrwx 1 goibhniu users 59 Jan  8 23:12 --indirect-7 -> /nix/store/w6bwp1sq5w24n3vnmx0yifiqdq696fyf-pkg-config-0.23
lrwxrwxrwx 1 goibhniu users 55 Jan  8 23:12 --indirect-8 -> /nix/store/jsjfzx23rz1vz03wh3x23ryr54c08nb1-glib-2.34.0

Perhaps I'm just using it wrong?

Activity

  1. cillianderoiste commented on Jan 9, 2013

    @cillianderoiste
    MemberAuthor

    I realised afterwards that I should have added this ticket to the nix issue tracker, then I found this:
    NixOS/nix#68

    I'll try again with this syntax later, and then see if I can move the issue (or close it and add a new one there instead).

  2. cillianderoiste commented on Jan 9, 2013

    @cillianderoiste
    MemberAuthor

    moved to NixOS/nix#86

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions