| 30 Mar 2025 |
Alex | I don't know about Stack's ability to pull HLS, but you can override the HLS package to enable other compiler versions. | 17:36:25 |
chreekat | It's possible, but not straightforward. To have to add the right version of hls to the nix shell that stack automatically uses on nixos | 19:22:35 |
chreekat | * It's possible, but not straightforward. You have to add the right version of hls to the nix shell that stack automatically uses on nixos | 19:22:47 |
Alex | Not really. You can just enable all versions and I think the wrapper should pick the right version? | 19:37:06 |
chreekat | Mmh first of all, what I said was wrong because stack's nix shell won't help when it comes to enabling hls for an editor | 19:47:58 |
| 31 Mar 2025 |
sellout | I want to run doctest in the checkPhase of a derivation created by cabal2nix. I think I’m close. But, I can’t figure out how to get the GHC environment that’s used to build the package. I.e., doctest is complaining it can’t find the dependencies of the package I’m trying to test. Like command -v ghc in checkPhase is giving me a path like “/nix/store/xxx-ghc-9.6.6/bin/ghc” when I’m looking for something more like “/nix/store/xxx-ghc-9.6.6-with-packages/bin/ghc”. | 06:59:00 |
a12l | When I replace pkgs.haskell-language-server with
(pkgs.haskell-language-server.override {
supportedGhcVersions = [ "96" "92" ];
})
I get this error when trying nixos-rebuild switch --flake .#:
error: builder for '/nix/store/yx5ff3wha9qva80d7gpca686xjqx4kkn-haskell-language-server-2.9.0.0.drv' failed with exit code 1;
last 25 log lines:
> [11 of 13] Compiling Development.IDE.Plugin.Plugins.FillTypeWildcard ( plugins/hls-refactor-plugin/src/Development/IDE/Plugin/Plugins/FillTypeWildcard.hs, dist/build/hls-refactor-plugin/Development/IDE/Plugin/Plugins/FillTypeWildcard.p_o )
> [12 of 13] Compiling Development.IDE.Plugin.Plugins.ImportUtils ( plugins/hls-refactor-plugin/src/Development/IDE/Plugin/Plugins/ImportUtils.hs, dist/build/hls-refactor-plugin/Development/IDE/Plugin/Plugins/ImportUtils.p_o )
> [13 of 13] Compiling Development.IDE.Plugin.CodeAction ( plugins/hls-refactor-plugin/src/Development/IDE/Plugin/CodeAction.hs, dist/build/hls-refactor-plugin/Development/IDE/Plugin/CodeAction.p_o )
> Preprocessing library 'hls-splice-plugin' for haskell-language-server-2.9.0.0..
> Building library 'hls-splice-plugin' for haskell-language-server-2.9.0.0..
>
> <no location info>: warning: [-Wunused-packages]
> The following packages were specified via -package or -package-id flags,
> but were not needed for compilation:
> - ghc-exactprint-1.5.0-9oRXq6HKU5w30oFpO632kK
> [1 of 2] Compiling Ide.Plugin.Splice.Types ( plugins/hls-splice-plugin/src/Ide/Plugin/Splice/Types.hs, dist/build/hls-splice-plugin/Ide/Plugin/Splice/Types.o, dist/build/hls-splice-plugin/Ide/Plugin/Splice/Types.dyn_o )
> [2 of 2] Compiling Ide.Plugin.Splice ( plugins/hls-splice-plugin/src/Ide/Plugin/Splice.hs, dist/build/hls-splice-plugin/Ide/Plugin/Splice.o, dist/build/hls-splice-plugin/Ide/Plugin/Splice.dyn_o )
>
> <no location info>: warning: [-Wunused-packages]
> The following packages were specified via -package or -package-id flags,
> but were not needed for compilation:
> - ghc-exactprint-1.5.0-9oRXq6HKU5w30oFpO632kK
> [1 of 2] Compiling Ide.Plugin.Splice.Types ( plugins/hls-splice-plugin/src/Ide/Plugin/Splice/Types.hs, dist/build/hls-splice-plugin/Ide/Plugin/Splice/Types.p_o )
> [2 of 2] Compiling Ide.Plugin.Splice ( plugins/hls-splice-plugin/src/Ide/Plugin/Splice.hs, dist/build/hls-splice-plugin/Ide/Plugin/Splice.p_o )
> Preprocessing library 'hls-retrie-plugin' for haskell-language-server-2.9.0.0..
> Building library 'hls-retrie-plugin' for haskell-language-server-2.9.0.0..
> [1 of 1] Compiling Ide.Plugin.Retrie ( plugins/hls-retrie-plugin/src/Ide/Plugin/Retrie.hs, dist/build/hls-retrie-plugin/Ide/Plugin/Retrie.o, dist/build/hls-retrie-plugin/Ide/Plugin/Retrie.dyn_o )
> [1 of 1] Compiling Ide.Plugin.Retrie ( plugins/hls-retrie-plugin/src/Ide/Plugin/Retrie.hs, dist/build/hls-retrie-plugin/Ide/Plugin/Retrie.p_o )
> /nix/store/1mv8pj4nxwnd9bbxshljc9p4cnl3rakj-binutils-wrapper-2.43.1/bin/ranlib: dist/build/hls-retrie-plugin/libHShaskell-language-server-2.9.0.0-BRo8Gg6usq8JRcUr14mEwc-hls-retrie-plugin-ghc9.2.8.a: error reading Internal.o: No space left on device
> `ranlib' failed in phase `Ranlib'. (Exit code: 1)
For full logs, run 'nix log /nix/store/yx5ff3wha9qva80d7gpca686xjqx4kkn-haskell-language-server-2.9.0.0.drv'.
error: 1 dependencies of derivation '/nix/store/zvansnmsfmx29cpgq008l7vxs66fswh0-haskell-language-server-2.9.0.0.drv' failed to build
error: 1 dependencies of derivation '/nix/store/vi2lbfb8m6dqbn6ffwkzxmk84fx730mr-system-path.drv' failed to build
error: 1 dependencies of derivation '/nix/store/fdr0jpvadmrh41ahzlcd47036h76v9v6-nixos-system-p-desktop2-24.11.20250323.f0946fa.drv' failed to build
| 09:40:28 |
a12l | No errors when I use
(pkgs.haskell-language-server.overrideAttrs (old: {
supportedGhcVersions = [ "96" "92" ];
}))
Unsure about the difference between override and overrideAttrs
| 09:43:09 |
a12l | But when I use overrideAttrs it doesn't seem that it installs HLS for 9.2 | 09:43:35 |
cdepillabout | I think there is quite a few packages in nixpkgs that use doctest. The I know off the top of my head is termonad, which uses cabal-doctest. Maybe you could look at exactly what cabal-doctest is doing, and try to emulate it within your derivation? | 11:33:19 |
maralorn | a12l: Are you sure the "No space left on device" is not a problem with your system? | 11:36:40 |
maralorn | It makes sense because the build get’s bigger with the overrides that you mention. | 11:37:00 |
maralorn | Yeah, overrideAttrs is wrong and doesn’t even throw an error, so it is a no-op. | 11:38:10 |
a12l | Is it possible my /tmp (tmpfs) that gets filled? For I've > 75GB left on my SSD, and I hope more than that isn't necessary?
| 11:38:24 |
maralorn | I guess so. | 11:39:21 |
a12l | Guess I'll have to move my /tmp to my regular fs. I'll come back later today with the results :) | 11:44:00 |
maralorn | That’s annoying. | 11:45:18 |
emily | you can set the Nix build-dir setting | 14:26:54 |
sellout | Thanks – you’ve reminded me why my code is the way it is. I currently use cabal-doctest, but sol suggested I change it to use the more “official” way to run it. And getting rid of 75 loc per package seemed like a good reason to. But a major reason I use cabal-doctest is so my doctests are run in the Nixpkgs derivations, which I have much less control over than the derivations in my repo. I think the only reasonable way to avoid it would be if cabal2nix itself accepted some way to run doctest explicitly. At least all that boilerplate is generated code – I generally don’t have to think about it. | 15:09:37 |
| Alyssa Ross joined the room. | 16:02:58 |
Alyssa Ross | @sternenseemann:systemli.org what would be my route to getting GHC on aarch64 musl in Nixpkgs, ideally relatively soon? They have binaries for 6.8 but nothing older, and my previous strategy of just avoiding anything with a pandoc input is getting more and more difficult. | 16:04:42 |
a12l | I've
(pkgs.haskell-language-server.override {
supportedGhcVersions = [ "96" "92" ];
})
in environment.systemPackages. But when I run haskell-language-server-wrapper in a Haskell project I get this
# haskell-language-server-wrapper
No 'hie.yaml' found. Try to discover the project type!
Run entered for haskell-language-server-wrapper(haskell-language-server-wrapper) Version 2.9.0.0 x86_64 ghc-9.6.6
Current directory: /root/Forges/Exercism/haskell/acronym
Operating system: linux
Arguments: []
Cradle directory: /root/Forges/Exercism/haskell/acronym
Cradle type: Stack
Tool versions found on the $PATH
cabal: 3.12.1.0
stack: 3.1.1
ghc: 9.6.6
Consulting the cradle to get project GHC version...
2025-03-31T19:38:26.654350Z | Debug | stack --stack-yaml /root/Forges/Exercism/haskell/acronym/stack.yaml setup --silent
2025-03-31T19:38:28.478946Z | Debug | stack --stack-yaml /root/Forges/Exercism/haskell/acronym/stack.yaml exec ghc -- --numeric-version
Project GHC version: 9.2.7
haskell-language-server exe candidates: ["haskell-language-server-9.2.7","haskell-language-server"]
Failed to find a HLS version for GHC 9.2.7
Executable names we failed to find: haskell-language-server-9.2.7,haskell-language-server
| 19:55:35 |
a12l | Doesn't seem that HLS for 9.2 is available in my $PATH? | 19:55:51 |
maralorn | Can you do an ls on the output of the derivation? | 20:51:10 |
Alex | In reply to @a12l:matrix.org Doesn't seem that HLS for 9.2 is available in my $PATH? nix-repl> haskell.compiler.ghc92.version
"9.2.8"
This is probably why. You need "927" in the supportedGhcVersions. | 21:29:12 |
a12l | maralorn, Alex It seems that haskell-language-server-9.2.8 is in my $PATH when I try to autocomplete in the terminal. | 21:58:21 |
a12l | May be that. But why do I need to specify 927? Why doesn't 928 show up when I run haskell-language-server-wrapper when 966 shows up? | 21:59:56 |
Alex | In reply to @qyliss:fairydust.space @sternenseemann:systemli.org what would be my route to getting GHC on aarch64 musl in Nixpkgs, ideally relatively soon? They have binaries for 6.8 but nothing older, and my previous strategy of just avoiding anything with a pandoc input is getting more and more difficult. Have you tried getting it through pkgsMusl?
IIRC pkgsMusl is cross-compiled from the glibc bootstrap, but that should work even for GHC nowadays. | 22:00:52 |
Alex | In reply to @a12l:matrix.org May be that. But why do I need to specify 927? Why doesn't 928 show up when I run haskell-language-server-wrapper when 966 shows up? Because 92 means "the latest available revision of 9.2" and that happens to be 9.2.8, not 9.2.7.
For 96, 9.6.6 is the latest revision in Nixpkgs so that's what you get. | 22:02:24 |
a12l | I understand why you get 9.2.8 when you specify 92, but why does 9.6.6 show up when running haskell-language-server-wrapper and not 9.2.8? In that project 9.2.8 is more correct that 9.6.6 | 22:05:22 |