Skip to content

Commit

Permalink
Test a version of haskell.nix using cabal unit IDs
Browse files Browse the repository at this point in the history
  • Loading branch information
hamishmack committed Sep 10, 2024
1 parent 51a034a commit 5a2edc1
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 83 deletions.
90 changes: 34 additions & 56 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

53 changes: 26 additions & 27 deletions nix/haskell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ let
({ lib, pkgs, ... }: {
packages.cardano-tracer.package.buildable = with pkgs.stdenv.hostPlatform; lib.mkForce (!isMusl);
packages.cardano-node-chairman.components.tests.chairman-tests.buildable = lib.mkForce pkgs.stdenv.hostPlatform.isUnix;
package-keys = ["plutus-tx-plugin"];
packages.plutus-tx-plugin.components.library.platforms = with lib.platforms; [ linux darwin ];
packages.tx-generator.package.buildable = with pkgs.stdenv.hostPlatform; !isMusl;

Expand All @@ -139,10 +140,6 @@ let
packages.unix-time.postPatch = ''
sed -i 's/mingwex//g' unix-time.cabal
'';
# For these two packages the custom setups fail, as we end up with multiple instances of
# lib:Cabal. Likely a haskell.nix bug.
packages.entropy.package.buildType = lib.mkForce "Simple";
packages.HsOpenSSL.package.buildType = lib.mkForce "Simple";
#packages.plutus-core.components.library.preBuild = ''
# export ISERV_ARGS="-v +RTS -Dl"
# export PROXY_ARGS=-v
Expand Down Expand Up @@ -312,17 +309,18 @@ let
# <no location info>: error: ghc: ghc-iserv terminated (-11)
packages.plutus-core.components.library.ghcOptions = [ "-fexternal-interpreter" ];
})
({ lib, ... }@args: {
options.packages = lib.mkOption {
type = lib.types.attrsOf (lib.types.submodule (
{ config, lib, ... }:
lib.mkIf config.package.isLocal
{
configureFlags = [ "--ghc-option=-Werror"]
++ lib.optional (args.config.compiler.version == "8.10.7") "--ghc-option=-Wwarn=unused-packages";
}
));
};
({ config, lib, ... }@args: {
options.packages = lib.genAttrs config.package-keys (_:
lib.mkOption {
type = lib.types.submodule (
{ config, lib, ... }:
lib.mkIf config.package.isLocal
{
configureFlags = [ "--ghc-option=-Werror"]
++ lib.optional (args.config.compiler.version == "8.10.7") "--ghc-option=-Wwarn=unused-packages";
}
);
});
})
({ lib, pkgs, ... }: lib.mkIf pkgs.stdenv.hostPlatform.isLinux {
# systemd can't be statically linked
Expand All @@ -332,18 +330,19 @@ let
})
# disable haddock
# Musl libc fully static build
({ lib, ... }: {
options.packages = lib.mkOption {
type = lib.types.attrsOf (lib.types.submodule (
{ config, lib, pkgs, ...}:
lib.mkIf (pkgs.stdenv.hostPlatform.isMusl && config.package.isLocal)
{
# Module options which adds GHC flags and libraries for a fully static build
enableShared = true; # TH code breaks if this is false.
enableStatic = true;
}
));
};
({ config, lib, ... }: {
options.packages = lib.genAttrs config.package-keys (_:
lib.mkOption {
type = lib.types.submodule (
{ config, lib, pkgs, ...}:
lib.mkIf (pkgs.stdenv.hostPlatform.isMusl && config.package.isLocal)
{
# Module options which adds GHC flags and libraries for a fully static build
enableShared = true; # TH code breaks if this is false.
enableStatic = true;
}
);
});
config =
lib.mkIf pkgs.stdenv.hostPlatform.isMusl
{
Expand Down

0 comments on commit 5a2edc1

Please sign in to comment.