Closed
Description
I have tried to build GHC 8.10.1 against musl in thebrodmann/soallpeach/next.
static.nix
{ compiler ? "ghc8101" }:
let
static-haskell-nix = fetchTarball https://github.com/nh2/static-haskell-nix/archive/d1b20f35ec7d3761e59bd323bbe0cca23b3dfc82.tar.gz;
nixpkgs = fetchTarball https://github.com/NixOS/nixpkgs/archive/ddc2f887f5f4b31128e8d4a56cb524c1d36d6fd4.tar.gz;
pkgs = (import nixpkgs {}).pkgsMusl;
static-haskell-nix-servay = static-haskell-nix + "/survey/default.nix";
survey = import static-haskell-nix-servay {
inherit compiler pkgs;
approach = "pkgsMusl";
defaultCabalPackageVersionComingWithGhc = "Cabal_3_0_0_0";
};
prime = import ./default.nix {
inherit compiler pkgs;
haskellPackages = survey.haskellPackages;
};
buildStatic = drv:
with pkgs.haskell.lib;
appendConfigureFlags
(disableSharedExecutables (disableSharedLibraries drv)) [
"--ghc-option=-optl=-static"
"--ghc-option=-optl=-pthread"
"--extra-lib-dirs=${pkgs.gmp6.override { withStatic = true; }}/lib"
"--extra-lib-dirs=${pkgs.zlib.static}/lib"
"--extra-lib-dirs=${
pkgs.libffi.overrideAttrs (old: { dontDisableStatic = true; })
}/lib"
];
in buildStatic prime.production
default.nix
{ pkgs ? import <nixpkgs> { }
, compiler ? "ghc8101"
, haskellPackages ? pkgs.haskell.packages.${compiler} }:
let
prime = { mkDerivation, attoparsec, base, bzip2, conduit, conduit-algorithms
, conduit-extra, lzma, stdenv, text, vector, bytestring, arithmoi }:
mkDerivation {
pname = "prime";
version = "0.1.0.0";
src = ./.;
isLibrary = false;
isExecutable = true;
executableHaskellDepends = [
attoparsec
base
bytestring
arithmoi
];
description = "Haskell primality test algorithm for soallpeach";
license = stdenv.lib.licenses.gpl3;
};
overrides = self: super: { prime = super.callPackage prime {}; };
haskellPackages' = haskellPackages.extend overrides;
in with pkgs.haskell.lib; {
development = appendConfigureFlags (disableOptimization haskellPackages'.prime) [
"--ghc-option=-threaded"
"--ghc-option=-rtsopts"
];
production = appendConfigureFlags haskellPackages'.prime [
"--ghc-option=-Werror"
"--ghc-option=-O2"
"--ghc-option=-threaded"
"--ghc-option=-rtsopts"
"--ghc-option=-with-rtsopts=-N"
];
}
It failed with the following error:
"inplace/bin/ghc-stage1" -optc-Wall -optc-Wall -optc-Wextra -optc-Wstrict-prototypes -optc-Wmissing-prototypes -optc-Wmissing-declarations -optc-Winline -optc-Wpointer-arith -optc-Wmissing-noreturn -optc-Wnested-externs -optc-Wredundant-decls -optc-Wno-aggregate-return -optc-Iincludes -optc-Iincludes/dist -optc-Iincludes/dist-derivedconstants/header -optc-Iincludes/dist-ghcconstants/header -optc-Iincludes/dist-install/build -optc-Irts -optc-Irts/dist/build -optc-DCOMPILING_RTS -optc-DFS_NAMESPACE=rts -optc-fno-strict-aliasing -optc-fno-common -optc-Irts/dist/build/./autogen -optc-Werror=unused-but-set-variable -optc-Wno-error=inline -optc-O2 -optc-fomit-frame-pointer -optc-g -optc-DDYNAMIC -optc-DRtsWay=\"rts_thr_l_dyn\" -optc-ffunction-sections -optc-fdata-sections -fPIC -dynamic -optc-DTHREADED_RTS -eventlog -H32m -O -Wall -Iincludes -Iincludes/dist -Iincludes/dist-derivedconstants/header -Iincludes/dist-ghcconstants/header -Iincludes/dist-install/build -Irts -Irts/dist/build -DCOMPILING_RTS -DFS_NAMESPACE=rts -this-unit-id rts -dcmm-lint -i -irts -irts/dist/build -Irts/dist/build -irts/dist/build/./autogen -Irts/dist/build/./autogen -O2 -Wcpp-undef -Wnoncanonical-monad-instances -c rts/posix/OSThreads.c -o rts/dist/build/posix/OSThreads.thr_l_dyn_o
grep -v ' : [a-zA-Z]:/' libraries/Cabal/Cabal/dist-install/build/.depend-v-p-dyn.haskell.tmp > libraries/Cabal/Cabal/dist-install/build/.depend-v-p-dyn.haskell.tmp2
sed -e '/hs$/ p' -e '/hs$/ s/o /hi /g' -e '/hs$/ s/:/ : %hi: %o /' -e '/hs$/ s/^/$(eval $(call hi-rule,/' -e '/hs$/ s/$/))/' -e '/hs-boot$/ p' -e '/hs-boot$/ s/o-boot /hi-boot /g' -e '/hs-boot$/ s/:/ : %hi-boot: %o-boot /' -e '/hs-boot$/ s/^/$(eval $(call hi-rule,/' -e '/hs-boot$/ s/$/))/' libraries/Cabal/Cabal/dist-install/build/.depend-v-p-dyn.haskell.tmp2 > libraries/Cabal/Cabal/dist-install/build/.depend-v-p-dyn.haskell
"inplace/bin/mkdirhier" libraries/base/dist-install/build/GHC/IO/Handle/Lock//.
"inplace/bin/mkdirhier" libraries/base/dist-install/build/GHC/Event//.
"inplace/bin/mkdirhier" libraries/base/dist-install/build/System/CPUTime/Posix//.
"cp" libraries/base/./GHC/Stack/CCS.hs-boot libraries/base/dist-install/build/GHC/Stack/CCS.hs-boot
cp: cannot create regular file 'libraries/base/dist-install/build/GHC/Stack/CCS.hs-boot': No such file or directory
libraries/integer-gmp/ghc.mk:4: libraries/integer-gmp/dist-install/build/.depend-v-p-dyn.haskell: No such file or directory
make[1]: *** [libraries/base/ghc.mk:4: libraries/base/dist-install/build/GHC/Stack/CCS.hs-boot] Error 1
make: *** [Makefile:128: all] Error 2
builder for '/nix/store/0ca3z81zbc9r8drx7aqvc6g015pvvlr4-ghc-8.10.0.20200123.drv' failed with exit code 2
cannot build derivation '/nix/store/xf3iw6nqcrwgc4m0yh06k46vcqylpcj9-Cabal-3.0.0.0.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/igs8i30xhh35irrz4mzy5r09c50c7bym-ansi-terminal-0.9.1.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/zrqvm4mblmg40ch69gnk5fbgrgl0yzxv-ansi-wl-pprint-0.6.9.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/h952a3l1nf5bqrv6q53b1qgnz8x4ip1p-arithmoi-0.9.0.0.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/564ma7rbqryx189rfkhlcswcqzzyj35v-async-2.2.2.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/41gzizmba7nzc5afmdj3rwmnvbr5gsyd-hashable-1.2.7.0.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/3ix12jdyxgzx52yy2fv1m4rzjhkl3f5x-hspec-discover-2.7.1.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/gi4j2a9lk165rp2654h4wgy5xq5x7wga-hspec-meta-2.6.0.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/3fsp5scfc4h8c3dq1zbkzpad66ynz6w0-wcwidth-0.0.2.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/ydk4wq01snrsygqpgiq8s1azmgmmp7nc-prime-0.1.0.0.drv': 1 dependencies couldn't be built
error: build of '/nix/store/ydk4wq01snrsygqpgiq8s1azmgmmp7nc-prime-0.1.0.0.drv' failed
I know that GHC 8.10.1 is not supported yet, but I'm interested to see is it possible or not?