Skip to content

Commit 5a2edc1

Browse files
committed
Test a version of haskell.nix using cabal unit IDs
See input-output-hk/haskell.nix#2239
1 parent 51a034a commit 5a2edc1

File tree

2 files changed

+60
-83
lines changed

2 files changed

+60
-83
lines changed

flake.lock

Lines changed: 34 additions & 56 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

nix/haskell.nix

Lines changed: 26 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ let
113113
({ lib, pkgs, ... }: {
114114
packages.cardano-tracer.package.buildable = with pkgs.stdenv.hostPlatform; lib.mkForce (!isMusl);
115115
packages.cardano-node-chairman.components.tests.chairman-tests.buildable = lib.mkForce pkgs.stdenv.hostPlatform.isUnix;
116+
package-keys = ["plutus-tx-plugin"];
116117
packages.plutus-tx-plugin.components.library.platforms = with lib.platforms; [ linux darwin ];
117118
packages.tx-generator.package.buildable = with pkgs.stdenv.hostPlatform; !isMusl;
118119

@@ -139,10 +140,6 @@ let
139140
packages.unix-time.postPatch = ''
140141
sed -i 's/mingwex//g' unix-time.cabal
141142
'';
142-
# For these two packages the custom setups fail, as we end up with multiple instances of
143-
# lib:Cabal. Likely a haskell.nix bug.
144-
packages.entropy.package.buildType = lib.mkForce "Simple";
145-
packages.HsOpenSSL.package.buildType = lib.mkForce "Simple";
146143
#packages.plutus-core.components.library.preBuild = ''
147144
# export ISERV_ARGS="-v +RTS -Dl"
148145
# export PROXY_ARGS=-v
@@ -312,17 +309,18 @@ let
312309
# <no location info>: error: ghc: ghc-iserv terminated (-11)
313310
packages.plutus-core.components.library.ghcOptions = [ "-fexternal-interpreter" ];
314311
})
315-
({ lib, ... }@args: {
316-
options.packages = lib.mkOption {
317-
type = lib.types.attrsOf (lib.types.submodule (
318-
{ config, lib, ... }:
319-
lib.mkIf config.package.isLocal
320-
{
321-
configureFlags = [ "--ghc-option=-Werror"]
322-
++ lib.optional (args.config.compiler.version == "8.10.7") "--ghc-option=-Wwarn=unused-packages";
323-
}
324-
));
325-
};
312+
({ config, lib, ... }@args: {
313+
options.packages = lib.genAttrs config.package-keys (_:
314+
lib.mkOption {
315+
type = lib.types.submodule (
316+
{ config, lib, ... }:
317+
lib.mkIf config.package.isLocal
318+
{
319+
configureFlags = [ "--ghc-option=-Werror"]
320+
++ lib.optional (args.config.compiler.version == "8.10.7") "--ghc-option=-Wwarn=unused-packages";
321+
}
322+
);
323+
});
326324
})
327325
({ lib, pkgs, ... }: lib.mkIf pkgs.stdenv.hostPlatform.isLinux {
328326
# systemd can't be statically linked
@@ -332,18 +330,19 @@ let
332330
})
333331
# disable haddock
334332
# Musl libc fully static build
335-
({ lib, ... }: {
336-
options.packages = lib.mkOption {
337-
type = lib.types.attrsOf (lib.types.submodule (
338-
{ config, lib, pkgs, ...}:
339-
lib.mkIf (pkgs.stdenv.hostPlatform.isMusl && config.package.isLocal)
340-
{
341-
# Module options which adds GHC flags and libraries for a fully static build
342-
enableShared = true; # TH code breaks if this is false.
343-
enableStatic = true;
344-
}
345-
));
346-
};
333+
({ config, lib, ... }: {
334+
options.packages = lib.genAttrs config.package-keys (_:
335+
lib.mkOption {
336+
type = lib.types.submodule (
337+
{ config, lib, pkgs, ...}:
338+
lib.mkIf (pkgs.stdenv.hostPlatform.isMusl && config.package.isLocal)
339+
{
340+
# Module options which adds GHC flags and libraries for a fully static build
341+
enableShared = true; # TH code breaks if this is false.
342+
enableStatic = true;
343+
}
344+
);
345+
});
347346
config =
348347
lib.mkIf pkgs.stdenv.hostPlatform.isMusl
349348
{

0 commit comments

Comments
 (0)