Skip to content

Commit 49c5224

Browse files
sgillespiekderme
authored andcommitted
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. Signed-off-by: Kostas Dermentzis <kostas.dermentzis@iohk.io>
1 parent 65447bc commit 49c5224

File tree

1 file changed

+30
-21
lines changed

1 file changed

+30
-21
lines changed

flake.nix

Lines changed: 30 additions & 21 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, ... }: {
@@ -229,11 +235,11 @@
229235
})
230236

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

238244
(pkgs.lib.mkIf pkgs.hostPlatform.isMusl
239245
(let
@@ -265,6 +271,9 @@
265271
packages.cardano-db.ghcOptions = ghcOptions;
266272
packages.cardano-db-tool.ghcOptions = ghcOptions;
267273
packages.cardano-smash-server.ghcOptions = ghcOptions;
274+
275+
doHoogle = false;
276+
doHaddock = false;
268277
}))
269278

270279
({

0 commit comments

Comments
 (0)