Skip to content
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

Add user channels to the default nix path #38351

Merged
merged 1 commit into from May 1, 2018

Conversation

grahamc
Copy link
Member

@grahamc grahamc commented Apr 2, 2018

Motivation for this change

See NixOS/nix#2033

I'll backport upon merge.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

$ nix-channel --add https://nixos.org/channels/nixpkgs-unstable nixpkgsunstable

$ nix-channel --update
unpacking channels...
created 5 symlinks in user environment

$ nix-build '<nixpkgsunstable>' -A gitFull            
/nix/store/9i8vdd4757xnvyflf0fhszjw74cy74ib-git-2.16.2

$ nix run -f '<nixpkgsunstable>' gitFull  

[grahamc@Morbo:~]$ which git
/nix/store/9i8vdd4757xnvyflf0fhszjw74cy74ib-git-2.16.2/bin/git

[grahamc@Morbo:~]$ exit

$ nix-instantiate -E '(import <nixpkgsunstable> {}).gitFull'
warning: you did not specify '--add-root'; the result might be removed by the garbage collector
/nix/store/2iz7n7x4rldrn4dg9s5bg6a3qlxna7ms-git-2.16.2.drv

@grahamc
Copy link
Member Author

grahamc commented Apr 2, 2018

@GrahamcOfBorg test openssh
@GrahamcOfBorg test login
@GrahamcOfBorg test env

@GrahamcOfBorg
Copy link

Failure on x86_64-linux (full log)

Attempted: tests.openssh

Partial log (click to expand)

cannot build derivation ‘/nix/store/3970kh8h84fcwjmcw0kvw69xj5dx6wfz-run-nixos-vm.drv’: 1 dependencies couldn't be built
cannot build derivation ‘/nix/store/v03dl9939xcg6sqfin8fb4kb2bsvsyk7-nixos-vm.drv’: 1 dependencies couldn't be built
building path(s) ‘/nix/store/18466xh1i341grvlisxif2959al1cw5i-closure-info’
/nix/store/aj9rz4k3xvg8q9fzqfnb0q123707zp0n-builder: line 1: .attrs.sh: No such file or directory
builder for ‘/nix/store/xcyxdcsjb6f54bypiv2i8231bms1c9d0-closure-info.drv’ failed with exit code 1
cannot build derivation ‘/nix/store/mvzidnd909ksxyr5z9jwa85m1ppmacpf-run-nixos-vm.drv’: 1 dependencies couldn't be built
cannot build derivation ‘/nix/store/qaaaivv8z1y7cn6cfrsi84p89dv900rm-nixos-vm.drv’: 1 dependencies couldn't be built
cannot build derivation ‘/nix/store/zsdf1xs9933pjj6pwy2bkx0md518dyzp-nixos-test-driver-openssh.drv’: 3 dependencies couldn't be built
cannot build derivation ‘/nix/store/c5shh79ayzw035ycimm658c50nsciwcm-vm-test-run-openssh.drv’: 1 dependencies couldn't be built
error: build of ‘/nix/store/c5shh79ayzw035ycimm658c50nsciwcm-vm-test-run-openssh.drv’ failed

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: tests.login

Partial log (click to expand)

machine# [   24.283377] reboot: Restarting system
machine# [   24.283727] reboot: machine restart
vde_switch: EOF data port: Interrupted system call
collecting coverage data
syncing
6 out of 6 tests succeeded
test script finished in 26.36s
vde_switch: EOF on stdin, cleaning up and exiting
cleaning up
/nix/store/vnpn36ygig7xw3liw5b8xpamgn4jpij5-vm-test-run-login

@GrahamcOfBorg
Copy link

Failure on x86_64-linux (full log)

Attempted: tests.env

Partial log (click to expand)

building path(s) ‘/nix/store/924y1y6zavi47a5zgnp7c9hwrvj30c7g-etc’
building path(s) ‘/nix/store/h6nvqbzmx4rv5jwrjq10j6c8r071k3cg-nixos-system-machine-18.09.git.8bc041f’
building path(s) ‘/nix/store/ydxvkq2pwz8xqvnpm1l64g02vhy8yx7c-closure-info’
/nix/store/aj9rz4k3xvg8q9fzqfnb0q123707zp0n-builder: line 1: .attrs.sh: No such file or directory
builder for ‘/nix/store/8m7ldmmcp37xizsqzpf78basgwm109s4-closure-info.drv’ failed with exit code 1
cannot build derivation ‘/nix/store/gzv0rs1ygn1nbhnbvc5x0il0k6h150pq-run-nixos-vm.drv’: 1 dependencies couldn't be built
cannot build derivation ‘/nix/store/jsm2y9p2xv68jvcsyxg5mq279lpkq0w1-nixos-vm.drv’: 1 dependencies couldn't be built
cannot build derivation ‘/nix/store/hcgw2xv73a4rmdkyxir1gzd2waw5mdcc-nixos-test-driver-environment.drv’: 1 dependencies couldn't be built
cannot build derivation ‘/nix/store/532v3wbg7q7agn1p58cyjrnbapwapanx-vm-test-run-environment.drv’: 1 dependencies couldn't be built
error: build of ‘/nix/store/532v3wbg7q7agn1p58cyjrnbapwapanx-vm-test-run-environment.drv’ failed

