Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test a version of haskell.nix using cabal unit IDs #5981

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
2 changes: 1 addition & 1 deletion nix/workbench/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ let
# recover CHaP location from cardano's project
chap = cardanoNodeProject.args.inputMap."https://chap.intersectmbo.org/";
# build plan as computed by nix
nixPlanJson = cardanoNodeProject.plan-nix.json;
nixPlanJson = cardanoNodeProject.plan-nix + "/plan.json";

workbench' = tools:
pkgs.stdenv.mkDerivation {
Expand Down
2 changes: 1 addition & 1 deletion nix/workbench/shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ let
chap = project.args.inputMap."https://chap.intersectmbo.org/";

# build plan as computed by nix
nixPlanJson = project.plan-nix.json;
nixPlanJson = project.plan-nix + "/plan.json";

in project.shellFor {
name = "workbench-shell";
Expand Down
Loading