Skip to content

Commit 383a60d

Browse files
committed
Fix nix devShell ghc912 musl
Fixes the following error: > error: executing '/nix/store/xy4jjgw87sbgwylm5kn047d9gkbhsr9x-bash-5.2p37/bin/bash': > Argument list too long We are attempting to reduce the number of packages required for the shell by disabling haddock and hoogle. Longer term, it would be better to disable devShells for cross builds entirely.
1 parent c046698 commit 383a60d

File tree

1 file changed

+31
-22
lines changed

1 file changed

+31
-22
lines changed

flake.nix

Lines changed: 31 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -186,24 +186,30 @@
186186
"https://chap.intersectmbo.org/" = inputs.CHaP;
187187
};
188188

189-
shell.tools = {
190-
cabal = "latest";
191-
fourmolu = "latest";
192-
haskell-language-server = {
193-
src = nixpkgs.haskell-nix.sources."hls-2.11";
189+
shell = {
190+
tools = {
191+
cabal = "latest";
192+
fourmolu = "latest";
193+
hlint = "latest";
194+
195+
haskell-language-server = {
196+
src = nixpkgs.haskell-nix.sources."hls-2.11";
197+
};
198+
} // lib.optionalAttrs (config.compiler-nix-name == "ghc967") {
199+
weeder = "latest";
194200
};
195-
hlint = "latest";
196-
} // lib.optionalAttrs (config.compiler-nix-name == "ghc967") {
197-
weeder = "latest";
201+
202+
# Now we use pkgsBuildBuild, to make sure that even in the cross
203+
# compilation setting, we don't run into issues where we pick tools
204+
# for the target.
205+
buildInputs = with nixpkgs.pkgsBuildBuild; [
206+
git
207+
];
208+
209+
withHoogle = true;
210+
211+
crossPlatforms = _: [];
198212
};
199-
# Now we use pkgsBuildBuild, to make sure that even in the cross
200-
# compilation setting, we don't run into issues where we pick tools
201-
# for the target.
202-
shell.buildInputs = with nixpkgs.pkgsBuildBuild; [
203-
gitAndTools.git
204-
];
205-
shell.withHoogle = true;
206-
shell.crossPlatforms = _: [];
207213

208214
modules = [
209215
({ lib, pkgs, ... }: {
@@ -212,7 +218,7 @@
212218
packages.katip.doExactConfig = true;
213219
# Split data to reduce closure size
214220
packages.ekg.components.library.enableSeparateDataOutput = true;
215-
# Haddock is failing for these two packages (at least with GHC 8.10.7)
221+
# Haddock is failing for these two packages (at least with GHC 8.10.7)
216222
packages.ouroboros-network.doHaddock = config.compiler-nix-name != "ghc8107";
217223
packages.cardano-node.doHaddock = config.compiler-nix-name != "ghc8107";
218224
})
@@ -232,11 +238,11 @@
232238
})
233239

234240
({ lib, pkgs, config, ... }: {
235-
# lib:ghc is a bit annoying in that it comes with it's own build-type:Custom, and then tries
236-
# to call out to all kinds of silly tools that GHC doesn't really provide.
237-
# For this reason, we try to get away without re-installing lib:ghc for now.
238-
reinstallableLibGhc = false;
239-
})
241+
# lib:ghc is a bit annoying in that it comes with it's own build-type:Custom, and then tries
242+
# to call out to all kinds of silly tools that GHC doesn't really provide.
243+
# For this reason, we try to get away without re-installing lib:ghc for now.
244+
reinstallableLibGhc = false;
245+
})
240246

241247
(pkgs.lib.mkIf pkgs.hostPlatform.isMusl
242248
(let
@@ -267,6 +273,9 @@
267273
packages.cardano-db.ghcOptions = ghcOptions;
268274
packages.cardano-db-tool.ghcOptions = ghcOptions;
269275
packages.cardano-smash-server.ghcOptions = ghcOptions;
276+
277+
doHoogle = false;
278+
doHaddock = false;
270279
}))
271280

272281
({

0 commit comments

Comments
 (0)