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

nix-env -i haskell-haskell-platform-ghc7.6.1-2012.2.0.0 # assertion failed #56

Closed
skull-squadron opened this issue Sep 25, 2012 · 11 comments

Comments

@skull-squadron
Copy link

[root@freebsd ~]# nix-env -i haskell-haskell-platform-ghc7.6.1-2012.2.0.0
installing `haskell-haskell-platform-ghc7.6.1-2012.2.0.0'
error: assertion failed at `/nix/store/rcwjawql0ck2nbrnpkqgrgxjm2k42z3q-nixpkgs-1.0pre21403_def0189/nixpkgs/pkgs/development/compilers/ghc/7.0.4-binary.nix:7:1'
(use `--show-trace' to show detailed location information)
[root@freebsd ~]# nix-env -i haskell-haskell-platform-ghc7.6.1-2012.2.0.0 --show-trace
installing `haskell-haskell-platform-ghc7.6.1-2012.2.0.0'
error: while evaluating the builtin function `derivationStrict':
while instantiating the derivation named `haskell-haskell-platform-ghc7.6.1-2012.2.0.0' at `/nix/store/rcwjawql0ck2nbrnpkqgrgxjm2k42z3q-nixpkgs-1.0pre21403_def0189/nixpkgs/pkgs/build-support/cabal/default.nix:36:13':
while evaluating the derivation attribute `buildNativeInputs' at `/nix/store/rcwjawql0ck2nbrnpkqgrgxjm2k42z3q-nixpkgs-1.0pre21403_def0189/nixpkgs/pkgs/stdenv/generic/default.nix:67:15':
while evaluating the builtin function `getAttr':
while evaluating the builtin function `derivationStrict':
while instantiating the derivation named `ghc-7.6.1-wrapper' at `/nix/store/rcwjawql0ck2nbrnpkqgrgxjm2k42z3q-nixpkgs-1.0pre21403_def0189/nixpkgs/pkgs/development/compilers/ghc/wrapper.nix:8:3':
while evaluating the derivation attribute `propagatedBuildNativeInputs' at `/nix/store/rcwjawql0ck2nbrnpkqgrgxjm2k42z3q-nixpkgs-1.0pre21403_def0189/nixpkgs/pkgs/stdenv/generic/default.nix:69:15':
while evaluating the builtin function `getAttr':
while evaluating the builtin function `derivationStrict':
while instantiating the derivation named `ghc-7.6.1' at `/nix/store/rcwjawql0ck2nbrnpkqgrgxjm2k42z3q-nixpkgs-1.0pre21403_def0189/nixpkgs/pkgs/development/compilers/ghc/7.6.1.nix:6:3':
while evaluating the derivation attribute `buildNativeInputs' at `/nix/store/rcwjawql0ck2nbrnpkqgrgxjm2k42z3q-nixpkgs-1.0pre21403_def0189/nixpkgs/pkgs/stdenv/generic/default.nix:67:15':
while evaluating the function at `/nix/store/rcwjawql0ck2nbrnpkqgrgxjm2k42z3q-nixpkgs-1.0pre21403_def0189/nixpkgs/pkgs/lib/meta.nix:41:13':
while evaluating the function at `/nix/store/rcwjawql0ck2nbrnpkqgrgxjm2k42z3q-nixpkgs-1.0pre21403_def0189/nixpkgs/pkgs/lib/meta.nix:13:28':
while evaluating the function at `/nix/store/rcwjawql0ck2nbrnpkqgrgxjm2k42z3q-nixpkgs-1.0pre21403_def0189/nixpkgs/pkgs/lib/customisation.nix:98:35':
while evaluating the function at `/nix/store/rcwjawql0ck2nbrnpkqgrgxjm2k42z3q-nixpkgs-1.0pre21403_def0189/nixpkgs/pkgs/lib/customisation.nix:59:24':
while evaluating the builtin function `isAttrs':
while evaluating the function at `/nix/store/rcwjawql0ck2nbrnpkqgrgxjm2k42z3q-nixpkgs-1.0pre21403_def0189/nixpkgs/pkgs/development/compilers/ghc/7.0.4-binary.nix:1:1':
assertion failed at `/nix/store/rcwjawql0ck2nbrnpkqgrgxjm2k42z3q-nixpkgs-1.0pre21403_def0189/nixpkgs/pkgs/development/compilers/ghc/7.0.4-binary.nix:7:1'
@skull-squadron
Copy link
Author

let
  supportedPlatforms = ["x86_64-linux" "i686-linux" "i686-darwin" "x86_64-darwin"];
in

assert stdenv.lib.elem stdenv.system supportedPlatforms;

@skull-squadron
Copy link
Author

What is obvious to you or I would not be obvious to an end-user.

@peti
Copy link
Member

peti commented Sep 25, 2012

@steakknife, what do you suggest we do?

@skull-squadron
Copy link
Author

Is there syntax semantics to decorate an assertion with a failure message?

@peti
Copy link
Member

peti commented Sep 25, 2012

There is 'throw', which does supply an error message. It's my understanding, though, that assert and throw differ in their laziness, i.e. it is in general not possible to replace assert with throw and to expect the same outcome. I'm not sure whether that would cause problems in our particular use case. @kosmikus should know?

@kosmikus
Copy link
Member

I have no idea. We'd have to try.

@edolstra
Copy link
Member

"throw" behaves in the same way as "assert" except for the error message. You may be thinking of "abort", which cannot be caught by tryEval.

@peti
Copy link
Member

peti commented Sep 30, 2012

Unfortunately, throw cannot easily replace assert in ghc-7.4.2-binary.nix and friends. At least I don't see how without changing the structure of that expression quite a bit. Am I missing something?

What is the point of that assertion anyway? Isn't the throw statement in the srcattribute good enough?

@kosmikus
Copy link
Member

kosmikus commented Oct 4, 2012

I think the throw is good enough.

@peti
Copy link
Member

peti commented Oct 12, 2012

Commit b1169e5 removes the call to assert. I guess that change fixes this issue?

chexxor pushed a commit to chexxor/nixos-configurations that referenced this issue Nov 6, 2013
Any attempt to instantiate these expressions on an unsupported platform is
going to 'throw' an error. The call to 'assert' doesn't add any value to
that (and generates less readable error messages, too). Further details are
available at <NixOS/nix#56>.
@edolstra
Copy link
Member

Closing, appears to be fixed (and in any case not a Nix issue).

meditans pushed a commit to Ericson2314/nix that referenced this issue Aug 28, 2020
Add types for IPFSHash in references
zolodev pushed a commit to zolodev/nix that referenced this issue Jan 1, 2024
Edits for reproducibility tutorial
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

4 participants