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

cabal-helper 0.8.0.2 miss dependencies in nixos #45515

Closed
YuMingLiao opened this issue Aug 23, 2018 · 6 comments
Closed

cabal-helper 0.8.0.2 miss dependencies in nixos #45515

YuMingLiao opened this issue Aug 23, 2018 · 6 comments

Comments

@YuMingLiao
Copy link

YuMingLiao commented Aug 23, 2018

Issue description

Hi, I was trying to install cabal-helper, using channel nixos-unstable and nix-shell. And error happens:
these derivations will be built:

  /nix/store/6lf07ww2670mq85q59kbmkj1hqjrd8im-cabal-helper-0.8.0.2.drv
  /nix/store/l9zyy5gwlvh5wvgn8i80pbwbp4grpbka-ghc-8.4.3-with-packages.drv
building '/nix/store/6lf07ww2670mq85q59kbmkj1hqjrd8im-cabal-helper-0.8.0.2.drv'...
setupCompilerEnvironmentPhase
Build with /nix/store/yc8an71h8cah8w6fw0xykjxl68a8j1h7-ghc-8.4.3.
ignoring (possibly broken) abi-depends field for packages
ignoring (possibly broken) abi-depends field for packages
unpacking sources
unpacking source archive /nix/store/27g5a92f4s32mif60j426gd663iyrqvx-cabal-helper-0.8.0.2.tar.gz
source root is cabal-helper-0.8.0.2
setting SOURCE_DATE_EPOCH to timestamp 1518192504 of file cabal-helper-0.8.0.2/tests/UnitTests.hs
patching sources
Replace Cabal file with edited version from http://hackage.haskell.org/package/cabal-helper-0.8.0.2/revision/1.cabal.
compileBuildDriverPhase
setupCompileFlags: -package-db=/tmp/nix-build-cabal-helper-0.8.0.2.drv-0/setup-package.conf.d -j1 -threaded
[1 of 1] Compiling Main             ( Setup.hs, /tmp/nix-build-cabal-helper-0.8.0.2.drv-0/Main.o )
Linking Setup ...
configuring
configureFlags: --verbose --prefix=/nix/store/1f0612gn5apjs3m5vfcl12yssx5q9x11-cabal-helper-0.8.0.2 --libdir=$prefix/lib/$compiler --libsubdir=$pkgid --docdir=/nix/store/icpsmz8zcdgjciraa4i45gvr841isk95-cabal-helper-0.8.0.2-doc/share/doc/cabal-helper-0.8.0.2 --with-gcc=gcc --package-db=/tmp/nix-build-cabal-helper-0.8.0.2.drv-0/package.conf.d --ghc-option=-j1 --disable-split-objs --enable-library-profiling --profiling-detail=all-functions --disable-profiling --enable-shared --disable-coverage --enable-static --disable-executable-dynamic --disable-tests --enable-library-vanilla --enable-library-for-ghci --ghc-option=-split-sections --extra-lib-dirs=/nix/store/3cnh0n698w18l5g933wrx22zvkhcj8ik-ncurses-6.1/lib --extra-lib-dirs=/nix/store/bi9nx8f8kl8apgd544hkx2dsvlvr4zix-gmp-6.1.2/lib
Using Parsec parser
Warning: cabal-helper.cabal:125:3: The field "scope" is available since Cabal
[2,0]
Configuring cabal-helper-0.8.0.2...
CallStack (from HasCallStack):
  die', called at ./Distribution/Simple/Configure.hs:958:20 in Cabal-2.2.0.1-302vnEvwKgd3FEKLIV6HbI:Distribution.Simple.Configure
  configureFinalizedPackage, called at ./Distribution/Simple/Configure.hs:462:12 in Cabal-2.2.0.1-302vnEvwKgd3FEKLIV6HbI:Distribution.Simple.Configure
  configure, called at ./Distribution/Simple.hs:596:20 in Cabal-2.2.0.1-302vnEvwKgd3FEKLIV6HbI:Distribution.Simple
  confHook, called at ./Distribution/Simple/UserHooks.hs:67:5 in Cabal-2.2.0.1-302vnEvwKgd3FEKLIV6HbI:Distribution.Simple.UserHooks
  configureAction, called at ./Distribution/Simple.hs:178:19 in Cabal-2.2.0.1-302vnEvwKgd3FEKLIV6HbI:Distribution.Simple
  defaultMainHelper, called at ./Distribution/Simple.hs:115:27 in Cabal-2.2.0.1-302vnEvwKgd3FEKLIV6HbI:Distribution.Simple
  defaultMain, called at Setup.hs:11:8 in main:Main
Setup: Encountered missing dependencies:
Cabal >=1.14 && <1.26 || ==2.0.*,
template-haskell >=2.7.0.0 && <2.13,
temporary >=1.2.0.4 && <1.3

