nix-community / dream2nix

Simplified nix packaging for various programming language ecosystems [maintainer=@DavHau]
https://dream2nix.dev
MIT License
1.02k stars 123 forks source link

bring cabal2json into nixpkgs #299

Open DavHau opened 2 years ago

DavHau commented 2 years ago

Most of our dream2nix' haskell translators currently use cabal2json in order to import the data from the project's .cabal file into nix. Currently users need to wait quite a long time for cabal2json being compiled, or alternatively configure the nix-community cache. Both scenarios are not great for UX.

It would be best if cabal2json would be built by the nixos.org hydra. It currently is not, because it is marked broken in nixpkgs. I started some effort to unbreak it a while ago here, but it stalled, because the package does not build against recent GHC's.

Therefore the main tasks here are:

ParetoOptimalDev commented 1 year ago

Yeah this one is still broken:

nix-repl> :b pkgs.haskell.lib.dontCheck haskellPackages.cabal2json
:b pkgs.haskell.lib.dontCheck haskellPackages.cabal2json
error: builder for '/nix/store/lfa41sagq4qs0xp0vfd7340dbhhag2sy-cabal2json-0.0.0.0.drv' failed with exit code 1;
       last 10 log lines:
       > [1 of 1] Compiling Main             ( /nix/store/4mdp8nhyfddh7bllbi7xszz7k9955n79-Setup.hs, /build/tmp.0JCkp1EpYV/Main.o )
       > Linking Setup ...
       > configuring
       > configureFlags: --verbose --prefix=/nix/store/136jww7dwddfq2702vk721l4v3ri27pp-cabal2json-0.0.0.0 --libdir=$prefix/lib/$compiler --libsubdir=$abi/$libname --docdir=/nix/store/xjz9rrvkhdnbrc521jp5qfcja0rh7yz5-cabal2json-0.0.0.0-doc/share/doc/cabal2json-0.0.0.0 --with-gcc=gcc --package-db=/build/tmp.0JCkp1EpYV/package.conf.d --ghc-options=-j12 +RTS -A64M -RTS --disable-split-objs --enable-library-profiling --profiling-detail=exported-functions --disable-profiling --enable-shared --disable-coverage --enable-static --disable-executable-dynamic --disable-tests --disable-benchmarks --enable-library-vanilla --disable-library-for-ghci --ghc-option=-split-sections --ghc-options=-haddock --extra-lib-dirs=/nix/store/ydqv79hfk4allfsyikdarb9cjrngidlb-ncurses-6.4/lib --extra-lib-dirs=/nix/store/jcvxqpa1fiy6m8hxxg8h4a51kids1wcq-libffi-3.4.4/lib --extra-lib-dirs=/nix/store/hxypb4m63rlanaykv7icipc4s06p2pvm-gmp-with-cxx-6.2.1/lib
       > Using Parsec parser
       > Configuring cabal2json-0.0.0.0...
       >
       > Setup: Encountered missing or private dependencies:
       > Cabal <3.3
       >
       For full logs, run 'nix log /nix/store/lfa41sagq4qs0xp0vfd7340dbhhag2sy-cabal2json-0.0.0.0.drv'.

With tests enabled, sydtest is also broken:

:b haskellPackages.cabal2json
error: Package ‘sydtest-0.13.0.0’ in /nix/store/dxfmn2pdvvpiark08jlwc8s8gkhviiw1-source/pkgs/development/haskell-modules/hackage-packages.nix:276258 is marked as broken, refusing to evaluate.

Which itself is broken maybe because of paralellism or the different randomness in the nix build environment? Not really sure... here are the logs

Sample of the 85 sydtest failure logs ``` sydtest> output-test/Spec.hs:348 sydtest> ✗ 65 randomness.always outputs the same pseudorandomness sydtest> Retries: 3 (likely not flaky) sydtest> Expected these values to be equal: sydtest> Actual: 63 sydtest> Expected: 2 sydtest> output-test/Spec.hs:92 sydtest> ✗ 66 Diff.shows nice multi-line diffs sydtest> Retries: 3 (likely not flaky) sydtest> Expected these values to be equal: sydtest> Actual: ( "foo" , [] , "bar" ) sydtest> Expected: sydtest> ( "foofoo" sydtest> , [ "quux" , "quux" , "quux" , "quux" , "quux" , "quux" ] sydtest> , "baz" sydtest> ) sydtest> Inline diff: sydtest> ( "foofoo" sydtest> , [] "quux" , "quux" , "quux" , "quux" , "quux" , "quux" ] sydtest> , "barz" sydtest> ) sydtest> output-test/Spec.hs:90 sydtest> ✗ 67 Diff.shows nice multi-line diffs sydtest> Retries: 3 (likely not flaky) sydtest> Expected these values to be equal: sydtest> Actual: sydtest> ( "foo" sydtest> , [ "quux" , "quux" , "quux" , "quux" , "quux" , "quux" , "quux" ] sydtest> , "bar" sydtest> ) sydtest> Expected: sydtest> ( "foofoo" sydtest> , [ "quux" , "quux" , "quux" , "quux" , "quux" , "quux" ] sydtest> , "baz" sydtest> ) sydtest> Inline diff: sydtest> ( "foofoo" sydtest> , [ "quux" , "quux" , "quux" , "quux" , "quux" , "quux" , "quux" ] sydtest> , "barz" sydtest> ) sydtest> output-test/Spec.hs:296 sydtest> ✗ 68 Flakiness.Allows flakiness in this boolean five times (should fail with 5 retries) sydtest> Retries: 5 (likely not flaky) sydtest> output-test/Spec.hs:292 sydtest> ✗ 69 Flakiness.Does not allow flakiness if flakiness is not allowed even if retries happen sydtest> Retries: 3 (likely not flaky) sydtest> Expected these values to be equal: sydtest> Actual: 9 sydtest> Expected: 2 ```