nix.dev icon indicating copy to clipboard operation
nix.dev copied to clipboard

Don't hardcode old channels

Open SuperSandro2000 opened this issue 2 years ago • 6 comments

because that is laready a year old :)

SuperSandro2000 avatar Dec 29 '23 00:12 SuperSandro2000

Using explicit channels aims to ensure reproducebility.

olafklingt avatar Dec 29 '23 01:12 olafklingt

It doesn't help people reading the doc, if the example commands are done with EOL channels.

SuperSandro2000 avatar Dec 29 '23 17:12 SuperSandro2000

I think this is fine, but only if it was actually confirmed that the docs still work with the updated channel. Did you do that @SuperSandro2000?

infinisil avatar Dec 31 '23 20:12 infinisil

It doesn't help people reading the doc, if the example commands are done with EOL channels.

Agreed, but if we don't specify the channel, the user may already have an EOL channel in their NIX_PATH, and this would also fail. Better to be explicit, I think.

To solve the problem of the docs containing EOL'd channels, we could add a CI step to check if instructions like this still work, bumping the channel string to a more recent working channel if not.

proofconstruction avatar Jan 06 '24 03:01 proofconstruction

If we are hardcoding specific channels then we create the impression that things only work with a specific channel which is not the case. The example commands probably work for any channel in the last 3 years and probably more. We can either keep things slim and simple by removing the explicit channel or create new automations which would make things probably complicated.

I think this is fine, but only if it was actually confirmed that the docs still work with the updated channel.

yeah, the output is obviously different which it was already before because eg the machines arch is different and the channels move so the nix store paths are also constantly changing.

Agreed, but if we don't specify the channel, the user may already have an EOL channel in their NIX_PATH, and this would also fail. Better to be explicit, I think.

There are so many factors why this could fail on end user machines but the high level cross compile functions are in place since many versions and should work on all channels in recent years. The output is anyway not fully reproducible because they depend on the machine they are run on.

SuperSandro2000 avatar Jan 31 '24 13:01 SuperSandro2000

If we are hardcoding specific channels then we create the impression that things only work with a specific channel which is not the case. The example commands probably work for any channel in the last 3 years and probably more.

Documentation should be tested just like programming code itself. If we don't, there's the potential for tutorials to not work, which is worse than a working tutorial for older versions.

How about this: Let's be explicit about why those versions are specified by adding a comment like:

This tutorial was tested for the specified Nixpkgs version, but is likely to also work in newer ones.

infinisil avatar Feb 05 '24 16:02 infinisil

I propose to close this pr and update the channels in the file.

olafklingt avatar Apr 08 '24 18:04 olafklingt

@olafklingt Not sure what you mean by that?

infinisil avatar Apr 09 '24 17:04 infinisil

@infinisil this #958

olafklingt avatar Apr 09 '24 21:04 olafklingt