First of all thanks for your work on this, that's very appreciated.
I've been trying to get static builds on a project at work now that static-haskell-nix is up to date with ghc 8.10.4.
The project is using Bazel and I have been able to get a ghcWithPackages with all our dependencies in scope to build.
However I'm facing issues down the line while trying to build our binaries statically.
To debug this, I'm trying to setup a minimal repo to reproduce the issue but I'm then facing issues before reaching the same point.
I'm trying to build with nix-build -Q nixpkgs.nix -A compiler.
When adding dependencies like aeson in the ghcWithPackages section, it breaks with:
these derivations will be built:
/nix/store/09za53mlnrdb66rq0j889lrsn5xkrdg6-lndir-1.0.3.drv
/nix/store/nakzx1sqxpl757w62vd3mjzn92m504w8-ghc-8.10.4-with-packages.drv
building '/nix/store/09za53mlnrdb66rq0j889lrsn5xkrdg6-lndir-1.0.3.drv'...
builder for '/nix/store/09za53mlnrdb66rq0j889lrsn5xkrdg6-lndir-1.0.3.drv' failed with exit code 126; last 10 log lines:
unpacking source archive /nix/store/rhwljq7yyq4gka6jan564ywahjjx8jxr-lndir-1.0.3.tar.bz2
source root is lndir-1.0.3
setting SOURCE_DATE_EPOCH to timestamp 1331185905 of file lndir-1.0.3/INSTALL
patching sources
updateAutotoolsGnuConfigScriptsPhase
Updating Autotools / GNU config script to a newer upstream version: ./config.sub
Updating Autotools / GNU config script to a newer upstream version: ./config.guess
configuring
configure flags: --disable-dependency-tracking --prefix=/nix/store/3r95ninc1sbm5agl9308zqc0kggb7gfa-lndir-1.0.3
/nix/store/p61072rqa772qnwqhbn9xy9nbpcxw7cb-stdenv-linux/setup: ./configure: /bin/sh: bad interpreter: No such file or directory
cannot build derivation '/nix/store/nakzx1sqxpl757w62vd3mjzn92m504w8-ghc-8.10.4-with-packages.drv': 1 dependencies couldn't be built
error: build of '/nix/store/nakzx1sqxpl757w62vd3mjzn92m504w8-ghc-8.10.4-with-packages.drv' failed
When there's only bytestringin the dependencies, it builds fine.
The section:
replace staticHaskell lndir with default one
xorg = super.xorg // {
lndir = super.xorg.lndir;
};
in the overlay is there be cause it seems to have fixed that kind of issue on our main project repo but not sure it's useful here.
I'm a bit puzzled here since the setup is nearly the same on our main repo, we just have some more overrides in the haskellPkgsOverlay (I've copy pasted the nixpkgs.nix in the demo repo and trimmed it a bit but that's all).
Hi,
First of all thanks for your work on this, that's very appreciated.
I've been trying to get static builds on a project at work now that static-haskell-nix is up to date with ghc 8.10.4. The project is using Bazel and I have been able to get a ghcWithPackages with all our dependencies in scope to build. However I'm facing issues down the line while trying to build our binaries statically. To debug this, I'm trying to setup a minimal repo to reproduce the issue but I'm then facing issues before reaching the same point.
Repo is available here: https://github.com/aveltras/haskell-bazel-nix/tree/static
The nix setup is the following:
I'm trying to build with
nix-build -Q nixpkgs.nix -A compiler
.When adding dependencies like aeson in the ghcWithPackages section, it breaks with:
When there's only
bytestring
in the dependencies, it builds fine.The section:
in the overlay is there be cause it seems to have fixed that kind of issue on our main project repo but not sure it's useful here.
I'm a bit puzzled here since the setup is nearly the same on our main repo, we just have some more overrides in the
haskellPkgsOverlay
(I've copy pasted the nixpkgs.nix in the demo repo and trimmed it a bit but that's all).Any idea on how to solve this ?