!RbXGJhHMsnQcNIDFWN:nixos.org

Haskell in Nixpkgs/NixOS

724 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.org145 Servers

Load older messages


SenderMessageTime
2 May 2025
@sternenseemann:systemli.orgsterni (he/him)cabal2nix emits this if there's no library component07:37:36
@hellwolf:matrix.orghellwolfI guess I missed something. I thought upon the merging of the latest haskell-updates branch, the default ghc should become 9.8? I have not seen that happen. (I don't depend on that, but I am just curious)10:28:26
@hellwolf:matrix.orghellwolfoh, my bad. It was not merged to master yet.10:29:11
@b:chreekat.netchreekat changed their profile picture.10:36:28
@maralorn:maralorn.demaralorn I recommend querying nixpkgs-bot with s 371032 😉 10:39:36
@maralorn:maralorn.demaralornRedacted or Malformed Event10:40:01
@alexfmpe:matrix.orgalexfmpethat's odd, I explicitly check for that12:31:02
@alexfmpe:matrix.orgalexfmpe v.isHaskellLibrary && !(lib.hasInfix "Setup haddock" v.haddockPhase); 12:31:04
@sternenseemann:systemli.orgsterni (he/him)well the haddock phase is always there is it not?12:31:58
@alexfmpe:matrix.orgalexfmpethe phase yes but not the infix12:34:20
@alexfmpe:matrix.orgalexfmpe
nix-repl> haskellPackages.attoparsec.isHaskellLibrary
true

nix-repl> haskellPackages.attoparsec.haddockPhase     
"runHook preHaddock\n\nrunHook postHaddock\n"
12:34:25
@alexfmpe:matrix.orgalexfmpe attoparsec has doHaddock = false on hackage-packages.nix 12:34:38
@alexfmpe:matrix.orgalexfmpethough this did reveal a somewhat confusing convention on my script with regards to defaults 12:36:58
@sternenseemann:systemli.orgsterni (he/him) probably due to doHaddockPhase | not (null internalLibNames) = False 12:52:29
@sternenseemann:systemli.orgsterni (he/him)Would be nice to figure out the ins and outs of the named libs stuff once and for all, maybe we can improve some stuff now12:53:12
@alexfmpe:matrix.orgalexfmpeah attoparsec does have internal lib yes12:53:27
@alexfmpe:matrix.orgalexfmpeI can take a peek at the internal lib stuff, was looking into cabal2nix again to wrap up my conditionals branch anyway12:56:15
@sternenseemann:systemli.orgsterni (he/him)I think most of it is figuring out how to do it with Setup.hs in the generic builder, i.e. do we have to install internal libs, do we have to install named public libs and how do we do that with Setup.hs13:12:40
@sternenseemann:systemli.orgsterni (he/him)installPhase is really weird, but there are likely reasons for the crazy conditionals in there13:12:56
@sternenseemann:systemli.orgsterni (he/him)almost certainly13:13:02
@teoc:matrix.orgTeo (he/him)I looked into this at some point and iirc if you don't specify a component it installs everything including private libs but if you specify a component with buildTarget then it does the right thing14:20:45
@teoc:matrix.orgTeo (he/him)At least as far as Setup.hs is concerned14:22:09
@malteneuss:matrix.org@malteneuss:matrix.org left the room.18:53:19
@hellwolf:matrix.orghellwolfwhat a great tool, thanks ! :)22:01:23
3 May 2025
@sternenseemann:systemli.orgsterni (he/him) teo (they/he): I think we'll just need to start generating a list of components to install from the cabal file and pass it to mkDerivation or something 14:18:39
@sternenseemann:systemli.orgsterni (he/him) maybe replace the isLibrary, isExecutable logic altogether which is a little brittle 14:19:22
4 May 2025
@woobilicious:matrix.orgwoobilicioushow would one statically compile all deps (except libc)? with just ghc directly? I guess my current issue is that pkgsStatic.ghc.withPackages is missing.03:38:02
@woobilicious:matrix.orgwoobilicious
❯  nix shell --impure --expr "(import (builtins.getFlake \"nixpkgs\") {}).pkgsStatic.haskellPackages.shellFor { packages = (p: [ p.aeson p.typed-process p.bytestring p.lens p.lens-aeson]);}"
error:
       … while calling a functor (an attribute set with a '__functor' attribute)
         at /nix/store/s8b6phy15mzjvx56vjdd1rdd8hr07qw5-source/pkgs/development/haskell-modules/make-package-set.nix:613:29:
          612|       # pkgWithCombinedDeps :: HaskellDerivation
          613|       pkgWithCombinedDeps = self.mkDerivation (genericBuilderArgsModifier genericBuilderArgs);
             |                             ^
          614|

       … while evaluating a branch condition
         at /nix/store/s8b6phy15mzjvx56vjdd1rdd8hr07qw5-source/lib/customisation.nix:173:7:
          172|       in
          173|       if isAttrs result then
             |       ^
          174|         result

       (stack trace truncated; use '--show-trace' to show the full, detailed trace)

       error: expected a set but found null: null

03:47:32
@sternenseemann:systemli.orgsterni (he/him) woobilicious: does it evaluate if you remove p.bytestring from the list? 08:54:55
@alex:tunstall.xyzAlex
In reply to @woobilicious:matrix.org
❯  nix shell --impure --expr "(import (builtins.getFlake \"nixpkgs\") {}).pkgsStatic.haskellPackages.shellFor { packages = (p: [ p.aeson p.typed-process p.bytestring p.lens p.lens-aeson]);}"
error:
       … while calling a functor (an attribute set with a '__functor' attribute)
         at /nix/store/s8b6phy15mzjvx56vjdd1rdd8hr07qw5-source/pkgs/development/haskell-modules/make-package-set.nix:613:29:
          612|       # pkgWithCombinedDeps :: HaskellDerivation
          613|       pkgWithCombinedDeps = self.mkDerivation (genericBuilderArgsModifier genericBuilderArgs);
             |                             ^
          614|

       … while evaluating a branch condition
         at /nix/store/s8b6phy15mzjvx56vjdd1rdd8hr07qw5-source/lib/customisation.nix:173:7:
          172|       in
          173|       if isAttrs result then
             |       ^
          174|         result

       (stack trace truncated; use '--show-trace' to show the full, detailed trace)

       error: expected a set but found null: null

  1. I think you misunderstand the inputs for shellFor. The packages input should be the packages you're developing. shellFor won't install them, only their dependencies.
  2. pkgsStatic usually requires cross-compilation. If you run into evaluation or build problems, this is probably why.
  3. bytestring is a boot library preinstalled with GHC, so Nixpkgs sets it to null (this is why sterni has suggested you remove it).
  4. For smaller outputs, consider also using justStaticExecutables.
09:40:04

Show newer messages


Back to Room ListRoom Version: 6