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

haskell: Use propagatedUserEnvPkgs? #1230

Closed
bennofs opened this issue Nov 17, 2013 · 9 comments
Closed

haskell: Use propagatedUserEnvPkgs? #1230

bennofs opened this issue Nov 17, 2013 · 9 comments
Assignees

Comments

@bennofs
Copy link
Contributor

bennofs commented Nov 17, 2013

Currently, when installing haskell libraries via Nix, only the library itself is linked to /run/current-system/sw/lib/ghc-7.6.3/XXXX. This caused me some issues using cabal sandbox, where I had installed xmonad, but it's dependencies weren't found:

$ cabal sandbox hc-pkg check
There are problems in package xmonad-contrib-0.11.2:
  dependency "extensible-exceptions-0.1.1.4-255a395b3b026cb94b23754e1c372785" doesn't exist
  dependency "mtl-2.1.2-c30a4a0a7d1a23cc4865fe406853c0c7" doesn't exist
  dependency "random-1.0.1.1-65c5b451ba250a648d56ba8257d9c447" doesn't exist
  dependency "utf8-string-0.3.7-48b3501c4eec3ccc4938aa51dce03548" doesn't exist
There are problems in package xmonad-0.11:
  dependency "extensible-exceptions-0.1.1.4-255a395b3b026cb94b23754e1c372785" doesn't exist
  dependency "mtl-2.1.2-c30a4a0a7d1a23cc4865fe406853c0c7" doesn't exist
  dependency "utf8-string-0.3.7-48b3501c4eec3ccc4938aa51dce03548" doesn't exist
There are problems in package X11-xft-0.3.1:
  dependency "utf8-string-0.3.7-48b3501c4eec3ccc4938aa51dce03548" doesn't exist
There are problems in package X11-1.6.1.1:
  dependency "data-default-0.5.3-571b4c93f2c33191dde4f7b2f33babef" doesn't exist
There are problems in package xmonad-contrib-0.11.2:
  dependency "extensible-exceptions-0.1.1.4-255a395b3b026cb94b23754e1c372785" doesn't exist
  dependency "mtl-2.1.2-c30a4a0a7d1a23cc4865fe406853c0c7" doesn't exist
  dependency "random-1.0.1.1-65c5b451ba250a648d56ba8257d9c447" doesn't exist
  dependency "utf8-string-0.3.7-48b3501c4eec3ccc4938aa51dce03548" doesn't exist
There are problems in package xmonad-0.11:
  dependency "extensible-exceptions-0.1.1.4-255a395b3b026cb94b23754e1c372785" doesn't exist
  dependency "mtl-2.1.2-c30a4a0a7d1a23cc4865fe406853c0c7" doesn't exist
  dependency "utf8-string-0.3.7-48b3501c4eec3ccc4938aa51dce03548" doesn't exist
There are problems in package X11-xft-0.3.1:
  dependency "utf8-string-0.3.7-48b3501c4eec3ccc4938aa51dce03548" doesn't exist
There are problems in package X11-1.6.1.1:
  dependency "data-default-0.5.3-571b4c93f2c33191dde4f7b2f33babef" doesn't exist
There are problems in package xmonad-contrib-0.11.2:
  dependency "extensible-exceptions-0.1.1.4-255a395b3b026cb94b23754e1c372785" doesn't exist
  dependency "mtl-2.1.2-c30a4a0a7d1a23cc4865fe406853c0c7" doesn't exist
  dependency "random-1.0.1.1-65c5b451ba250a648d56ba8257d9c447" doesn't exist
  dependency "utf8-string-0.3.7-48b3501c4eec3ccc4938aa51dce03548" doesn't exist
There are problems in package xmonad-0.11:
  dependency "extensible-exceptions-0.1.1.4-255a395b3b026cb94b23754e1c372785" doesn't exist
  dependency "mtl-2.1.2-c30a4a0a7d1a23cc4865fe406853c0c7" doesn't exist
  dependency "utf8-string-0.3.7-48b3501c4eec3ccc4938aa51dce03548" doesn't exist
