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

ghcjs (head): Fix infinite recursion ... #24510

Merged
merged 1 commit into from Apr 5, 2017
Merged

ghcjs (head): Fix infinite recursion ... #24510

merged 1 commit into from Apr 5, 2017

Conversation

woehr
Copy link
Contributor

@woehr woehr commented Mar 31, 2017

... in hscolour when building packages.

Motivation for this change

Haskell packages won't build under ghcjsHEAD.

Using the following default.nix:

{ nixpkgs ? import ../../nixpkgs {}, compiler ? "ghcjsHEAD" }:
let f = { mkDerivation, base, stdenv }:
  mkDerivation {
    pname = "some-pkg";
    version = "0.0.1";
    src = ./.;
    isLibrary = true;
    isExecutable = true;
    libraryHaskellDepends = [ base ];
    executableHaskellDepends = [ base ];
    license = stdenv.lib.licenses.mit;
  };
in {
  some-pkg = nixpkgs.haskell.packages.${compiler}.callPackage f {};
}

the build fails with:

error: while evaluating the attribute ‘nativeBuildInputs’ of the derivation ‘some-pkg-0.0.1’ at /home/jordan/repos/nixpkgs/pkgs/development/haskell-modules/generic-builder.nix:173:3:
while evaluating the attribute ‘setupCompilerEnvironmentPhase’ of the derivation ‘Cabal-1.24.0.0’ at /home/jordan/repos/nixpkgs/pkgs/development/haskell-modules/generic-builder.nix:173:3:
while evaluating ‘optionalString’ at /home/jordan/repos/nixpkgs/lib/strings.nix:138:26, called from /home/jordan/repos/nixpkgs/pkgs/development/haskell-modules/generic-builder.nix:205:7:
while evaluating the attribute ‘nativeBuildInputs’ of the derivation ‘hscolour-1.24.1’ at /home/jordan/repos/nixpkgs/pkgs/development/haskell-modules/generic-builder.nix:173:3:
infinite recursion encountered, at undefined position

when built with the following command:

nix-build -A some-pkg --show-trace
Things done
  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

... in hscolour when building packages.
@mention-bot
Copy link

@woehr, thanks for your PR! By analyzing the history of the files in this pull request, we identified @TravisWhitaker and @basvandijk to be potential reviewers.

@TravisWhitaker
Copy link
Contributor

Thanks, looks good to me.

@ljli
Copy link
Contributor

ljli commented Apr 3, 2017

This is correct and necessary. I have this locally and it should have been part of #23614, but it slipped by when I put the PR together.
cc @peti

@peti peti merged commit 4ad28de into NixOS:master Apr 5, 2017
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 this pull request may close these issues.

None yet

5 participants