NixOS / nix

Nix, the purely functional package manager
https://nixos.org/
GNU Lesser General Public License v2.1
12.09k stars 1.47k forks source link

Error message "string '...' has a context which refers to a complete source and binary closure" makes no sense. #10651

Open YorikSar opened 4 months ago

YorikSar commented 4 months ago

Describe the bug

I wanted to check something and ran nix build nixpkgs#hello.drvPath. I got this error:

error:
       … while evaluating the flake output attribute 'legacyPackages.aarch64-darwin.hello.drvPath'

       error: string '/nix/store/wzgg4k9ll80qrcsmkgvrzdhmlbb4s00x-hello-2.12.1.drv' has a context which refers to a complete source and binary closure. This is not supported at this time

I know a bit about Nix, but I can't understand what "a complete source and binary closure" means. I bet people who are less experienced with Nix wouldn't understand what does string having a context mean as well. Neither of these notions are mentioned in the documentation and errors should not require documentation to be understood. This error message should be changed.

Steps To Reproduce

Run nix build nixpkgs#hello.drvPath.

Expected behavior

A clear and concise error explaining unmet conditions should be displayed.

nix-env --version output

nix-env (Nix) 2.21.1

Priorities

Add :+1: to issues you find important.

Ericson2314 commented 4 months ago

In a previous restriction we decided to just make the CLI accept these really weird string context items (that we wish didn't exist), but I have yet to do it. That would make that message go away (in this context, at least).

nixos-discourse commented 2 months ago

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/how-do-i-copy-a-derivation-and-all-its-build-dependencies-recursively-to-a-binary-cache/48232/1