There are problems in package X11-xft-0.3.1:
  dependency "utf8-string-0.3.7-48b3501c4eec3ccc4938aa51dce03548" doesn't exist
There are problems in package X11-1.6.1.1:
  dependency "data-default-0.5.3-571b4c93f2c33191dde4f7b2f33babef" doesn't exist

The following packages are broken, either because they have a problem
listed above, or because they depend on a broken package.
xmonad-contrib-0.11.2
xmonad-0.11
X11-xft-0.3.1
X11-1.6.1.1
xmonad-contrib-0.11.2
xmonad-0.11
X11-xft-0.3.1
X11-1.6.1.1
xmonad-contrib-0.11.2
xmonad-0.11
X11-xft-0.3.1
X11-1.6.1.1

I think this could be solved by adding a propagatedUserEnvPkgs attribute in build-support/cabal/default.nix. But I'm not sure, is this the right solution? Or is there a better solution?

@peti
Copy link
Member

peti commented Nov 18, 2013

ghc-wapper does not know any packages except those that are installed into its profile. One could argue about whether this behavior is desirable or not, but it has been like this for a long time (several years), so I feel reluctant to change it.

The ghcWithPackages wrapper, on the other hand, has always picked up all dependencies and included them in the generated environment, i.e. the derivation

haskellPackages_ghc763.ghcWithPackages (hp: with hp; [xmonad]);

contains everything that's required to re-build xmonad.

@bennofs
Copy link
Contributor Author

bennofs commented Nov 18, 2013

So does that mean ghc-wrapper is useless if I do not install each dependency in systemPackages? Because when I don't, packages are broken?

@peti
Copy link
Member

peti commented Nov 18, 2013

Well, ghc-wrapper is certainly not useless, and it certainly doesn't install any broken packages. It just doesn't do what you expected it to. The wrapper provides a compiler that knows exactly those packages that are installed in the same profile it itself has been installed in. If that is not what you want, then you should probably use a different solution, such as the ghcWithPackages wrapper.

@ocharles
Copy link
Contributor

If ghc-wrapper can install libraries but leave them useless, then what is the value of it? Fwiw, I hit exactly the same problem of @bennofs - and I would argue that nix-env -iA haskellPackages.xmonadContrib should let me then do import XMonad.whatever. I shouldn't need to take more steps.

@peti
Copy link
Member

peti commented Nov 18, 2013

Personally, I don't feel strongly about this issue either way: I don't use ghc-wrapper myself.

If you guys think that the wrapper (or the cabal builder) should be changed, then by all means go ahead!

@vcunat
Copy link
Member

vcunat commented Nov 18, 2013

@peti: the behavior has changed recently. I use this for XMonad, too. Now it's unusable -- ghci -v shows things like

package xmonad-contrib-0.11.2-09669bf3fdc05c1c25061d671f0f8196 is unusable due to missing or recursive dependencies:
  X11-1.6.1.1-d39e13ed775eb7751e19696ca7bca0c3 X11-xft-0.3.1-5bebcc59cf33dad856b04fe44e366e9e extensible-exceptions-0.1.1.4-255a395b3b026cb94b23754e1c372785

@vcunat
Copy link
Member

vcunat commented Nov 18, 2013

What I completely fail to see is: what use a haskell module can be if its dependencies are missing?

@peti
Copy link
Member

peti commented Nov 18, 2013

@vcunat, if you guys want to change the wrapper or the Cabal builder to remedy this issue, then please do. I am all for it! All I care about is that the change doesn't break anything for users of ghcWithPackages. You are probably right that ghc-wrapper should pick up the dependencies automatically. ghcWithPackages does it this way, and it works fine.

@ghost ghost assigned nbp Jan 12, 2014
@peti
Copy link
Member

peti commented Jan 15, 2014

Solved by ebdff38.

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

No branches or pull requests

5 participants