NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.45k stars 13.65k forks source link

Haskell packages: multistate-0.8.0.4 broken #207971

Closed andys8 closed 1 year ago

andys8 commented 1 year ago

Steps To Reproduce

Steps to reproduce the behavior:

I don't exactly know. I only wanted to update my packages as always without changes.

nix-env -irf packages.nix

with

https://github.com/andys8/dotfiles/blob/4af4ac97b589ed4e55ee7cb6fd96950cf5b82e4b/nix/packages.nix

Build log

error: Package ‘multistate-0.8.0.4’ in /nix/store/ppy7bhb52mp9dq71akypl9jn05msg6cp-nixpkgs/nixpkgs/pkgs/development/haskell-modules/hackage-packages.nix:197386 is marked as broken, refusing to evaluate.

       a) To temporarily allow broken packages, you can use an environment variable
          for a single invocation of the nix tools.

            $ export NIXPKGS_ALLOW_BROKEN=1

        Note: For `nix shell`, `nix build`, `nix develop` or any other Nix 2.4+
        (Flake) command, `--impure` must be passed in order to read this
        environment variable.

       b) For `nixos-rebuild` you can set
         { nixpkgs.config.allowBroken = true; }
       in configuration.nix to override this.

       c) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
         { allowBroken = true; }
       to ~/.config/nixpkgs/config.nix.
(use '--show-trace' to show detailed location information)

Additional context

image

Notify maintainers

Unknown

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 5.15.0-53-generic, Linux Mint, 21 (Vanessa), nobuild`
 - multi-user?: `no`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.8.1`
 - channels(as): `"nixpkgs"`
 - nixpkgs: `/home/as/.nix-defexpr/channels/nixpkgs`

Update

Found https://github.com/NixOS/nixpkgs/blob/2819a437f7a96e42c874b7e97702263ba111ca71/pkgs/development/haskell-modules/configuration-hackage2nix/broken.yaml and https://github.com/NixOS/nixpkgs/blob/2819a437f7a96e42c874b7e97702263ba111ca71/pkgs/development/haskell-modules/HACKING.md. Not sure how this is solved in general. Maintainers need to make sure their projects compile for different ghc versions? Or what changed? Or is there a CI job that tells the reason why a package is broken in more detail?

Update 2

harryprayiv commented 1 year ago

I'm having this issue too. It is failing in all of my configs.

error: Package ‘multistate-0.8.0.4’ in /nix/store/wh4nnz2ga9lpxl406ia1cnsi891xaa4x-source/pkgs/development/haskell-modules/hackage-packages.nix:197386 is marked as broken, refusing to evaluate.

Literally, my entire window manager (Xmonad) depends on this one package.

harryprayiv commented 1 year ago

what happens when I try to build past it using --impure?

error: builder for '/nix/store/nhd6k4p4rgk9z234fm01i8hl9agf53jl-multistate-0.8.0.4.drv' failed with exit code 1;
       last 10 log lines:
       > [1 of 1] Compiling Main             ( Setup.hs, /build/tmp.CTThTqwJmA/Main.o )
       > Linking Setup ...
       > configuring
       > configureFlags: --verbose --prefix=/nix/store/s511i11qc0b9gcbjxwvq42a3dp6hld0d-multistate-0.8.0.4 --libdir=$prefix/lib/$compiler --libsubdir=$abi/$libname --docdir=/nix/store/dd6yja21gdd23lvwdn1yz6q7fkisqq1v-multistate-0.8.0.4-doc/share/doc/multistate-0.8.0.4 --with-gcc=gcc --package-db=/build/tmp.CTThTqwJmA/package.conf.d --ghc-options=-j8 +RTS -A64M -RTS --disable-split-objs --enable-library-profiling --profiling-detail=exported-functions --disable-profiling --enable-shared --disable-coverage --enable-static --disable-executable-dynamic --enable-tests --disable-benchmarks --enable-library-vanilla --disable-library-for-ghci --ghc-option=-split-sections --ghc-options=-haddock --extra-lib-dirs=/nix/store/ifs2ghiwngx45a0bkq2lymf4gh8zdr9i-ncurses-6.3-p20220507/lib --extra-lib-dirs=/nix/store/2infxahfp9lj084xn3q9ib5ajks8447i-libffi-3.4.4/lib --extra-lib-dirs=/nix/store/4n2j62ghfgsk5amycf3zss01b3wp0846-gmp-with-cxx-6.2.1/lib --extra-lib-dirs=/nix/store/50h3rrcly4gvxh6xi2g16yxm7zv7ihvr-ghc-9.2.4/lib
       > Using Parsec parser
       > Configuring multistate-0.8.0.4...
       >
       > Setup: Encountered missing or private dependencies:
       > hspec >=2 && <2.9
       >
       For full logs, run 'nix log /nix/store/nhd6k4p4rgk9z234fm01i8hl9agf53jl-multistate-0.8.0.4.drv'.
