Nixpkgs: Two slashes in URL which should be one slash

Created on 24 Apr 2016  Â·  6Comments  Â·  Source: NixOS/nixpkgs

Notice the two slashes:

 nix-channel --update
downloading Nix expressions from ‘https://nixos.org/releases/nixos/16.03/nixos-16.03.616.4ac4b35//nixexprs.tar.xz’...

while I have

nix-channel --list
nixos https://nixos.org/channels/nixos-16.03

It might "work", but it is -- again -- sloppy.

Most helpful comment

On Sun, Apr 24, 2016, at 05:17 PM, 0xABAB wrote:

@joachifm The problem is that there is end-user visible URLs which look
wrong; no human would ever enter that. If I have to explain this further,
I think you just lack the engineering quality of "taste".

In case you are wondering why double slashes might be wrong, see my
recent "NixOS doesn't boot" issue.

It is ridiculous to phrase this as an optimization.

Programming wise doing head + '/' + tail is also amateur programming (I
didn't check whether this is really being done, but I really hope not).
It would _never_ enter any of the codebases I am responsible for.

I actually find it surprising (and highly annoying) that anyone can
disagree on this. Let's hope you don't have too much influence in this
project.

Relevant code is here:
https://github.com/NixOS/nix/blob/master/scripts/nix-channel.in#L134

You might have had a point if the URLs were generated for any other
purpose than to be fed directly into curl. This isn't about optimization,
it's about what to spend programmer time on.

EDIT: removed non-constructive language, I'm sorry about that.

All 6 comments

What is the problem, exactly? Doing head + '/' + tail is a simple method of ensuring that the result is usable, checking whether head contains a trailing slash seems like a waste of time to me.

Anyway, this is a Nix issue, not a nixpkgs issue.

@joachifm The problem is that there is end-user visible URLs which look wrong; no human would ever enter that. If I have to explain this further, I think you just lack the engineering quality of "taste".

In case you are wondering why double slashes might be wrong, see my recent "NixOS doesn't boot" issue.

It is ridiculous to phrase this as an optimization.

Programming wise doing head + '/' + tail is also amateur programming (I didn't check whether this is really being done, but I really hope not). It would _never_ enter any of the codebases I am responsible for.

I actually find it surprising (and highly annoying) that anyone can disagree on this. Let's hope you don't have too much influence in this project.

On Sun, Apr 24, 2016, at 05:17 PM, 0xABAB wrote:

@joachifm The problem is that there is end-user visible URLs which look
wrong; no human would ever enter that. If I have to explain this further,
I think you just lack the engineering quality of "taste".

In case you are wondering why double slashes might be wrong, see my
recent "NixOS doesn't boot" issue.

It is ridiculous to phrase this as an optimization.

Programming wise doing head + '/' + tail is also amateur programming (I
didn't check whether this is really being done, but I really hope not).
It would _never_ enter any of the codebases I am responsible for.

I actually find it surprising (and highly annoying) that anyone can
disagree on this. Let's hope you don't have too much influence in this
project.

Relevant code is here:
https://github.com/NixOS/nix/blob/master/scripts/nix-channel.in#L134

You might have had a point if the URLs were generated for any other
purpose than to be fed directly into curl. This isn't about optimization,
it's about what to spend programmer time on.

EDIT: removed non-constructive language, I'm sorry about that.

@0xABAB Could you submit a PR to fix https://github.com/NixOS/nix/blob/master/scripts/nix-channel.in#L134 in the double-slash case?

@joachifm There _is_ another point, which is that the user _sees_ the curl command. That means it becomes part of the UI and the UI is screaming that the programmer likely made a mistake. The mere coincidence that this is not the case is not relevant to the argument.

As this is in nix I'm closing this.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

matthiasbeyer picture matthiasbeyer  Â·  3Comments

copumpkin picture copumpkin  Â·  3Comments

langston-barrett picture langston-barrett  Â·  3Comments

rzetterberg picture rzetterberg  Â·  3Comments

copumpkin picture copumpkin  Â·  3Comments