!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
25 Nov 2024
@lxsameer:matrix.orglxsameer sterni: maralorn What do you think about this generated file: https://dpaste.com/CFP3B5JFW 14:00:39
@maralorn:maralorn.demaralorn lxsameer: Nice. I personally wouldn’t send this through a formatter, I think those newlines are just noise. But that does not seem important. 14:03:44
@lxsameer:matrix.orglxsameer
In reply to @maralorn:maralorn.de
lxsameer: Nice. I personally wouldn’t send this through a formatter, I think those newlines are just noise. But that does not seem important.
I applied the formatter manually
14:05:34
@lxsameer:matrix.orglxsameerI still don't know what to do with packages like zlib14:06:17
@maralorn:maralorn.demaralorn lxsameer: Okay, so the hackage2nix code in the cabal2nix repo has some logic to inject a zlib = pkgs.zlib in the {} at the end of the corresponding callPackage call. 14:08:20
@maralorn:maralorn.demaralorn

You need to generate something like:


            description = "Compression and decompression in the gzip and zlib formats";
            license = lib.licenses.bsd3;
          })
        { zlib = pkgs.zlib; };
14:09:12
@lxsameer:matrix.orglxsameerI'm a bit confused about zlib. is this the famous zlib or a haskell version?14:11:08
@lxsameer:matrix.orglxsameerand since it's in ghc-pkgs list, should I ignore it? The version does not match in my case14:12:06
@maralorn:maralorn.demaralorn lxsameer: The problem is, it is the Haskell version, but it requires the "famous" C library as an input. But because of how name resolution works in haskellPackages by default it get’s itself as input which creates the loop. 14:18:08
@lxsameer:matrix.orglxsameerahhh got it. so it gets tricker than I expected 14:20:11
@maralorn:maralorn.demaralorn To drive that point home: When callPackage sees "zlib" it will first look for a package called zlib in final and only if it doesn’t find one it will fallback to zlib from pkgs. So the Haskell lib shadows the system lib on lookup. I really encourage you to look at the hackage-packages.nix file in nixpkgs because you are basically recreating what it does. There you can see how system libraries often get manual overrides. 14:41:31
@lxsameer:matrix.orglxsameer
In reply to @maralorn:maralorn.de
To drive that point home: When callPackage sees "zlib" it will first look for a package called zlib in final and only if it doesn’t find one it will fallback to zlib from pkgs. So the Haskell lib shadows the system lib on lookup. I really encourage you to look at the hackage-packages.nix file in nixpkgs because you are basically recreating what it does. There you can see how system libraries often get manual overrides.
that is my reference file. I look at it occasionally. I think we need to maintain a list of such packages
14:44:45
@lxsameer:matrix.orglxsameer for example, as sterni suggested I'm using ghc-pkg list to ignore some packages like rts but that cause some issues with other packages like primitive 14:46:04
@lxsameer:matrix.orglxsameeri think at the end of the day we need to maintain a list of packages that need special care14:46:31
@maralorn:maralorn.demaralorn
In reply to @lxsameer:matrix.org
i think at the end of the day we need to maintain a list of packages that need special care
Maybe, but as I said, hackage2nix has logic to do this for packages like zlib and it works. And even if we have to maintain a manual list, this list already has to exist in cabal2nix/hackage2nix.
14:55:21
@maralorn:maralorn.demaralorn
In reply to @lxsameer:matrix.org
for example, as sterni suggested I'm using ghc-pkg list to ignore some packages like rts but that cause some issues with other packages like primitive
I think the list of packages to never override is so short, that it is totally fine to maintain it manually. I guess it is base, ghc-internal, rts, ghc-experimental and template-haskell right now. Might be missing a few but not many.
14:57:10
@lxsameer:matrix.orglxsameer Thank you. I read more about hackage2nix 14:58:07
@sternenseemann:systemli.orgsterni (he/him)what is the issue with primitive?15:17:09
@lxsameer:matrix.orglxsameer
In reply to @sternenseemann:systemli.org
what is the issue with primitive?

since it is in the ghc-pkgs list I didn't generate an override for it. But cabal throws the following error message:

       > Running phase: updateAutotoolsGnuConfigScriptsPhase
       > Running phase: configurePhase
       > configureFlags: --verbose --prefix=/nix/store/g58fsvxjn69yls3bswyqwh3p6sylvcz8-integer-conversion-0.1.1 --libdir=$prefix/lib/$compiler/lib --libsubdir=$abi/$libname --docdir=/nix/store/dlfskyys6c0bczndvh2
hmvmmznw8s9gf-integer-conversion-0.1.1-doc/share/doc/integer-conversion-0.1.1 --with-gcc=gcc --package-db=/build/tmp.ILQq7Ci7Lr/package.conf.d --ghc-option=-j16 --ghc-option=+RTS --ghc-option=-A64M --ghc-option=-R
TS --disable-library-profiling --disable-profiling --enable-shared --disable-coverage --enable-static --disable-executable-dynamic --disable-tests --disable-benchmarks --enable-library-vanilla --disable-library-fo
r-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/y54504sbwlbbm14hkvv48yw4smjw649c-gmp-with-cx
x-6.3.0/lib
       > Using Parsec parser
       > Configuring integer-conversion-0.1.1...
       > CallStack (from HasCallStack):
       >   withMetadata, called at libraries/Cabal/Cabal/src/Distribution/Simple/Utils.hs:368:14 in Cabal-3.10.3.0:Distribution.Simple.Utils
       > Error: Setup: Encountered missing or private dependencies:
       > primitive >=0.9.0.0 && <0.10
       >
       For full logs, run 'nix log /nix/store/rgp0ww32si0r2lr6kzj18qc4c5yhb8aa-integer-conversion-0.1.1.drv'.

15:25:33
@maralorn:maralorn.demaralornYeah, some packages from ghc=pkgs list are reinstallable.15:33:06
@sternenseemann:systemli.orgsterni (he/him)primitive is not a core library in any version, though?!15:58:23
@sternenseemann:systemli.orgsterni (he/him) also, as I sad you of course have to check that the version also matches 15:58:40
@sternenseemann:systemli.orgsterni (he/him) * also, as I said you of course have to check that the version also matches 15:58:50
@maralorn:maralorn.demaralornI mean you'd depending on the situation ghc-pkg list can also contain non-boot packages.17:10:02
@maralorn:maralorn.demaralorn * 17:10:14
@lxsameer:matrix.orglxsameer
In reply to @sternenseemann:systemli.org
also, as I sad you of course have to check that the version also matches
The version matches exactly
17:19:12
@sternenseemann:systemli.orgsterni (he/him)you should use an unwrapped ghc obviously17:19:40
@lxsameer:matrix.orglxsameer
In reply to @sternenseemann:systemli.org
you should use an unwrapped ghc obviously
for ghc-pkg?
18:15:47
@sternenseemann:systemli.orgsterni (he/him)yes18:41:19
@alexfmpe:matrix.orgalexfmpeGoing forward, after the staging catch up, when do we target master and when haskell-updates?23:02:04

Show newer messages


Back to Room ListRoom Version: 6