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.org | 146 Servers |
| Sender | Message | Time |
|---|---|---|
| 25 Nov 2024 | ||
| sterni: maralorn What do you think about this generated file: https://dpaste.com/CFP3B5JFW | 14:00:39 | |
| 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 | |
In reply to @maralorn:maralorn.deI applied the formatter manually | 14:05:34 | |
| I still don't know what to do with packages like zlib | 14:06:17 | |
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 | |
| You need to generate something like:
| 14:09:12 | |
| I'm a bit confused about zlib. is this the famous zlib or a haskell version? | 14:11:08 | |
| and since it's in ghc-pkgs list, should I ignore it? The version does not match in my case | 14:12:06 | |
| 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 | |
| ahhh got it. so it gets tricker than I expected | 14:20:11 | |
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 | |
In reply to @maralorn:maralorn.dethat is my reference file. I look at it occasionally. I think we need to maintain a list of such packages | 14:44:45 | |
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 | |
| i think at the end of the day we need to maintain a list of packages that need special care | 14:46:31 | |
In reply to @lxsameer:matrix.orgMaybe, 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 | |
In reply to @lxsameer:matrix.orgI 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 | |
| Thank you. I read more about hackage2nix | 14:58:07 | |
| what is the issue with primitive? | 15:17:09 | |
In reply to @sternenseemann:systemli.org since it is in the
| 15:25:33 | |
| Yeah, some packages from ghc=pkgs list are reinstallable. | 15:33:06 | |
| primitive is not a core library in any version, though?! | 15:58:23 | |
| also, as I sad you of course have to check that the version also matches | 15:58:40 | |
| * also, as I said you of course have to check that the version also matches | 15:58:50 | |
| I mean you'd depending on the situation ghc-pkg list can also contain non-boot packages. | 17:10:02 | |
| * | 17:10:14 | |
In reply to @sternenseemann:systemli.orgThe version matches exactly | 17:19:12 | |
| you should use an unwrapped ghc obviously | 17:19:40 | |
In reply to @sternenseemann:systemli.orgfor ghc-pkg? | 18:15:47 | |
| yes | 18:41:19 | |
| Going forward, after the staging catch up, when do we target master and when haskell-updates? | 23:02:04 | |