24 Jun 2025 |
maralorn | Huh, wild | 06:49:28 |
maralorn | I mean that is a test dependency. Does cabal-install by default build the test suites of dependencies? | 07:03:23 |
maralorn | I had a look at the .cabal file and it looks normalish. | 07:04:26 |
chreekat | I wonder if nixos is a red herring. @artem.types:matrix.org you don't have any stray GHC environment files or cabal project files around, do you? | 08:01:10 |
magic_rb | how can i create a haskellPackages set with a patched GHC? | 13:33:43 |
magic_rb | in a devshell i get the ghc i want with:
(ghc.overrideAttrs (old: {
patches = old.patches or [ ] ++ [ ./dont-free-stable-ptr.patch ];
})).override
{ useLLVM = true; }
| 13:34:04 |
magic_rb | but im not sure how to make haskellPackages use that | 13:34:20 |
magic_rb | oh maybe i found it | 13:37:01 |
magic_rb | nope, i still dont know how to do it, i tried
haskellPackages = pkgs.haskellPackages.override {
ghc = modifyGhc pkgs.haskellPackages.ghc;
};
modifyGhc applies the modifications i sent above | 13:56:59 |
Artem | chreekat: man, you made my day: it looks like the default GHC environment screwed things up | 13:59:17 |
chreekat | Lol I knew it | 14:15:38 |
maralorn | In reply to @magic_rb:matrix.redalder.org how can i create a haskellPackages set with a patched GHC? You can browse through nixpkgs around haskell-modules/make-package-set.nix and look at the function arguments you can override. | 14:28:11 |
magic_rb | In reply to @maralorn:maralorn.de You can browse through nixpkgs around haskell-modules/make-package-set.nix and look at the function arguments you can override. Yeah i got somewhere i think, i wont declare success till it compiles and works | 14:32:25 |
ners | https://github.com/ners/nix-wasm/blob/main/flake.nix
As a working example, here I create a Haskell package set with the WASM GHC (and recreate the entire stdenv while I'm at it). | 14:45:32 |
maralorn | It is much more complicated than what you are trying to do though, since it is cross-compiling. | 15:53:30 |
magic_rb | Yeah for me it was quite simple, just took ages to compile :D | 15:59:11 |
| Lenny. changed their display name from Lenny. [9731 DECT] to Lenny.. | 20:25:08 |
levin | I'm a complete newbie to nix, so please excuse my lack of knowledge:
I'm trying to build the broken package haskore , which is auto-generated by hackage2nix. When building with NIXPKGS\_ALLOW\_BROKEN=1 , the build fails with a dependency error (which looks like it comes from cabal, even tough I'm building with nix?):
CallStack (from HasCallStack):
withMetadata, called at libraries/Cabal/Cabal/src/Distribution/Simple/Utils.hs:368:14 in Cabal-3.10.3.0-cb0e:Distribution.Simple.Utils
Error: Setup: Encountered missing or private dependencies:
bytestring >=0.9 && <0.11, transformers >=0.0.1 && <0.6
Now, further 'investigation' showed, that the packages bytestring and transformers are not in nixpkgs, because the modules they provide are automatically installed when installing ghc .
When trying to tell nix to just not care about those dependencies, I looked into the auto-generated hackage-packages.nix and, indeed, the dependencies for bytestring and transformers are in the buildInputs . But the confusing part is, that many packages have those dependencies, but build perfectly fine, even tough their dependencies, as it seems to me, can't be fulfilled.
Even tough I didn't test it (because I didn't understand how), I believe the error persists in the haskell-updates branch, since the package definition of haskore didn't change.
Can someone explain this to me? Does testHaskellDepends have anything to do with the problem? And do I, with just enough understanding of nix to successfully build my NixOS System, have a chance to fix this issue locally or upstream in about 1-2 days of work? Might someone even volunteer to help me with this?
| 20:52:39 |
levin | * I'm a complete newbie to nix, so please excuse my lack of knowledge:
I'm trying to build the broken package haskore , which is auto-generated by hackage2nix. When building with NIXPKGS\_ALLOW\_BROKEN=1 , the build fails with a dependency error (which looks like it comes from cabal, even tough I'm building with nix?):
CallStack (from HasCallStack):
withMetadata, called at libraries/Cabal/Cabal/src/Distribution/Simple/Utils.hs:368:14 in Cabal-3.10.3.0-cb0e:Distribution.Simple.Utils
Error: Setup: Encountered missing or private dependencies:
bytestring >=0.9 && <0.11, transformers >=0.0.1 && <0.6
Now, further 'investigation' showed, that the packages bytestring and transformers are not in nixpkgs, because the modules they provide are automatically installed when installing ghc .
When trying to tell nix to just not care about those dependencies, I looked into the auto-generated hackage-packages.nix and, indeed, the dependencies for bytestring and transformers are in the buildInputs . But the confusing part is, that many packages have those dependencies, but build perfectly fine, even tough their dependencies, as it seems to me, can't be fulfilled.
Even tough I didn't test it (because I didn't understand how), I believe the error persists in the haskell-updates branch, since the package definition of haskore didn't change.
Can someone explain this to me? Does testHaskellDepends have anything to do with the problem? And do I, with just enough understanding of nix to successfully build my NixOS System, have a chance to fix this issue locally or upstream in about 1-2 days of work? Might someone even volunteer to help me with this?
| 20:54:33 |
emily | are you sure the issue isn't that they require too old a version for the GHC? | 20:56:54 |
maralorn | In reply to @le:4d2.org
I'm a complete newbie to nix, so please excuse my lack of knowledge:
I'm trying to build the broken package haskore , which is auto-generated by hackage2nix. When building with NIXPKGS\_ALLOW\_BROKEN=1 , the build fails with a dependency error (which looks like it comes from cabal, even tough I'm building with nix?):
CallStack (from HasCallStack):
withMetadata, called at libraries/Cabal/Cabal/src/Distribution/Simple/Utils.hs:368:14 in Cabal-3.10.3.0-cb0e:Distribution.Simple.Utils
Error: Setup: Encountered missing or private dependencies:
bytestring >=0.9 && <0.11, transformers >=0.0.1 && <0.6
Now, further 'investigation' showed, that the packages bytestring and transformers are not in nixpkgs, because the modules they provide are automatically installed when installing ghc .
When trying to tell nix to just not care about those dependencies, I looked into the auto-generated hackage-packages.nix and, indeed, the dependencies for bytestring and transformers are in the buildInputs . But the confusing part is, that many packages have those dependencies, but build perfectly fine, even tough their dependencies, as it seems to me, can't be fulfilled.
Even tough I didn't test it (because I didn't understand how), I believe the error persists in the haskell-updates branch, since the package definition of haskore didn't change.
Can someone explain this to me? Does testHaskellDepends have anything to do with the problem? And do I, with just enough understanding of nix to successfully build my NixOS System, have a chance to fix this issue locally or upstream in about 1-2 days of work? Might someone even volunteer to help me with this?
Excellent analysis. The problem is most cetrainly what emily says. haskore is not satisfied with the bytestring version we provide. You see the error from cabal because the nixpkgs Haskell builder uses the Cabal library. You can hopefully easily fix it by applying the doJailbreak helper to the haskore package. You can read about it in the nixpkgs manual. A grep through nixpkgs will give you plenty of usage examples. | 21:03:01 |
emily | I was going out on a limb because I have no idea what boot library versions are comtemporary any more :) | 21:04:49 |
levin | yeah, emily was right i think -_-. And the solution is even easier: haskell.packages.ghc810.ghcWithPackages (p: \[haskore\]) seems to build (building right now). Thank you both very much | 21:05:16 |
emily | note that 8.10 is slated for removal AIUI | 21:05:55 |
emily | so pursuing maralorn's suggestion may be a good use of time | 21:06:23 |
levin | it doesn't build, just breaks later lol. then I'll try maralorn solution. Thanks again | 21:07:42 |
25 Jun 2025 |
Alex | In reply to @le:4d2.org
I'm a complete newbie to nix, so please excuse my lack of knowledge:
I'm trying to build the broken package haskore , which is auto-generated by hackage2nix. When building with NIXPKGS\_ALLOW\_BROKEN=1 , the build fails with a dependency error (which looks like it comes from cabal, even tough I'm building with nix?):
CallStack (from HasCallStack):
withMetadata, called at libraries/Cabal/Cabal/src/Distribution/Simple/Utils.hs:368:14 in Cabal-3.10.3.0-cb0e:Distribution.Simple.Utils
Error: Setup: Encountered missing or private dependencies:
bytestring >=0.9 && <0.11, transformers >=0.0.1 && <0.6
Now, further 'investigation' showed, that the packages bytestring and transformers are not in nixpkgs, because the modules they provide are automatically installed when installing ghc .
When trying to tell nix to just not care about those dependencies, I looked into the auto-generated hackage-packages.nix and, indeed, the dependencies for bytestring and transformers are in the buildInputs . But the confusing part is, that many packages have those dependencies, but build perfectly fine, even tough their dependencies, as it seems to me, can't be fulfilled.
Even tough I didn't test it (because I didn't understand how), I believe the error persists in the haskell-updates branch, since the package definition of haskore didn't change.
Can someone explain this to me? Does testHaskellDepends have anything to do with the problem? And do I, with just enough understanding of nix to successfully build my NixOS System, have a chance to fix this issue locally or upstream in about 1-2 days of work? Might someone even volunteer to help me with this?
If you also use markUnbroken (same usage as doJailbreak ), you should also be able to avoid the need to NIXPKGS_ALLOW_BROKEN=1 .
(Often, combining doJailbreak and markUnbroken is enough to fix Haskell packages marked broken. Occasionally, you may encounter compiler errors doing it and need to actually patch the code.) | 03:07:31 |
ners | I like to encourage people to use unmarkBroken rather than markUnbroken , as the flag is called broken , not unbroken . 🙃 | 07:58:18 |
levin | Success! I had to also disable the Tests since they also do not work (and seem pretty unfixable to me), but with this abomination of a nix-shell command, it builds!
nix-shell -p 'haskellPackages.ghcWithPackages (p: with haskell.lib; [(unmarkBroken (dontCheck (doJailbreak p.haskore)))])'
Is this a solution worth pushing to the repo, or is the usage of doJailbreak and dontCheck too ugly?
| 11:40:10 |
maralorn | In reply to @le:4d2.org
Success! I had to also disable the Tests since they also do not work (and seem pretty unfixable to me), but with this abomination of a nix-shell command, it builds!
nix-shell -p 'haskellPackages.ghcWithPackages (p: with haskell.lib; [(unmarkBroken (dontCheck (doJailbreak p.haskore)))])'
Is this a solution worth pushing to the repo, or is the usage of doJailbreak and dontCheck too ugly?
No, that's uptreamable. Imagine how much time you can save the next you without them even realizing. | 11:44:29 |