!RbXGJhHMsnQcNIDFWN:nixos.org

Haskell in Nixpkgs/NixOS

729 Members
For discussions and questions about Haskell with Nix, cabal2nix and haskellPackages in nixpkgs | Current Docs: https://haskell4nix.readthedocs.io/ | More Nix: #community:nixos.org | More Haskell: #haskell-space:matrix.org146 Servers

Load older messages


SenderMessageTime
4 Nov 2024
@sternenseemann:systemli.orgsterni (he/him) lxsameer: dang I was just about to write that as well, cabal never solves with test suites or benchmarks enabled, but nixpkgs enables all test suites by default 11:50:49
@sternenseemann:systemli.orgsterni (he/him)and your freezefile has a conflicting version for postgresql-libpq11:51:12
@maralorn:maralorn.demaralornYes, that is the fundamental issue with this design everything which you want to build has to be part of the build plan which cabal produces.11:51:19
@lxsameer:matrix.orglxsameerand also, I didn't take the flags from the freeze file into account11:51:27
@sternenseemann:systemli.orgsterni (he/him)yes you probably need to add that as well, shouldn't be very hard11:51:40
@sternenseemann:systemli.orgsterni (he/him) you need to pass it to cabal2nix though, i.e. to the ifd helpers, not to configureFlags so that the dependencies are adjusted accordingly 11:52:37
@sternenseemann:systemli.orgsterni (he/him) i.e. --flag flag of cabal2nix 11:52:49
@lxsameer:matrix.orglxsameer
In reply to @sternenseemann:systemli.org
you need to pass it to cabal2nix though, i.e. to the ifd helpers, not to configureFlags so that the dependencies are adjusted accordingly
for each dependency separately?
11:53:24
@maralorn:maralorn.demaralornWe somehow need to converge what cabal does and what nix does in terms of build targets. For hoogle I would highly recommend using the unoverriden hoogle. That might currently not be super convenient to do in nixpkgs, but its definitely the right solution. For tests it depends on what we want. But I see no reason why it would be hard to disable tests for dependencies but enable all tests and binaries for the current repo.11:55:30
@maralorn:maralorn.demaralorn * We somehow need to converge what cabal does and what nix does in terms of build targets. For hoogle I would highly recommend using the unoverriden hoogle. That might currently not be super convenient to do in nixpkgs, but its definitely the right solution. For tests it depends on what we want. But I see no reason why it would be hard to disable tests for dependencies but enable all tests and binaries for the current repo. I actually think that is already the default with your approach.11:55:45
@lxsameer:matrix.orglxsameer
In reply to @maralorn:maralorn.de
We somehow need to converge what cabal does and what nix does in terms of build targets. For hoogle I would highly recommend using the unoverriden hoogle. That might currently not be super convenient to do in nixpkgs, but its definitely the right solution. For tests it depends on what we want. But I see no reason why it would be hard to disable tests for dependencies but enable all tests and binaries for the current repo. I actually think that is already the default with your approach.
"unoverriden hoogle" like adding hoogle to the list of cabal dependencies? or use the one from nixpkgs?
11:57:17
@lxsameer:matrix.orglxsameeras for tests, I can see that cabal added quickcheck and stuff like that to the freeze file, so it must be ok for the repo, I have to test it though11:58:06
@maralorn:maralorn.demaralornThat’s what I had expected.11:59:56
@maralorn:maralorn.demaralornI mean use the one from nixpkgs. There is no sensible requirement to recompile hoogle with the library versions you picked.12:00:33
@lxsameer:matrix.orglxsameerok then, in that case if I want to use the same package set, it will conflict. would it be possible to use a different packageset or the default one for hoogle then?12:02:29
@lxsameer:matrix.orglxsameerso beside the inclusion of flags, and cleanups what would be the next step folks?12:03:08
@maralorn:maralorn.demaralornidk, if your project works I’d say you ship it. 😄12:04:28
@maralorn:maralorn.demaralornBut I am happy to review the stuff in more detail, give feedback and brainstorm next steps.12:05:01
@lxsameer:matrix.orglxsameercool, I like that, I'll clean up the code, and ping you. and hopefully make it available for others to use12:10:25
@lxsameer:matrix.orglxsameerI tried to use a newer GHC (9.10) to test this solution, and I made sure that the freeze file is generated with the same compiler version (9.10) but I run into a conflict with the base version. base package is shipped with the compiler right?13:02:38
@sternenseemann:systemli.orgsterni (he/him)
In reply to @lxsameer:matrix.org
for each dependency separately?
everywhere the freeze file contains flags, yes. I assume the default is implied otherwise
13:48:06
@sternenseemann:systemli.orgsterni (he/him) it won’t if you just add it to PATH for a development environment 13:48:56
@sternenseemann:systemli.orgsterni (he/him)some libs depend on QuickCheck so that they can expose non orphan Arbitrary instances13:49:49
@sternenseemann:systemli.orgsterni (he/him)
In reply to @lxsameer:matrix.org
I tried to use a newer GHC (9.10) to test this solution, and I made sure that the freeze file is generated with the same compiler version (9.10) but I run into a conflict with the base version. base package is shipped with the compiler right?
yes
13:50:10
@sternenseemann:systemli.orgsterni (he/him) and non reinstallable because it exposes some GHC modules 13:50:38
@lxsameer:matrix.orglxsameer