builder for '/nix/store/6lf07ww2670mq85q59kbmkj1hqjrd8im-cabal-helper-0.8.0.2.drv' failed with exit code 1
cannot build derivation '/nix/store/l9zyy5gwlvh5wvgn8i80pbwbp4grpbka-ghc-8.4.3-with-packages.drv': 1 dependencies couldn't be built
error: build of '/nix/store/l9zyy5gwlvh5wvgn8i80pbwbp4grpbka-ghc-8.4.3-with-packages.drv' failed

And the package author has confirmed that

the dependencies are declared in cabal-helper.cabal correctly but Setup.hs can't find them so they didn't get installed by Nix for some reason.

Steps to reproduce

nix-shell -p "haskell.packages.ghc843.ghcWithPackages (pkgs: with pkgs; [cabal-helper])" -p z3

Technical details

these paths will be fetched (0.00 MiB download, 0.00 MiB unpacked):
  /nix/store/m2mwfr63zh28wxy6zzmgns4vhjmyw0p1-nix-info
copying path '/nix/store/m2mwfr63zh28wxy6zzmgns4vhjmyw0p1-nix-info' from 'https://cache.nixos.org'...
 - system: `"x86_64-linux"`
 - host os: `Linux 4.14.54, NixOS, 18.09pre145679.dae9cf6106d (Jellyfish)`
 - multi-user?: `yes`
 - sandbox: `no`
 - version: `nix-env (Nix) 2.0.4`
 - channels(root): `"nixos-18.09pre147850.2428f5dda13"`
 - channels(demo): `"nixos, nixpkgs-17.09.3263.9e1d8b74706"`
 - channels(ted): `"nixos-18.09pre149415.8395f9aa85e"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
@YuMingLiao YuMingLiao changed the title https://github.com/DanielG/cabal-helper/issues/57 cabal-helper 0.8.0.2 miss dependencies in nixos Aug 23, 2018
@mpickering
Copy link
Contributor

What about cabal-helper-0.8.1.2 which has at least a relaxed bound on Cabal.

@YuMingLiao
Copy link
Author

Hi @mpickering Thx for suggestion.

Right now, Cabal-helper in nixos-unstable is 0.8.0.2.
Hackage says it's 0.8.1.0, but
Hydra says the failure starts from 2018-05-23 cabal-helper-0.8.0.2.

That's what I know now.

Or is there any way to update the latest cabal-helper to nixos-channel?

@mpickering
Copy link
Contributor

Like any normal Haskell package, you have to override the cabal-helper attribute.

let 
  nixpkgs = import <nixpkgs> {};
  extension = self: super: { cabal-helper = self.callHackage "cabal-helper" "0.8.1.0" {}; };
  hp = nixpkgs.haskellPackages.extend(extension);
in
  hp.cabal-helper

@YuMingLiao
Copy link
Author

Thanks for the tip! @mpickering
I'll conquer nix expression...some day!

I guess it's not an issue in nixos, either. So I close it.

@YuMingLiao
Copy link
Author

I can get cabal-helper-0.8.0.2 by this method.

[nix-shell:~/test/haskell-nix/project0]$ ghc-pkg list | grep cabal-helper
    cabal-helper-0.8.0.2

But I can't have it from 0.8.1.0 and the above.

building '/nix/store/jdsq5ggrjpd2pzjq0405npcr3z5klkmy-all-cabal-hashes-component-cabal-helper-0.8.1.0.drv'...
tar: */cabal-helper/0.8.1.0/cabal-helper.json: Not found in archive
tar: */cabal-helper/0.8.1.0/cabal-helper.cabal: Not found in archive
tar: Exiting with failure status due to previous errors
builder for '/nix/store/jdsq5ggrjpd2pzjq0405npcr3z5klkmy-all-cabal-hashes-component-cabal-helper-0.8.1.0.drv' failed with exit code 2
cannot build derivation '/nix/store/5y0q9095n32jfdpkvq10m37a8qr5yb79-cabal2nix-cabal-helper-0.8.1.0.drv': 1 dependencies couldn't be built
error: build of '/nix/store/5y0q9095n32jfdpkvq10m37a8qr5yb79-cabal2nix-cabal-helper-0.8.1.0.drv' failed
(use '--show-trace' to show detailed location information)

@YuMingLiao
Copy link
Author

I've git clone the latest cabal-helper-0.8.1.2 and loose the upper bound of temporary. (In nixos-unstable, temporary is 1.3.0.0. And it compiles successfully.

Nowever, in nixos-unstable, the cabal-helper is 0.8.1.0.

I don't know why nixos-unstable doesn't have the lastest cabal-helper even I did nix-channel --update . Is there anyway to update cabal-helper to nixos-unstable?

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

3 participants