Skip to content

fetchzip: respect the name argument #10539

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

Closed
wants to merge 1 commit into from

Conversation

kirelagin
Copy link
Member

This is a respin of #8795.

Without this `fetchzip` breaks if `url` doesn’t end with `zip`,
even if proper `name` was given.
@bjornfor
Copy link
Contributor

Apart from the missing 'rec' to bring 'name' into scope (see travis-ci), I think this actually causes a regression :-(

For example, try adding a character to the attic fetchurl name argument (to force rebuild). Then observe:

$ nix-build -A attic.src
these derivations will be built:
  /nix/store/3p3bn08hw55zizkibpx7y9sdxwrfbymv-attic-0.16-src2.drv
building path(s) ‘/nix/store/nig234fc7nf1lz0i2bnk8rnzfqbjabm5-attic-0.16-src2’

trying https://github.com/jborg/attic/archive/0.16.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   117    0   117    0     0    190      0 --:--:-- --:--:-- --:--:--   208
100 87985    0 87985    0     0  51791      0 --:--:--  0:00:01 --:--:--  111k
unpacking source archive /tmp/nix-build-attic-0.16-src2.drv-0/attic-0.16-src2
do not know how to unpack source archive /tmp/nix-build-attic-0.16-src2.drv-0/attic-0.16-src2

@bjornfor
Copy link
Contributor

Well, I could of course have given the package in question a name which ends in "zip", but in the case of fetchzip, the result is a directory, not a file, so having name = "foo.zip" when it really is a directory feels weird.

@joachifm
Copy link
Contributor

joachifm commented Mar 5, 2016

Ping

@kirelagin
Copy link
Member Author

Ugh.

Well, then this is a question of unification. Right now, as far as I can tell, name is either given explicitly without an extension, or (in most cases) is derived from the URL, in which case it will have an extension. I’d say, the right thing to do is to add extensions to names all over nixpkgs (that’s 10 derivations, if my grep-fu is good enough).

@bjornfor ?

@bjornfor
Copy link
Contributor

bjornfor commented Mar 7, 2016

I have no opinion at the moment. I might re-visit later.

@0xABAB
Copy link
Contributor

0xABAB commented Jul 9, 2017

@kirelagin Despite this being a one line change, I am not convinced of its correctness and this has to do with the specification of the function mentioning that it needs to work for tar and zip and you only talk about zip files.

In order to move this forward, please articulate the specific problem that this will solve and how it solves this.

When there is no feedback within three months, I am going to ask someone to close this PR.

@0xABAB
Copy link
Contributor

0xABAB commented Jul 9, 2017

@kirelagin As @bjornfor mentioned this currently is simply wrong. So, please make a PR that actually works. PR that do not work, should be prefixed with WIP, if they are in fact a work in progress and not just abandoned.

@kirelagin
Copy link
Member Author

I have literally no idea what this is about by now.

@kirelagin kirelagin closed this Jul 9, 2017
@kirelagin
Copy link
Member Author

@0xABAB

In order to move this forward, please articulate the specific problem that this will solve and how it solves this.

Oh, and, by the way, I am inclined to believe that the problem is articulated rather clearly in the PR referenced in the OP.

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

Successfully merging this pull request may close these issues.

None yet

4 participants