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

Nix packages broken #25

Closed
tannerlegvold opened this issue Sep 3, 2022 · 8 comments
Closed

Nix packages broken #25

tannerlegvold opened this issue Sep 3, 2022 · 8 comments

Comments

@tannerlegvold
Copy link

If you have Nix installed and run

nix-shell -p haskellPackages.evdev

It should give a message about broken packages.

Package ‘evdev-2.1.0’ in /nix/store/5ahhafra1z3r1acp7n5lcgdyjbfgihj6-nixpkgs/nixpkgs/pkgs/development/haskell-modules/hackage-packages.nix:90322 is marked as broken, refusing to evaluate.
...

If you do

export NIXPKGS_ALLOW_BROKEN=1
nix-shell -p haskellPackages.evdev

It will try to go ahead with the build but will fail on a test

...
Test suite test: RUNNING...
Tests
  Smoke:       FAIL
    Exception: newDevice: does not exist (No such file or directory)
    Use -p '/Smoke/' to rerun this test only.
...

This may not be the correct place to post about such a problem. If so, I apologize, what would be a better place?

@georgefst
Copy link
Owner

Thanks, I'm happy to discuss this here, as I do sometimes use Nix*, so I'd like it not to be broken.

There's probably some way in which Nix's sandboxing messes up the environment for this test. Would you be interested in investigating further?

* in fact, I'm currently exploring using it (albeit via Haskell.Nix) for a project of mine which depends on evdev: georgefst/monpad#44.

@georgefst
Copy link
Owner

georgefst commented Sep 3, 2022

FWIW, I've migrated to flakes, but the issue manifests in much the same way:

billy:~$ NIXPKGS_ALLOW_BROKEN=1 nix shell nixpkgs#haskellPackages.evdev --impure -L

...

evdev> Building test suite 'test' for evdev-2.1.0..
evdev> [1 of 1] Compiling Main             ( test/Test.hs, dist/build/test/test-tmp/Main.o )
[1/0/1 built] building evdev-2.1.0 (buildPhase)
evdev> Linking dist/build/test/test ...
evdev> running tests
evdev> Running 1 test suites...
evdev> Test suite test: RUNNING...
evdev> Tests
evdev>   Smoke:       FAIL
evdev>     Exception: newDevice: does not exist (No such file or directory)
evdev>     Use -p '/Smoke/' to rerun this test only.
evdev>   Inverses
evdev>     TimeVal
evdev>       1:       OK
evdev>         +++ OK, passed 1000 tests.
evdev>       2:       OK
evdev>         +++ OK, passed 1000 tests.
evdev>     EventData: OK
evdev>       +++ OK, passed 1000 tests.
evdev> 1 out of 4 tests failed (0.00s)
evdev> Test suite test: FAIL
evdev> Test suite logged to: dist/test/evdev-2.1.0-test.log

@georgefst
Copy link
Owner

We might just have to disable that test in certain environments.

@tannerlegvold
Copy link
Author

Sorry for the late reply. Yes I'm willing to investigate further but I see you've already made some progress. Thanks for being so responsive!

@georgefst
Copy link
Owner

Well, all I've done is confirm I can reproduce the issue. And unfortunately that's as much as I see myself getting round to in the immediate future. Would be great if you're able to debug it!

@tannerlegvold
Copy link
Author

Would be great if you're able to debug it!

This is really my first time playing around with Nix, but I'll try.

Well, according to Hydra the build began failing with evdev-2.1.0. I used a tool to find old revision strings of evdev in nixpkgs-unstable. The most recent is labeled as version 2.1.0, it does indeed fail:

nix-shell -p haskellPackages.evdev -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/bf972dc380f36a3bf83db052380e55f0eaa7dcb6.tar.gz

gives

Package ... is marked as broken, refusing to evaluate.

Meanwhile the next most recent is labeled as version 2.0.0.1. Trying it in the terminal

nix-shell --pure -p haskellPackages.evdev -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/bed08131cd29a85f19716d9351940bdc34834492.tar.gz

works (ignore the --pure, I have to add it because of a quirk with my system, it doesn't affect the success of the build). So it looks like the problem was introduced with version 2.1.0. Though if we toss in dependency on evdev-streamly

nix-shell --pure -p haskellPackages.evdev haskellPackages.evdev-streamly -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/bed08131cd29a85f19716d9351940bdc34834492.tar.gz

It quits working again, this time because of an error message involving streamly-fsnotify-1.1.1.0.

This is about as far as I know to go. I mean, line 23 of Test.hs includes a test called smoke, so you could remove that, but its only one of two tests...

That smoke test was added in this commit. Which was on Feb 11, 2021, so our successful revision string was before the smoke test was added (only by three days though).

@georgefst
Copy link
Owner

As it happens, I also maintain streamly-fsnotify these days, but nix shell nixpkgs#haskellPackages.streamly-fsnotify works for me. It seems that evdev-streamly is only failing because evdev is failing. And evdev is definitely failing because of that smoke test.

It would be interesting to know why exactly the test fails. But a more expedient solution would be to patch the Nix derivation for evdev to just not run the test, and upstream that patch to Nixpkgs. I don't know how to do this off the top of my head, as I'm also pretty new to Nix, but it should be fairly simple, and there are probably other Haskell packages with similar patches in Nixpkgs. If you open a Nixpkgs issue, then I expect someone will be able to help. And if you do, then please link here and/or tag me, so I can help provide any relevant information.

@georgefst
Copy link
Owner

This has been fixed in Nixpkgs.

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

No branches or pull requests

2 participants