-
Notifications
You must be signed in to change notification settings - Fork 2
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
Nix build fails around autogen modules and unportable paths #130
Comments
Thanks for reporting this. Is there a reproducible .nix file that I can use to test this? Also, I'm not sure if it helps, but we do provide a cabal2nix derivation in the repository. If you clone the repository you can build it with |
@mzabani thanks for looking at it. I extracted the following snippet from my project that I'm able to reproduce the error with: {
haskellCompiler ? "ghc944"
# this affects static linking as well as licensing mode,
# GMP assumes GPL license for the entire project if linked statically
, withGMP ? false
}:
let
common-src = builtins.fetchTarball {
name = "common-2023-01-03";
url = https://github.com/avanov/nix-common/archive/26fc569bfd9871906cbbb57f2151c19753894620.tar.gz;
# Hash obtained using `nix-prefetch-url --unpack <url>`
sha256 = "sha256:18n9k0qh1dhcp4p6vhlgwz4ps310k9yv5h6snnkjmwnn22wrpzmf";
};
pkgs = (import common-src { projectOverlays = []; }).pkgs;
ghcEnv = import "${common-src}/ghc-env.nix" {
pkgs = pkgs;
haskellCompiler = haskellCompiler;
isHaskellWithGMP = withGMP;
haskellHackageOverrides = self: orig: rec {
haxl = hsLib.markUnbroken (hsLib.doJailbreak orig.haxl);
postgresql-simple = hsLib.doJailbreak orig.postgresql-simple;
};
};
callCabal2Nix = ghcEnv.ghcPkgSetWithOverrides.callCabal2nix;
hsLib = pkgs.haskell.lib;
coddRepo = builtins.fetchTarball {
name = "codd-0.1.1-src";
url = https://github.com/mzabani/codd/archive/3fa043ee28ddb0fa66718815673b09777dd2ff23.tar.gz;
# Hash obtained using `nix-prefetch-url --unpack <url>`
sha256 = "sha256:16ba4lckzn63bnzxvd75lv80hfrd7c6l2mk3ig5wq189r6imlybk";
};
codd =
hsLib.justStaticExecutables
(hsLib.dontHaddock
(hsLib.dontCheck
(callCabal2Nix "codd" coddRepo {
})
)
);
in
{
inherit codd;
} I build it with |
I really think it has to do with default case-insensitivity of Mac filesystem, because the error suggests this (note the include filepaths):
|
I tried your Nix file and it builds correctly and outputs an executable for I pushed to #131 with it. Can you try building the branch in that PR? |
@mzabani thanks for the fix, I can confirm it worked on my end:
Nice find re. the Cabal issue. |
Great to hear that! I've merged that PR into |
I'm using my own Nix API with
callCabal2Nix
that aren't part of IOHK setup for Haskell, but I think there shouldn't be difference as the package being built adheres to the layout of a Hackage artifact (contains cabal file, the sources and the setup entrypoint).The text was updated successfully, but these errors were encountered: