NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.71k stars 13.85k forks source link

purescript failing to build #53597

Closed klntsky closed 5 years ago

klntsky commented 5 years ago

Issue description

CallStack (from HasCallStack):
  die', called at libraries/Cabal/Cabal/Distribution/Simple/Configure.hs:950:20 in Cabal-2.4.0.1:Distribution.Simple.Configure
  configureFinalizedPackage, called at libraries/Cabal/Cabal/Distribution/Simple/Configure.hs:460:12 in Cabal-2.4.0.1:Distribution.Simple.Configure
  configure, called at libraries/Cabal/Cabal/Distribution/Simple.hs:596:20 in Cabal-2.4.0.1:Distribution.Simple
  confHook, called at libraries/Cabal/Cabal/Distribution/Simple/UserHooks.hs:67:5 in Cabal-2.4.0.1:Distribution.Simple.UserHooks
  configureAction, called at libraries/Cabal/Cabal/Distribution/Simple.hs:178:19 in Cabal-2.4.0.1:Distribution.Simple
  defaultMainHelper, called at libraries/Cabal/Cabal/Distribution/Simple.hs:115:27 in Cabal-2.4.0.1:Distribution.Simple
  defaultMain, called at Setup.hs:6:8 in main:Main
Setup: Encountered missing dependencies:
aeson >=1.0 && <1.4, base >=4.8 && <4.12

Steps to reproduce

I've tried nix-build -A purescript -K on master, channels/nixpkgs-unstable and channels/nixos-18.09

Technical details

- system: `"x86_64-linux"`
 - host os: `Linux 4.14.91, NixOS, 18.09.1834.9d608a6f592 (Jellyfish)`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.1.3`
 - channels(me): `"home-manager-18.09"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
regellosigkeitsaxiom commented 5 years ago

The following shell.nix fails to build because of purescript for already a while, against various commits:

let
pkgs = import (builtins.fetchGit {
  name = "nixpkgs-for-hacking-with-purescript";
  url = https://github.com/NixOS/nixpkgs.git;
  rev = "6e3eee833d7df11a82a6119760a7b1379a0c3ffe";
}) {}; #Unstable-small. Released on 2019-01-08 12:29:58
f = { stdenv, nodejs, buildEnv }:
  stdenv.mkDerivation rec {
    name = "env";

    # Mandatory boilerplate for buildable env
    env = buildEnv { name = name; paths = buildInputs; };
    builder = builtins.toFile "builder.sh" ''
      source $stdenv/setup; ln -s $env $out
    '';

    # Customizable development requirements
    buildInputs = [
      pkgs.psc-package
      pkgs.purescript
      pkgs.nodePackages.pulp
    ];

};

in pkgs.callPackage f {}
regellosigkeitsaxiom commented 5 years ago

It seems purescript simply decayed in nixpkgs' snapshot of Haskell packages. It builds against commit 3516551316301523085a4d7b8bda517ba1706b73. As a workaround, it is possible to install it via overlay with pinned nixpkgs.

jacereda commented 5 years ago

I'll try to send a PR tomorrow.

klntsky commented 5 years ago

By the way, there is a separate unofficial repo containing purescript development tools, and it seems to be well maintained.

https://github.com/justinwoo/easy-purescript-nix

peti commented 5 years ago

Has anyone reported that issue upstream? It seems like the best solution to fix this issue is to get a new purescript release that actually supports recent versions of base and aeson. There are other outdated dependencies that should be fixed, too. According to http://packdeps.haskellers.com/feed?needle=exact:purescript:

image

hdgarrood commented 5 years ago

Hi @peti, purescript maintainer here. We do get occasional reports from nix users that it’s not available on nixpkgs because of the GHC version or library versions we’re using, but it just doesn’t make sense for us to devote maintenance time to keeping everything up to date. I’d prefer that Nixpkgs find a way to build against the dependencies specified by our stack.yaml rather than whatever happens to be in Nixpkgs.

peti commented 5 years ago

I’d prefer that Nixpkgs find a way to build against the dependencies specified by our stack.yaml rather than whatever happens to be in Nixpkgs.

@hdgarrood, it makes little sense for Nixpkgs to try and build packages in an environment other than Nixpkgs. It is no doubt possible to create a Nix expression that builds your package in an environment which you defined, but such a build is not going to make it into Nixpkgs itself. That would have to be user-supported build, e.g in the form of an overlay.