Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
70 lines
1.8 KiB
Nix
70 lines
1.8 KiB
Nix
{
|
|
lib,
|
|
runCommand,
|
|
runCommandCC,
|
|
haskellPackages,
|
|
}:
|
|
|
|
lib.recurseIntoAttrs {
|
|
# This is special-cased to return just `ghc`.
|
|
trivial = haskellPackages.ghcWithPackages (hsPkgs: [ ]);
|
|
|
|
# Here we actually build a trivial package.
|
|
hello = haskellPackages.ghcWithPackages (hsPkgs: [
|
|
hsPkgs.hello
|
|
]);
|
|
|
|
# Here we build a database with multiple packages.
|
|
multiple = haskellPackages.ghcWithPackages (hsPkgs: [
|
|
hsPkgs.hspec
|
|
hsPkgs.unordered-containers
|
|
]);
|
|
|
|
# See: https://github.com/NixOS/nixpkgs/pull/224542
|
|
regression-224542 =
|
|
let
|
|
ghc = haskellPackages.ghcWithPackages (hsPkgs: [
|
|
hsPkgs.hspec
|
|
]);
|
|
in
|
|
runCommand "regression-224542"
|
|
{
|
|
nativeBuildInputs = [
|
|
ghc
|
|
];
|
|
}
|
|
''
|
|
${ghc.targetPrefix}ghc --interactive \
|
|
-Werror=unrecognised-warning-flags \
|
|
-Werror=missed-extra-shared-lib \
|
|
2>&1 \
|
|
| tee ghc-output.txt
|
|
|
|
# If GHC failed to find a shared library, linking dylibs in
|
|
# `ghcWithPackages` didn't work correctly.
|
|
if grep --quiet "error: .*-Wmissed-extra-shared-lib" ghc-output.txt \
|
|
&& grep --quiet "no such file" ghc-output.txt; then
|
|
exit 1
|
|
fi
|
|
|
|
touch $out
|
|
'';
|
|
|
|
use-llvm =
|
|
let
|
|
ghc = (haskellPackages.ghcWithPackages.override { useLLVM = true; }) (_: [ ]);
|
|
in
|
|
runCommandCC "ghc-with-packages-use-llvm"
|
|
{
|
|
nativeBuildInputs = [ ghc ];
|
|
}
|
|
''
|
|
echo 'main = pure ()' > test.hs
|
|
# -ddump-llvm is unnecessary, but nice for visual feedback in the build log
|
|
${ghc.targetPrefix}ghc --make -fllvm -keep-llvm-files -ddump-llvm test.hs
|
|
# Did we actually use the LLVM backend?
|
|
test -f test.ll
|
|
touch $out
|
|
'';
|
|
}
|