hmmm so what would be the solution here? here is an example of the error:

error: builder for '/nix/store/yyyhyvzwp2vrz3n1wqbzirv8zm06dh2s-primitive-0.8.0.0.drv' failed with exit code 1;
       last 23 log lines:
       > Running phase: setupCompilerEnvironmentPhase
       > Build with /nix/store/flx8by8vi8dcx2vaw9rp4gz214kk2dhv-ghc-9.10.1.
       > Running phase: unpackPhase
       > unpacking source archive /nix/store/9fwj05l9qsrjp73mgkhsqx210w19xvd1-primitive-0.8.0.0.tar.gz
       > source root is primitive-0.8.0.0
       > setting SOURCE_DATE_EPOCH to timestamp 1000000000 of file primitive-0.8.0.0/test/src/PrimLaws.hs
       > Running phase: patchPhase
       > Replace Cabal file with edited version from mirror://hackage/primitive-0.8.0.0/revision/1.cabal.
       > Running phase: compileBuildDriverPhase
       > setupCompileFlags: -package-db=/build/tmp.3OGcxDtvet/setup-package.conf.d -threaded
       > [1 of 2] Compiling Main             ( /nix/store/4mdp8nhyfddh7bllbi7xszz7k9955n79-Setup.hs, /build/tmp.3OGcxDtvet/Main.o )
       > [2 of 2] Linking Setup
       > Running phase: updateAutotoolsGnuConfigScriptsPhase
       > Running phase: configurePhase
       > configureFlags: --verbose --prefix=/nix/store/8yjr4gf9cw5wm6gbavvfv9n9kf4xn5i8-primitive-0.8.0.0 --libdir=$prefix/lib/$compiler/lib --libsubdir=$abi/$libname --docdir=/nix/store/wk5mqmy36a6mh95aphwr169g7v
hiq4i4-primitive-0.8.0.0-doc/share/doc/primitive-0.8.0.0 --with-gcc=gcc --package-db=/build/tmp.3OGcxDtvet/package.conf.d --ghc-option=-j16 --ghc-option=+RTS --ghc-option=-A64M --ghc-option=-RTS --enable-library-p
rofiling --profiling-detail=exported-functions --disable-profiling --enable-shared --disable-coverage --enable-static --disable-executable-dynamic --disable-tests --disable-benchmarks --enable-library-vanilla --di
sable-library-for-ghci --enable-split-sections --enable-library-stripping --enable-executable-stripping --ghc-option=-haddock --extra-lib-dirs=/nix/store/53iigsmf32bwkfdhhihq2rppgk23k2rg-ncurses-6.4.20221231/lib -
-extra-lib-dirs=/nix/store/pmf31rbzvv618qirwmzppjb63wsrl4zi-libffi-3.4.6/lib --extra-lib-dirs=/nix/store/yljlqz62v8a9brqmvib9pa4k7yanb15a-elfutils-0.191/lib --extra-lib-dirs=/nix/store/y54504sbwlbbm14hkvv48yw4smjw
649c-gmp-with-cxx-6.3.0/lib
       > Using Parsec parser
       > Configuring primitive-0.8.0.0...
       > Error: [Cabal-8010]
       > Encountered missing or private dependencies:
       >     base >=4.9 && <4.20
       > CallStack (from HasCallStack):
       >   dieWithException, called at libraries/Cabal/Cabal/src/Distribution/Simple/Configure.hs:1457:11 in Cabal-3.12.0.0-inplace:Distribution.Simple.Configure
       >
       For full logs, run 'nix log /nix/store/yyyhyvzwp2vrz3n1wqbzirv8zm06dh2s-primitive-0.8.0.0.drv'.

13:52:05
@lxsameer:matrix.orglxsameercool13:53:10
@maralorn:maralorn.demaralornIs primitive in your lock file?15:39:26
@maralorn:maralorn.demaralornAnd is this using the primitive version from your lock file?15:43:26
@lxsameer:matrix.orglxsameeroh flake.lock? I forgot about that one16:06:03

Show newer messages


Back to Room ListRoom Version: 6