NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.75k stars 13.87k forks source link

duplicity: newly-enabled tests all fail #64416

Open simon-weber opened 5 years ago

simon-weber commented 5 years ago

Issue description

The tests enabled by @strager in https://github.com/NixOS/nixpkgs/pull/60956 all fail on my system:

Ran 418 tests in 11.799s

FAILED (failures=8, errors=409, skipped=4)

All of the errors seem to be variations of:

test_locked_excl_if_present (testing.functional.test_selection.TestLockedFoldersNoError)
Test no error if excluded locked with --exclude-if-present ... rm: cannot remove 'testfiles/select2/1/1sub1/1sub1sub3': Permission denied

Steps to reproduce

nix-build --check '<nixpkgs>' -A duplicity

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.8.17-galliumos, GalliumOS, 2.1 (Xenon)`
 - multi-user?: `no`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.2.2`
 - channels(simon): `"nixpkgs-19.09pre184803.d567c486ca5"`
 - nixpkgs: `/home/simon/.nix-defexpr/channels/nixpkgs`
strager commented 5 years ago

I could not reproduce this error on a GalliumOS VM:

$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 4.16.18-galliumos, GalliumOS, 3.0 (Bismuth)`
 - multi-user?: `no`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.2.2`
 - channels(strager): `"nixpkgs-19.09pre184803.d567c486ca5"`
 - nixpkgs: `/home/strager/.nix-defexpr/channels/nixpkgs`

(The build also succeeded for a Debian VM and a NixOS VM.)

@simon-weber, can you share the full output of nix-build --check '<nixpkgs>' -A duplicity?

simon-weber commented 5 years ago

Sure, here you go: https://gist.github.com/simon-weber/3d09b3ef89739665953ba06c6294b8c7

I also noticed now the "out of pty devices" bit that's noted as being a problem on macs. I'm not really sure why that's happening on my system, though: as far as I can tell the ulimit is high enough to prevent it.

strager commented 5 years ago

@simon-weber, if you disable Nix' sandbox [1], does the build succeed? (I'm pretty sure sandboxing is causing the problem, but let's make sure.)

[1] https://nixos.org/nix/manual/#sec-conf-file

simon-weber commented 5 years ago

Yup, nix-build --option sandbox false --check '<nixpkgs>' -A duplicity works. The tests all passed after ~6 minutes.

I'm relatively new to nix and mostly interacting with it through nixops. Reading the sandbox docs I'm surprised I haven't run into issues with it yet: I don't run nixops or nix as root and haven't configured anything around build-users-group. Running eg sudo $(which nix-build) ... complains about build-users-group and the nix search path, as is probably expected.

Does that mean my local configuration is just an invalid one? Or is there something more going on here?

simon-weber commented 5 years ago

In case it's helpful for anyone else, here's an example overlay to disable the tests temporarily (in nixops):

nixpkgs.overlays = [ (self: super: {
   duplicity = super.duplicity.overrideAttrs (oldAttrs: {
     doCheck = false;
     doInstallCheck = false;
   });
})];

It took me a bit to figure out I needed to override more than just doCheck.

stale[bot] commented 4 years ago

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.