srid / haskell-flake

A `flake-parts` Nix module for Haskell development
https://community.flake.parts/haskell-flake
MIT License
146 stars 18 forks source link

`removeConfigureFlags` appears to be broken (asks for list of strings, but throws a type error when receiving a list of strings) #296

Closed ghost closed 6 months ago

ghost commented 6 months ago

This bit throws an error: error: expected a set but found a string: "--with-gcc=gcc".

settings = {
    foo.removeConfigureFlags = [ "--with-gcc=gcc" ];
};

If I change the list to a set or change the string to a set, it says error: A definition for option 'removeConfigureFlags' is not of type 'null or (list of string)'. I've tried just about everything I can think of... is this attribute bugged?

srid commented 6 months ago

Can repro; looks like this was always broken. Fix incoming.

Aside: we need property tests for Nix.

ghost commented 6 months ago

Is it actually removing the flag for you? I still see the flag I'm trying to remove.

srid commented 6 months ago

It simply uses removeConfigureFlag from nixpkgs.

https://github.com/NixOS/nixpkgs/blob/76c8f2db23b7b32622451b848bf50e98ce288b72/pkgs/development/haskell-modules/lib/compose.nix#L154-L159

srid commented 6 months ago

Does setting buildFromSdist = false; make it work? If so, please a new bug report linking to https://github.com/srid/haskell-flake/issues/293

srid commented 6 months ago

Also make sure to try with this fix first https://github.com/srid/haskell-flake/pull/298

ghost commented 6 months ago

I might be doing something wrong... buildFromSdist doesn't appear to make a difference in the build. Putting settings into default doesn't seem to have an effect on my package either.

Out of curiosity, where are the default configure flags coming from? I see some that correspond to settings, but others like enable-library-vanilla and extra-lib-dirs repeated a few times with ncurses, libffi, elfutils, gmp-with-cxx.

I'm using horizon-platform for basePackages and devShell.tools if that matters at all.

ghost commented 6 months ago

I was trying to use the LLVM backend

srid commented 6 months ago

At this point, I'd suggest continuing this discussion in Zulip or Github Discussions.

ghost commented 6 months ago

Okay I'll pop in there. Thanks