Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hamishmack committed May 17, 2022
1 parent bb75d5a commit 656818e
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 5 deletions.
13 changes: 8 additions & 5 deletions lib/system-nixpkgs-map.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ pkgs:
with pkgs;

let
stdcplusplus = if pkgs.stdenv.hostPlatform.isWindows then [
# On windows systems we need these to be propagatedBuildInputs so that the DLLs will be found.
gcclibs = if pkgs.stdenv.hostPlatform.isWindows then [
pkgs.windows.mcfgthreads
# If we just use `pkgs.buildPackages.gcc.cc` here it breaks the `th-dlls` test. TODO figure out why exactly.
(pkgs.evalPackages.runCommand "gcc-only" { nativeBuildInputs = [ pkgs.evalPackages.xorg.lndir ]; } ''
mkdir $out
lndir ${pkgs.buildPackages.gcc.cc} $out
Expand All @@ -18,8 +20,11 @@ in
# -- linux
{ crypto = [ openssl ];
"c++" = []; # no libc++
"stdc++" = stdcplusplus;
"stdc++-6" = stdcplusplus;
"stdc++" = gcclibs;
"stdc++-6" = gcclibs;
gcc_s_seh-1 = gcclibs;
gcc_s = gcclibs;
gcc = gcclibs;
ssl = [ openssl ];
z = [ zlib ];
pcap = [ libpcap ];
Expand Down Expand Up @@ -106,8 +111,6 @@ in
# this should be bundled with gcc.
# if it's not we have more severe
# issues anyway.
gcc_s_seh-1 = null;
gcc_s = null;
ssl32 = null; eay32 = [ openssl ];
iphlpapi = null; # IP Help API
msvcrt = null; # this is the libc
Expand Down
3 changes: 3 additions & 0 deletions overlays/windows.nix
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ final: prev:
network.setupBuildFlags = [];
unix.setupBuildFlags = [];

# Newer Win32 includes hsc2hs, but we can get that that from the ghc derivation and
# if the cabal plan included hsc2hs it winds up trying to build a windows version.
Win32.components.library.build-tools = pkgs.lib.mkForce [];
}
# Fix dependencies and case-sensitive filesystem builds for unix-time.
// pkgs.lib.optionalAttrs pkgs.stdenv.hostPlatform.isWindows {
Expand Down
1 change: 1 addition & 0 deletions test/cabal-simple-prof/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ with lib;
let
modules = [
{
reinstallableLibGhc = true;
# Package has no exposed modules which causes
# haddock: No input file(s)
packages.cabal-simple.doHaddock = false;
Expand Down
1 change: 1 addition & 0 deletions test/cabal-simple/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ with lib;
let
modules = [
{
reinstallableLibGhc = true;
# Package has no exposed modules which causes
# haddock: No input file(s)
packages.cabal-simple.doHaddock = false;
Expand Down
1 change: 1 addition & 0 deletions test/cabal-source-repo-comments/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ let
project = cabalProject' {
inherit compiler-nix-name;
src = testSrc "cabal-source-repo-comments";
modules = [{ reinstallableLibGhc = true; }];
};
packages = project.hsPkgs;
in recurseIntoAttrs {
Expand Down
1 change: 1 addition & 0 deletions test/cabal-source-repo/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ let
project = cabalProject' {
inherit compiler-nix-name;
src = testSrc "cabal-source-repo";
modules = [{ reinstallableLibGhc = true; }];
};
packages = project.hsPkgs;
in recurseIntoAttrs {
Expand Down
1 change: 1 addition & 0 deletions test/cabal-sublib/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ with lib;
let
modules = [
{
reinstallableLibGhc = true;
# Package has no exposed modules which causes
# haddock: No input file(s)
packages.cabal-sublib.doHaddock = false;
Expand Down
1 change: 1 addition & 0 deletions test/call-cabal-project-to-nix/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ let
plan-pkgs = importAndFilterProject {
inherit (callProjectResults) projectNix sourceRepos src;
};
modules = [{ reinstallableLibGhc = true; }];
};
packages = pkgSet.config.hsPkgs;

Expand Down
1 change: 1 addition & 0 deletions test/th-dlls/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ let
project = project' {
inherit compiler-nix-name;
src = testSrc "th-dlls";
modules = [{ reinstallableLibGhc = true; }];
};

packages = project.hsPkgs;
Expand Down

0 comments on commit 656818e

Please sign in to comment.