Assertion failure maybeOutputPath #388

Open
opened 2024-06-11 05:57:45 +00:00 by irenes · 3 comments
Owner

Describe the bug

Building a specific derivation (provided) which uses the impure-derivations experimental feature causes the maybeOutputPath assertion to fail, only with nix-build and not with nix build.

Steps To Reproduce

  1. Prepare an environment where the impure-derivations experimental feature is turned on. It's possible you may also need ca-derivations.
  2. Create a file minimal.nix with the contents below.
  3. Invoke nix-build minimal.nix.
  4. Observe the error message.
{ pkgs ? import <nixpkgs> { },
  stdenv ? pkgs.stdenv,
  ... }:

stdenv.mkDerivation { 
  name = "foo";
  args = [ "-c" "echo > $out" ];
  __impure = true;
}

Expected behavior

I expected the derivation to build successfully.

nix --version output

nix (Lix, like Nix) 2.90.0-lixpre20240527-0b91a4b

Additional context

There's nothing special about the use of args, as far as I'm aware. It's just a shortcut to create a derivation that does very little, but should succeed; it's also used in the lix manual's example for impure-derivations.

## Describe the bug Building a specific derivation (provided) which uses the impure-derivations experimental feature causes the maybeOutputPath assertion to fail, only with `nix-build` and not with `nix build`. ## Steps To Reproduce 1. Prepare an environment where the `impure-derivations` experimental feature is turned on. It's possible you may also need `ca-derivations`. 2. Create a file `minimal.nix` with the contents below. 3. Invoke `nix-build minimal.nix`. 4. Observe the error message. ``` { pkgs ? import <nixpkgs> { }, stdenv ? pkgs.stdenv, ... }: stdenv.mkDerivation { name = "foo"; args = [ "-c" "echo > $out" ]; __impure = true; } ``` ## Expected behavior I expected the derivation to build successfully. ## `nix --version` output nix (Lix, like Nix) 2.90.0-lixpre20240527-0b91a4b ## Additional context There's nothing special about the use of args, as far as I'm aware. It's just a shortcut to create a derivation that does very little, but should succeed; it's also used in the lix manual's example for impure-derivations.
irenes added the
bug
label 2024-06-11 05:57:45 +00:00
Author
Owner

ah oops, here's the error message

fetching path input 'path:/nix/store/f6lbic2a83c51ygb2czksw9gv8x6w5wg-source'
this derivation will be built:
  /nix/store/i4zd0iz237yjjkk1glqcxv0c32jpavb8-foo.drv
resolved derivation: '/nix/store/i4zd0iz237yjjkk1glqcxv0c32jpavb8-foo.drv' -> '/nix/store/6xlqcl4sr7drxcs5kvnvlfq2g017y4y8-foo.drv'...
building '/nix/store/6xlqcl4sr7drxcs5kvnvlfq2g017y4y8-foo.drv'...
nix-build: src/nix-build/nix-build.cc:598: void main_nix_build(int, char**): Assertion `maybeOutputPath' failed.
Aborted (core dumped)
ah oops, here's the error message ``` fetching path input 'path:/nix/store/f6lbic2a83c51ygb2czksw9gv8x6w5wg-source' this derivation will be built: /nix/store/i4zd0iz237yjjkk1glqcxv0c32jpavb8-foo.drv resolved derivation: '/nix/store/i4zd0iz237yjjkk1glqcxv0c32jpavb8-foo.drv' -> '/nix/store/6xlqcl4sr7drxcs5kvnvlfq2g017y4y8-foo.drv'... building '/nix/store/6xlqcl4sr7drxcs5kvnvlfq2g017y4y8-foo.drv'... nix-build: src/nix-build/nix-build.cc:598: void main_nix_build(int, char**): Assertion `maybeOutputPath' failed. Aborted (core dumped) ```
Owner

Intriguing that this throws the assert on the client side.

Intriguing that this throws the assert on the client side.
Author
Owner

oh, fascinating

oh, fascinating
jade added the
E/reproducible
E/help wanted
labels 2024-06-24 22:41:50 +00:00
jade added the
crash 💥
label 2024-11-10 02:20:22 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: lix-project/lix#388
No description provided.