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

cabal2nix install failure #30

Closed
Davorak opened this issue Jul 2, 2012 · 7 comments
Closed

cabal2nix install failure #30

Davorak opened this issue Jul 2, 2012 · 7 comments

Comments

@Davorak
Copy link
Contributor

Davorak commented Jul 2, 2012

Mac OS X Lion 10.7.4
nix 1.0 binary install
nixpkgs: 823f7d0

$ nix-env -i cabal2nix
error: assertion failed at `/Users/<user>/code/nixpkgs/pkgs/development/compilers/ghc/6.10.1-binary.nix:7:1'
(use `--show-trace' to show detailed location information)

Adding "x86_64-darwin" to the list of supportedPlatforms in ../compilers/ghc/6.10.1-binary.nix allows cabal2nix to install.

How could ghc 6.10.1 binary be causing a problem with cabal2nix? I am currently using ghc-7.4.1-wrapper.

@shlevy
Copy link
Member

shlevy commented Jul 2, 2012

@peti: Any idea here?

@kosmikus
Copy link
Member

kosmikus commented Jul 2, 2012

I'm a bit puzzled here. It looks like the assertion is triggered simply because the name-matching tries to evaluate the meta-information of that file, and the platform check fails. However, similar patterns are used all over the place. How would this assertion-check be different from the assertion check in, say, opera?

Two questions: (1) if you install via -iA, does the error go away? (2) does ghc-6.10.1-binary actually get installed on your system as a part of installing cabal2nix?

@Davorak
Copy link
Contributor Author

Davorak commented Jul 2, 2012

It does install with -iA and ghc-6.10.1-binary does not get installed.

In addition an error in 6.10.1-binary.nix being triggered while evaluating ghc.meta.platforms in 6.10.4.nix surprised me:

practice:~ $ nix-env -i cabal2nix --show-trace
error: while evaluating the attribute `ghc.meta.platforms' at
`/Users/<>/code/nixpkgs/pkgs/development/compilers/ghc/6.10.4.nix:26:5':
while evaluating the function at `/Users/<>/code/nixpkgs/pkgs/lib/meta.nix:41:13':
while evaluating the function at `/Users/<>/code/nixpkgs/pkgs/lib/meta.nix:13:28':
while evaluating the function at `/Users/<>/code/nixpkgs/pkgs/lib/customisation.nix:98:35':
while evaluating the function at `/Users/<>/code/nixpkgs/pkgs/lib/customisation.nix:59:24':
while evaluating the builtin function `isAttrs':
while evaluating the function at `/Users/<>/code/nixpkgs/pkgs/development/compilers/ghc/6.10.1-binary.nix:1:1':
assertion failed at `/Users/<>/code/nixpkgs/pkgs/development/compilers/ghc/6.10.1-binary.nix:7:1'

@shlevy
Copy link
Member

shlevy commented Jul 2, 2012

I think I see the problem. If a derivation's name attribute can be evaluated without an assertion failing but any of the meta attributes cause a failed assertion during evaluation, this issue will occur. So the problem isn't directly the assertion in 6.10.1-binary.nix, but the fact that meta.platforms in 6.10.4.nix and 6.12.3.nix is set to ghc.meta.platforms, where ghc is presumably 6.10.1-binary.nix.

I see two solutions we can implement right away: move the common meta information outside of the assertion and the binary and final derivations reference that same place, or build these versions of ghc with a binary that works on all platforms(which is not a good solution IMO)

Additionally, it's possible some change to nix could ameliorate this, but I'd have to investigate exactly where the AssertionError is being thrown and why. @kosmikus are either of the two solutions above palatable?

@shlevy
Copy link
Member

shlevy commented Jul 2, 2012

Ok, traced the problem to https://github.com/NixOS/nix/blob/master/src/nix-env/nix-env.cc#L194 . Basically, due to lack of laziness in GetDrvs.cc all of meta gets evaluated to evaluate meta.priority. So I see three solutions in nix itself: a) Make queryMetaInfo more lazy (already implemented as part of PR 31 on nix), so that only if meta.priority tripped a failed assertion would this issue occur, b) handle the AssertionError in queryMetaInfo (presumably just not adding that attribute to the set), or c) handle the AssertionError in getPriority (presumably acting as if the meta attribute weren't set). @edolstra: Thoughts?

@peti
Copy link
Member

peti commented Aug 6, 2012

@edolstra, do you have an idea how to remedy this issue?

ecarreras pushed a commit to ecarreras/nixpkgs that referenced this issue Oct 1, 2012
@aristidb
Copy link
Contributor

Can this issue be closed for obsolescence? cabal2nix does now build on OS X, albeit not with GHC 6.10, which isn't supported anymore.

@peti peti closed this as completed Jan 21, 2013
ethancedwards8 pushed a commit to ethancedwards8/nixpkgs that referenced this issue Apr 2, 2021
qjcg added a commit to qjcg/nixpkgs that referenced this issue Jul 23, 2021
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