Skip to content
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

extra-libraries: m fails due to missing system dependency #1128

Closed
ramirez7 opened this issue May 29, 2021 · 3 comments · Fixed by #1453
Closed

extra-libraries: m fails due to missing system dependency #1128

ramirez7 opened this issue May 29, 2021 · 3 comments · Fixed by #1453

Comments

@ramirez7
Copy link
Contributor

hgeometry-combinatorial has extra-libraries: m in its cabal file because it has a dependency on libm.

haskell.nix fails when trying to use hgeometry with:

error: The Nixpkgs package set does not contain the package: m (system dependency).

I believe libm is always implicitly present - it has no specific package in nixpkgs.

To work around this, I set m in my pkgs to be a no-op derivation with this overlay:

self: super:

{
  m = self.stdenv.mkDerivation {
    name = "m";
    unpackPhase = "true";
    installPhase = "mkdir -p $out";
  };
}

and that got things working fine.

Is there a better way to handle this? Or should I send this no-op derivation upstream to haskell.nix?

@ramirez7
Copy link
Contributor Author

Update re:x-compiling and libm:

When x-compiling to Windows (mingwW64), remote-iserv failed due to issues open files/creating directories with libm. I was able to get hgeometry x-compiling by tweaking my overlay to create lib and bin dirs:

self: super:

{
  m = self.stdenv.mkDerivation {
    name = "m";
    unpackPhase = "true";
    # We have to create lib and bin to make it "look like"
    # a library
    installPhase = ''
    mkdir -p $out/lib
    mkdir -p $out/bin
    '';
  };
}

@peterbecich
Copy link
Contributor

peterbecich commented Oct 31, 2021

I see this here, as well: google/codeworld#1523
on commit: https://github.com/peterbecich/codeworld/tree/b0febbd6325ec4f5d68bcd6cd22cf036ecc7abe9

% nix build -f default.nix
trace: No index state specified for haskell-project, using the latest index state that we know about (2021-10-31T00:00:00Z)!
...
error: The Nixpkgs package set does not contain the package: m (system dependency).
       You may need to augment the system package mapping in haskell.nix so that it can be found.

This project also uses hgeometry:
https://github.com/peterbecich/codeworld/blob/b0febbd6325ec4f5d68bcd6cd22cf036ecc7abe9/codeworld-available-pkgs/codeworld-available-pkgs.cabal#L466

@ramirez7
Copy link
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants