Skip to content

nix-prefetch-url -A wants to unpack everything where executable=true  #1514

@4z3

Description

@4z3

When the argument to fetchurl defines executable = true, then outputModeHash gets set to "recursive". This causes nix-prefetch-url to want to unpack the downloaded file. Other tools, like nix-build, aren't affected by this issue.

Example

Lets assume we add/overlay following package:

{ fetchurl }:
fetchurl {
  url = "https://nixos.org/releases/nix/nix-1.11.13/manual.pdf";
  sha256 = "0g8pdb900b3mbq3wxy855qfwggcq6njv48g9fiq0jikbnbdmgclv";
  executable = true;
} 

Prefetching it will then fail as follows:

$ nix-prefetch-url -A pkgs.derp
downloading ‘https://nixos.org/releases/nix/nix-1.11.13/manual.pdf’... [0/0 KiB, 0.0 KiB/s]
unpacking...
tar: This does not look like a tar archive
tar: Skipping to next header
tar: Exiting with failure status due to previous errors
error: program ‘tar’ failed with exit code 2

With executable = true removed, everything works as expected.

Metadata

Metadata

Assignees

Labels

UXThe way in which users interact with Nix. Higher level than UI.cliThe old and/or new command line interface

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions