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

tests: more robust check for user namespaces availability (canUseSand… #2211

Merged
merged 3 commits into from Jun 11, 2018

Conversation

unsatcore
Copy link
Contributor

…box)

Fixes #2165

unshare-utility way as suggested by @veprbl

Two things to pay attention to

  • Works for me but requires testing on Debian/Ubuntu with user namespaces turned on/off
  • Introduced dependency could be an overkill

@@ -94,11 +94,9 @@ canUseSandbox() {
return 1
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you can get rid of this test up here as well.

@@ -57,7 +57,7 @@ rec {
git
mercurial
]
++ lib.optional stdenv.isLinux libseccomp
++ lib.optional stdenv.isLinux [libseccomp pkgs.utillinux]
Copy link
Contributor

Choose a reason for hiding this comment

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

Drop the pkgs. given that other places don't use it either (and there's a with pkgs; up top).

@dtzWill
Copy link
Member

dtzWill commented Jun 5, 2018

busybox seems to provide a copy of "unshare", FWIW. Not sure if adequate (and not sure how well things work if you try adding it as a build input re:introducing busybox versions of all-the-things) but thought I'd mention :).

@@ -57,7 +57,7 @@ rec {
git
mercurial
]
++ lib.optional stdenv.isLinux [libseccomp pkgs.utillinux]
++ lib.optional stdenv.isLinux [libseccomp utillinux]
Copy link
Member

@veprbl veprbl Jun 8, 2018

Choose a reason for hiding this comment

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

Also should use lib.optionals (notice the "s") to avoid placing a nested list

https://github.com/NixOS/nixpkgs/blob/master/lib/lists.nix#L200-L222

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

Successfully merging this pull request may close these issues.

None yet

5 participants