I think it would be nice to have a section in the nixpkgs manual describing how we like to think about packages at a fairly high level. Here are a few candidate ideas (possibly controversial):
nixpkgs
is to improve determinism: we strive to eliminate "works for me, dunno" as a response to help requests by minimizing the pieces of state that can affect the behavior of a program. Determinism not only helps users gain confidence in the system, but also helps developers better debug user errors.PATH
environment variable. For example, a script might look for a java
VM in the path to run its jars with, or attempt to shell out to tar
at runtime. Because those tool references are not "locked down" and could vary at runtime, a script using java
on one machine might work (because perhaps it has JVM 1.8 in its PATH
for other reasons) and it might fail on another machine (because nobody realize they had to nix-env
install java
before running it, or possibly because the jar was built with a newer version of bytecode than the JVM in path
supports)/usr/bin/tar
and we need to patch that path every time it gets bundled with a package we're building; or worse, one of those vendored packages might have a security vulnerability that we don't catch when we patch the common package!); if we force packages to use common dependencies, then the versions might not match the author's wishes, but we have a much cleaner ecosystem where we have reasonable certainty about all the versions of packages that someone depends on, at the cost of higher packager maintenance. I think the right answer here will depend on which language ecosystem is being used, but in general I'd prefer avoiding vendored packages to better reason about dependencies in use in a system and share work across them.fetchurl
or fetchpatch
, rather than bundling them in nixpkgs. Patch files in the nixpkgs repo should be mostly nix-specific packages that exist nowhere else. If for whatever reason (perhaps upstream provides no persistent link) you do need to bundle external content into our repository, please clearly mark its provenance either with a comment if the file format supports comments or in some other way if it doesn't.There are probably several others of these that I've missed, but I figured I'd try to start a discussion by putting out some proposed principles. Once we've settled on some such principles, I'd be happy to submit a PR against the nixpkgs manual with whatever we agree on (or perhaps present that "there are two schools of thought" in some cases and actively discuss the pros and cons of each side to let newcomers decide where they fall)
cc @domenkozar @edolstra @peti @shlevy @vcunat @aszlig @7c6f434c @garbas as comparative old-timers who have been around far longer than I have and probably have far more useful opinions than I do 馃槃
Another question I've had:
When should older versions of packages be left in nixpkgs?
There are some cases where there's enough compatability issues and other differences to keep it and it's pretty established practice that it's not just any old version update (gnome3 vs gnome2, python3 vs python2, gtk3 vs gtk2)... I would prefer nixpkgs to be up to date as possible (rolling release) and just use old nixpkgs trees for those special cases when you need older stuff. If you look in all-packages.nix, you'll see quite a few unused older versions. I hate to break stuff but we may need to have a special policy on what's "allowed" to have older duplicates and remove the rest.
@matthewbauer yes, thanks! I knew there was a major one I was forgetting. I'd definitely want to include a point about how we think about multiple versions.
I personally think the policy on older versions should be "keep them around as long as the latest version of something else needs them". We'll probably need better tooling to discover reverse build-time dependencies of course.
I'm closing this issue because it seems like the discussion is stalled.
Most helpful comment
Another question I've had:
When should older versions of packages be left in nixpkgs?
There are some cases where there's enough compatability issues and other differences to keep it and it's pretty established practice that it's not just any old version update (gnome3 vs gnome2, python3 vs python2, gtk3 vs gtk2)... I would prefer nixpkgs to be up to date as possible (rolling release) and just use old nixpkgs trees for those special cases when you need older stuff. If you look in all-packages.nix, you'll see quite a few unused older versions. I hate to break stuff but we may need to have a special policy on what's "allowed" to have older duplicates and remove the rest.