!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
21 Nov 2024
@lxsameer:matrix.orglxsameer
In reply to @maralorn:maralorn.de
Re 2. well, that only happens if the hackage index you use to generate the freeze file is newer than the one nixpkgs. Maybe there is a way to couple that?
When I work on a project, i usually add deps that are newer than nixpkgs pin
19:47:13
@lxsameer:matrix.orglxsameer
In reply to @maralorn:maralorn.de
Re 3. yeah, that’s because zlib is a haskell package and a system package. The haskell package needs the system package. As you can see in the hackage-packages.nix file in nixpkgs hackage2nix emits code which correctly overrides the inputs of the haskell package with the system package. Your override generation has no such logic and thus you get a loop.
interesting, I disabled it and it works in my case. But i guess we need a way to exclude those packages for now
19:47:40
@sternenseemann:systemli.orgsterni (he/him) lxsameer: index & flags are easy: generate the packages using cabal2nix (maybe as a library) directly. This allows you to reuse the db cabal-install used to generate the freeze file and you can pass all flags to cabal2nix so that the generated expression reflects them correctly 21:03:01
@sternenseemann:systemli.orgsterni (he/him)the infinite loop is trickier. hackage2nix has some code for dealing with that I'd need to look up how it works as well though21:03:25
@lxsameer:matrix.orglxsameer
In reply to @sternenseemann:systemli.org
lxsameer: index & flags are easy: generate the packages using cabal2nix (maybe as a library) directly. This allows you to reuse the db cabal-install used to generate the freeze file and you can pass all flags to cabal2nix so that the generated expression reflects them correctly
could you please elaborate? an example would be appriciated
21:03:53
@sternenseemann:systemli.orgsterni (he/him) E.g. if you run cabal2nix cabal://postgresql-libpq -f use-pkg-config normally, it a) applies the flag before generating the code, so conditional dependencies are correct and b) it'll use the package index downloaded by cabal update 21:09:53
@sternenseemann:systemli.orgsterni (he/him)you can use cabal2nix as a library and these expressions can just be dumped into your overlay instead of the updateHackage mechanism21:10:24
@lxsameer:matrix.orglxsameer
In reply to @sternenseemann:systemli.org
E.g. if you run cabal2nix cabal://postgresql-libpq -f use-pkg-config normally, it a) applies the flag before generating the code, so conditional dependencies are correct and b) it'll use the package index downloaded by cabal update
ah got it, but does cabal2nix will use hackage as well?
21:23:25
@sternenseemann:systemli.orgsterni (he/him)what do you mean?21:23:52
@lxsameer:matrix.orglxsameerin my understanding, cabal2nix, only uses the nixpkgs's version of a haskell package right?21:25:24
@sternenseemann:systemli.orgsterni (he/him)cabal2nix can ingest a variety of things. In the ifd helpers in nixpkgs we can't impurely get anything, so we use the database we have checked in (or rather something equivalent to the database). But if you invoke cabal2nix outside of a derivation you can do whatever.23:35:01
@sternenseemann:systemli.orgsterni (he/him) the cabal:// syntax uses the cabal-install provided database to get the cabal file and source of the package 23:35:33
22 Nov 2024
@flounders:matrix.orgflounders joined the room.09:53:10
@lxsameer:matrix.orglxsameercool, I'll give it a shot10:38:51
@lxsameer:matrix.orglxsameer
In reply to @sternenseemann:systemli.org
cabal2nix can ingest a variety of things. In the ifd helpers in nixpkgs we can't impurely get anything, so we use the database we have checked in (or rather something equivalent to the database). But if you invoke cabal2nix outside of a derivation you can do whatever.
One final question, you are suggesting to call the cabal2nix as process and capturing the output right? You don't mean using callCabal2nix. Am I correct?
17:28:57
@sternenseemann:systemli.orgsterni (he/him)I don't mean callCabal2nix no, that uses derivations17:29:28
@sternenseemann:systemli.orgsterni (he/him)it's probably best to use the library that cabal2nix exposes, as I've mentioned before17:30:07
@lxsameer:matrix.orglxsameerthank you. 17:31:47
@alexfmpe:matrix.orgalexfmpehow can I see hydra cached status? I did a nixpkgs bump on a project to last haskell-updates -> master merge and getting unexpected builds given it's in master for 2 weeks now and usually we cache even before then on my NixOS I had a 15min build of ~20 packages due to overrides, but when doing the same on MacOS I get ~100 packages 21:12:25
@maralorn:maralorn.demaralornalexfmpe, you can try to find the job you are interested in on hydra.nixos.org. There you can also see the built commit.21:19:23
@alexfmpe:matrix.orgalexfmpehttps://hydra.nixos.org/eval/1809838 seems allright21:41:37
@alexfmpe:matrix.orgalexfmpeI wonder if some builder is having hiccups21:41:44
@alexfmpe:matrix.orgalexfmpe * I wonder if some cache is having hiccups21:41:59
@maralorn:maralorn.demaralornI regularly do sudo rm /root/.cache/nix because that cache caches cache misses.21:43:03
@alexfmpe:matrix.orgalexfmpeyikes21:43:13
@alexfmpe:matrix.orgalexfmpelessee21:43:20
@maralorn:maralorn.demaralornI never could proof a wrong miss in the upstream cache even though I often suspected it.21:44:09
@alex:tunstall.xyzAlex
In reply to @maralorn:maralorn.de
I regularly do sudo rm /root/.cache/nix because that cache caches cache misses.
Why not disable the caching of failures altogether? There's a Nix config option for that.
22:00:14
@emilazy:matrix.orgemilyor just upgrade Nix; there's no "cached failure" without an error message these days22:08:30
@emilazy:matrix.orgemilyunless I misunderstand22:08:45

Show newer messages


Back to Room ListRoom Version: 6