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

No store path created when one (recursive-)fixed-output-derivation references another #7148

Open
nagy opened this issue Oct 8, 2022 · 0 comments
Labels

Comments

@nagy
Copy link
Member

nagy commented Oct 8, 2022

Describe the bug

When referencing one fixed-output-derivation whithin another, the resulting store path is not created and no error is printed.

Steps To Reproduce
Run nix-build on this file:

with import <nixpkgs> { };
runCommandLocal "name" {
  outputHashMode = "recursive";
  outputHash = "sha256-dUgGNFqVR0sCLzjDNAvfJJegR95Zpg/r+6i32P5/TlM=";
} ''
  mkdir $out
  echo ${emptyFile} > $out/somefile
''

The output would be

this derivation will be built:
  /nix/store/hcdh67622vpp9lwc9y6camyh0lbijpi9-name.drv
building '/nix/store/hcdh67622vpp9lwc9y6camyh0lbijpi9-name.drv'...
/nix/store/l1qz2gphlwmldkmgakzk581mhm0g0g5k-name

and the result symlink is created, but the underlying store path does not exist.

Expected behavior

A result stored in the nix-store.

nix-env --version output

nix-env (Nix) 2.11.0

Additional context

I have seen #5509 , but it may not be the same as that one seems to relate to self-reference.

One more thing: If specify the output to be a flat file instead of a directory, like so:

with import <nixpkgs> { };
runCommandLocal "name" {
  outputHashMode = "flat";
  outputHash = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=";
} ''
  echo ${emptyFile} > $out
''

I get:

$ nix-build
this derivation will be built:
  /nix/store/xcbn6gpxj8rqyc7sqancfj0913am6z7v-name.drv
building '/nix/store/xcbn6gpxj8rqyc7sqancfj0913am6z7v-name.drv'...
error: unexpected end-of-file

I think these two issues are related, but if not, I can file a separate one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant