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

callCabal2nix is failing #24245

Closed
PierreR opened this issue Mar 23, 2017 · 9 comments
Closed

callCabal2nix is failing #24245

PierreR opened this issue Mar 23, 2017 · 9 comments

Comments

@PierreR
Copy link
Contributor

PierreR commented Mar 23, 2017

Issue description

haskell callCabal2nix is failing with :

error: string ‘/nix/store/3ibw2qzxknyjd30zlw0l5yikwla6yivr-language-puppet-22d8fb4ee0ad833ca2f0790e3c473e7e49424232-src’ cannot refer to other paths, at /home/vagrant/projects/cicd/nixpkgs/pkgs/development/haskell-modules/default.nix:92:25
(use ‘--show-trace’ to show detailed location information)

Steps to reproduce

Use this command line:
→ nix-shell release.nix -I nixpkgs=/home/vagrant/projects/cicd/nixpkgs

Using the following release.nix file:

with import <nixpkgs> { };
let
  language-puppet_git = pkgs.haskellPackages.callCabal2nix "language-puppet" (pkgs.fetchFromGitHub {
    owner  = "bartavelle";
    repo   = "language-puppet";
    rev    = "22d8fb4ee0ad833ca2f0790e3c473e7e49424232";
    sha256 = "1llzhf48r30qnanaay6r6mdvq4pw0ba200pl0pfagfg2kja54a9v";
  }) {};
  henv = pkgs.haskellPackages.ghcWithPackages (p: with p; [language-puppet_git ]);
in
pkgs.stdenv.mkDerivation {
  name = "build-env";
  buildInputs = [ henv ];
}

nixpkgs is pointing to the current master at c2b9b80

But I would guest it is failing from #23880

Technical details

  • System: nixos 17.03beta582.1e8c017
  • Nix version: nix-env (Nix) 1.11.8
  • Nixpkgs version: already failing in:
{
  "url": "https://github.com/NixOS/nixpkgs.git",
  "rev": "fff8cc79df5aa26e935f8ee30c06ef79368ad5dc",
  "date": "2017-03-20T19:03:20+01:00",
  "sha256": "0jlnx75zri3gblzxb0jibllqclki0ykwn8d9zsp5p8yzyvn70j44",
  "fetchSubmodules": true
}
@globin
Copy link
Member

globin commented Mar 23, 2017

cc @peti

@PierreR
Copy link
Contributor Author

PierreR commented Mar 24, 2017

@ElvishJerricco @3noch Using git bisect I can confirm that the issue is related to:

→ git bisect bad 
24b47526ce38e3ccb073c776b32c0ea220f3c0f2 is the first bad commit
commit 24b47526ce38e3ccb073c776b32c0ea220f3c0f2
Author: Will Fancher <elvishjerricco@gmail.com>
Date:   Mon Mar 13 22:17:29 2017 -0400

    callCabal2nix: Don't rebuild unchanged cabal file
    
    It can be quite annoying that callCabal2nix will build a new derivation
    if anything in the source has changed, even if the cabal file hasn't.

@domenkozar
Copy link
Member

afaik it happens if you pass a string instead of a path to builtins.filterSource, but here it appears to be a path returned by fetchFromGitHub? Confusing.

@PierreR
Copy link
Contributor Author

PierreR commented Mar 24, 2017

@domenkozar I have just experienced another anomalie that might be related (?)

If I try to use language-puppet_1_3_7 from hackage-packages.nix, it will work when using:

with import (fetchTarball https://github.com/NixOS/nixpkgs/archive/fff8cc79df5aa26e935f8ee30c06ef79368ad5dc.tar.gz) {};

let
  hpkgs = pkgs.haskellPackages;
  henv = hpkgs.ghcWithPackages (p: with p; [shake language-puppet_1_3_7 foldl]);
in
stdenv.mkDerivation {
  name = "build-env";
  buildInputs = [ henv puppet-env];
}

but when I use fetchFromGitHub instead :

let
  _pkgs = import <nixpkgs> { };
  src = _pkgs.fetchFromGitHub {
    owner = "NixOS";
    repo  = "nixpkgs";
    rev   = "fff8cc79df5aa26e935f8ee30c06ef79368ad5dc";
    sha256 = "0jlnx75zri3gblzxb0jibllqclki0ykwn8d9zsp5p8yzyvn70j44";
  };

  pkgs = import src { };
  hpkgs = pkgs.haskellPackages;
  henv = hpkgs.ghcWithPackages (p: with p; [shake language-puppet_1_3_7 foldl]);
in
pkgs.stdenv.mkDerivation {
  name = "build-env";
  buildInputs = [ henv];
}

then I goes forever doing

trying http://hackage.haskell.org/package/language-puppet-1.3.7.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:--  0:06:42 --:--:--     0^Cerror: interrupted by the user

The hackage link from the hackage web site is actually
http://hackage.haskell.org/package/language-puppet-1.3.7/language-puppet-1.3.7.tar.gz (and it does work)
If this is another bug I will open a new issue.

peti added a commit that referenced this issue Mar 27, 2017
This reverts commit 24b4752 since it broke
callCabal2nix, apparently. See #24245
for details.
@peti
Copy link
Member

peti commented Mar 27, 2017

I reverted #23880 in 50cce50 to un-break the function.

@domenkozar
Copy link
Member

@shlevy is this addressed by NixOS/nix#1358?

@peti
Copy link
Member

peti commented Apr 28, 2017

I suppose we can close this issue? @PierreR?

@shlevy
Copy link
Member

shlevy commented Apr 28, 2017

@domenkozar No, the error you get in that case is different, something about a bad archive format.

@domenkozar
Copy link
Member

I'm closing this as issue has been fixed.

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

No branches or pull requests

5 participants