| 2 May 2025 |
| chreekat changed their profile picture. | 10:36:28 |
maralorn | I recommend querying nixpkgs-bot with s 371032 😉 | 10:39:36 |
maralorn | Redacted or Malformed Event | 10:40:01 |
alexfmpe | that's odd, I explicitly check for that | 12:31:02 |
alexfmpe | v.isHaskellLibrary && !(lib.hasInfix "Setup haddock" v.haddockPhase); | 12:31:04 |
sterni (he/him) | well the haddock phase is always there is it not? | 12:31:58 |
alexfmpe | the phase yes but not the infix | 12:34:20 |
alexfmpe | nix-repl> haskellPackages.attoparsec.isHaskellLibrary
true
nix-repl> haskellPackages.attoparsec.haddockPhase
"runHook preHaddock\n\nrunHook postHaddock\n"
| 12:34:25 |
alexfmpe | attoparsec has doHaddock = false on hackage-packages.nix | 12:34:38 |
alexfmpe | though this did reveal a somewhat confusing convention on my script with regards to defaults | 12:36:58 |
sterni (he/him) | probably due to doHaddockPhase | not (null internalLibNames) = False | 12:52:29 |
sterni (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 now | 12:53:12 |
alexfmpe | ah attoparsec does have internal lib yes | 12:53:27 |
alexfmpe | I can take a peek at the internal lib stuff, was looking into cabal2nix again to wrap up my conditionals branch anyway | 12:56:15 |
sterni (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.hs | 13:12:40 |
sterni (he/him) | installPhase is really weird, but there are likely reasons for the crazy conditionals in there | 13:12:56 |
sterni (he/him) | almost certainly | 13:13:02 |
Teo (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 thing | 14:20:45 |
Teo (he/him) | At least as far as Setup.hs is concerned | 14:22:09 |
| @malteneuss:matrix.org left the room. | 18:53:19 |
hellwolf | what a great tool, thanks ! :) | 22:01:23 |
| 3 May 2025 |
sterni (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 |
sterni (he/him) | maybe replace the isLibrary, isExecutable logic altogether which is a little brittle | 14:19:22 |
| 4 May 2025 |
woobilicious | how 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 | ❯ 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 |
sterni (he/him) | woobilicious: does it evaluate if you remove p.bytestring from the list? | 08:54:55 |
Alex | 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
- 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.
pkgsStatic usually requires cross-compilation. If you run into evaluation or build problems, this is probably why.
bytestring is a boot library preinstalled with GHC, so Nixpkgs sets it to null (this is why sterni has suggested you remove it).
- For smaller outputs, consider also using
justStaticExecutables.
| 09:40:04 |
sterni (he/him) | GHC 9.10.2 ships text 2.1.2 so we have all the annoying show breakage from 9.12 also there now | 10:06:31 |
woobilicious | Ahh okay, Yeah I just want ghc, I don't have a package at the moment. | 11:27:35 |
woobilicious | Removing bytestring allowed it to eval, so that explains it. | 11:29:29 |