@grahamc
Copy link
Member Author

grahamc commented Apr 2, 2018

The two tests which failed seem due to the hosts not running 2.0. I'll look in to that. In the meantime, this patch works for me and the tests pass locally.

@vcunat
Copy link
Member

vcunat commented Apr 2, 2018

I would probably switch the new line with the first line, because I think (1) per-user NIX_PATH elements should be given preference in comparison to (system-wide) root's elements, and (2) the root's elements should be "together".

@grahamc
Copy link
Member Author

grahamc commented Apr 2, 2018

Agreed, updated.

@GrahamcOfBorg
Copy link

Failure on aarch64-linux (full log)

Attempted: tests.login

Partial log (click to expand)

building '/nix/store/5f6sg61k08mky7xfks58xxh7ny9haizx-user-units.drv'...
building '/nix/store/5ccyn39apv4hk38jw9grlwigzk5i0rwk-etc.drv'...
cannot build derivation '/nix/store/xlisrcfmvhlk44vwg37wszrn9z9kaby3-initrd.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/kahjcshbwr9m8w001l2vib64mjrmcn0y-nixos-system-machine-18.09.git.3ac6fb5.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/m6wkd7d9ikfwzjq99f587vdvln8fljgr-closure-info.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/mf036yplrxjhc20jss455wwrrbw5b2q8-run-nixos-vm.drv': 2 dependencies couldn't be built
cannot build derivation '/nix/store/ap4079ypmx01hiq4dn89wz4wrxgbna7j-nixos-vm.drv': 2 dependencies couldn't be built
cannot build derivation '/nix/store/q8xd52l1lbdb8955s159jjiajzdp51pj-nixos-test-driver-login.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/f7kj3ygsflqxc4q4h2mhxm36svzq4hcz-vm-test-run-login.drv': 1 dependencies couldn't be built
�[31;1merror:�[0m build of '/nix/store/f7kj3ygsflqxc4q4h2mhxm36svzq4hcz-vm-test-run-login.drv' failed

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: tests.env

Partial log (click to expand)

machine# [   16.950450] systemd[1]: Reached target Network.
machine# [   16.963572] systemd[1]: Starting DHCP Client...
machine# [   16.973408] systemd[1]: Starting Permit User Sessions...
machine: exit status 0
test script finished in 17.91s
cleaning up
killing machine (pid 627)
vde_switch: EOF on stdin, cleaning up and exiting
vde_switch: Could not remove ctl dir '/build/vde1.ctl': Directory not empty
/nix/store/bclyfl8m4ib9wqsg29rzwkrhldff8lvb-vm-test-run-environment

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: tests.openssh

Partial log (click to expand)

server: exit status 0
2 out of 2 tests succeeded
test script finished in 33.84s
cleaning up
killing client (pid 627)
killing server_lazy (pid 639)
killing server (pid 651)
vde_switch: EOF on stdin, cleaning up and exiting
vde_switch: Could not remove ctl dir '/build/vde1.ctl': Directory not empty
/nix/store/l6k79aisr26a5m0img5mcw4ys9qy78pc-vm-test-run-openssh

Copy link
Member

@vcunat vcunat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I think so, including cherry-pick to 18.03.

Copy link
Member

@shlevy shlevy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚢

@vcunat
Copy link
Member

vcunat commented Apr 3, 2018

I'm slightly scared of being very hasty with such changes.

@edolstra: can you confirm this wasn't some intentional design decision? Apparently nix-env has ~/.nix-defexpr used for this purpose, but $NIX_PATH feels a much better way (more uniform), so going this way seems good. I hope we're not missing something.

@edolstra
Copy link
Member

edolstra commented Apr 4, 2018

Well, this change doesn't make nix-env use NIX_PATH, so nothing really changes wrt nix-env.

@grahamc
Copy link
Member Author

grahamc commented Apr 4, 2018

Update: Choosing not to backport this for now.

Copy link
Member

@lheckemann lheckemann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like it. I agree it shouldn't be backported though — and this means it should go in the 18.09 release notes, not the 18.03 ones, right?

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

Successfully merging this pull request may close these issues.

None yet

8 participants