error: 1 dependencies of derivation '/nix/store/ly5k1hld2grsrqr7gv7gqblzvjgccl1c-brittany-0.14.0.2.drv' failed to build
error: 1 dependencies of derivation '/nix/store/9p0hxf7zivpd3hh7994bbxrn99hxgnxy-brittany-0.14.0.2-fish-completions.drv' failed to build
error: 1 dependencies of derivation '/nix/store/c6j9yw2iyky5i2ifnxrpkgnrp8jd9yn2-home-manager-path.drv' failed to build
error: 1 dependencies of derivation '/nix/store/gwgiifzisw67m60dfnhx8axakya5d23a-man-paths.drv' failed to build
error: 1 dependencies of derivation '/nix/store/p3fckrzlg9z9g7lsvh2j81m6rhix1c7m-home-manager-generation.drv' failed to build
harryprayiv commented 1 year ago

log

@nix { "action": "setPhase", "phase": "setupCompilerEnvironmentPhase" }
setupCompilerEnvironmentPhase
Build with /nix/store/50h3rrcly4gvxh6xi2g16yxm7zv7ihvr-ghc-9.2.4.
@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking sources
unpacking source archive /nix/store/bc9qan1q4m7q2rl6qwr2jhbsxmj06qsb-multistate-0.8.0.4.tar.gz
source root is multistate-0.8.0.4
setting SOURCE_DATE_EPOCH to timestamp 1000000000 of file multistate-0.8.0.4/test/Test.hs
@nix { "action": "setPhase", "phase": "patchPhase" }
patching sources
@nix { "action": "setPhase", "phase": "compileBuildDriverPhase" }
compileBuildDriverPhase
setupCompileFlags: -package-db=/build/tmp.CTThTqwJmA/setup-package.conf.d -j8 +RTS -A64M -RTS -threaded -rtsopts
[1 of 1] Compiling Main             ( Setup.hs, /build/tmp.CTThTqwJmA/Main.o )
Linking Setup ...
@nix { "action": "setPhase", "phase": "configurePhase" }
configuring
configureFlags: --verbose --prefix=/nix/store/s511i11qc0b9gcbjxwvq42a3dp6hld0d-multistate-0.8.0.4 --libdir=$prefix/lib/$compiler --libsubdir=$abi/$libname --d>
Using Parsec parser
Configuring multistate-0.8.0.4...

Setup: Encountered missing or private dependencies:
hspec >=2 && <2.9
andys8 commented 1 year ago
Setup: Encountered missing or private dependencies:
hspec >=2 && <2.9

This is interesting. multistate wants hspec to have version < 2.9.gg

https://github.com/lspitzner/multistate/blob/5179cb21787d488e6049ae6e853cb0c101fd04fd/multistate.cabal#L107

And haskell-packages.nix only contains 2.9.7. Together this won't work.

https://github.com/andys8/nixpkgs/blob/a1f6c65bfc8d640738d4683b62a61b91b7c346d6/pkgs/development/haskell-modules/hackage-packages.nix#L149755

There is already a pull request that would allow hspec < 2.10 which would solve the issue.

https://github.com/lspitzner/multistate/pull/12

andys8 commented 1 year ago

Literally, my entire window manager (Xmonad) depends on this one package.

@harryprayiv Could you tell me how you could see that xmonad depends on multistate? I tried looking into cabals build plan and it doesn't look like there would be a direct or indirect dependency. Not sure though.

On the other hand brittany depends on multistate.

https://github.com/lspitzner/brittany/blob/e03ab8425bbc5a3171808cee3285480f64d21536/brittany.cabal#L59

It is mentioned in the logs you posted

error: 1 dependencies of derivation '/nix/store/ly5k1hld2grsrqr7gv7gqblzvjgccl1c-brittany-0.14.0.2.drv' failed to build

And to make it worse: I don't think brittany will ever be updated to GHC 9.2. The project is unmaintained and the effort to update is considered a large change.

harryprayiv commented 1 year ago

I was mistaken about the xmonad dependency. Thanks for your help.

cdepillabout commented 1 year ago

Looks like this was fixed in https://github.com/NixOS/nixpkgs/pull/208126/commits/439841cc15cdc76523115eca65a10429167ce46b which is included in https://github.com/NixOS/nixpkgs/pull/208126.

https://nixpk.gs/pr-tracker.html?pr=208126

I'll close this issue, but feel free to leave a message if this doesn't fix your problems and we can reopen.