Preface
Let us start with this message for people less involved in Nix things:
We like Nix, we are overall positive about Nix, and this is why we are critical in this piece. Do not let any of this deter any of you from using Nix. Nix is great. We believe Nix will continue to be great, but diminished, even if none of these concerns are addressed.
This is written with the intent to be a wake-up call. There is no cause for alarm at this moment, especially if you’re not deeply embedded into Nix.
We, signatories of this open letter, think it’s time to take a look at what has happened with the 2.4 development cycle, the 2.4 release, and how it will affect users.
This is written from the point of view of end-users, and not from the point of view of Nix developers. End-users use the Nix tools, and write Nix expressions.
First, we want to acknowledge that the development cycle was in stuck in a bad place. We understand the desire to release something. A new Nix release was long overdue. We assume it was a hard situation to be in.
The 2.4 release has been divisive. It seems a lot of the community was already using nixUnstable
, and we expect none of those users have had any issues with the non-upgrade to “nixStable
” 2.4.
Users coming from 2.3 and upgrading to 2.4 were thrown into an ice-cold pool.
Overall, these issues need to be discussed and resolved.
- Backward incompatible changes
- Poor testing without experimental features
- “Breaking” nature of Flakes development
Ending with
- What should be done right now?
- Where to go next from here?
Note that we are purposefully not talking about the design of Flakes. The design of Flakes is out of scope.
Backward incompatible changes
Basic stable features and interfaces have received backwards-incompatible changes. Additionally, response time to the breaking changes has been bad.
- Nix remote build coredumps when mixing nix versions #4664
-
fetchTarball regression in nixUnstable? #4785
-
https://nitter.net/theprincessxena/status/1462770101267091460#m
-
https://matrix.to/#/!KqkRjyTEzAGRiZFBYT:nixos.org/$-ysRbx01kg4uM3r7dzfdfJxC5CHfl3ziyY9mwjOsl8U?via=nixos.org&via=matrix.org&via=tchncs.de
Xe
I upgraded my system to the newest version of NixOS Unstable and I get an error when trying to nixify some very old apps:
error: tarball 'https://xena.greedo.xeserv.us/files/slugs/within.website-091120192252.tar.gz' contains an unexpected number of top-level files the derivation is defined here: https://github.com/Xe/nixos-configs/blob/a626c05749a16de4c27392ae38daff97be78a619/pkgs/x/withinwebsite.nix
what did i mess up?
-
- https://nitter.net/Profpatsch/status/1462765486131851267
- builtins.fetchGit regression in 2.4 when coming from 2.3 #5128
- nix-store 2.3 incompatible with nix-daemon 2.4pre #5299
- Be mindful about the default arguments passed to nixpkgs in nix-shell #5543
- Make it possible to only build derivations with preferLocalBuild locally. #5646
We understand that breakage can happen. The issue that needs to be addressed is the apparent lack of work to fix backward incompatible changes.
nix
command
The messaging on whether to embrace or avoid the experimental features starting with the nix
command was unclear. In practice, users started using the nix
commands.
While some of us are understanding of the change making the nix
command experimental, it was a de-facto interface that users relied on. It would have been better to have an intermediary release that marked it as an experimental feature without changing its use. This would have reduced the scope of user-perceived breakage in a subsequent Nix 2.5 release that would have been exactly like the 2.4 we got.
Like it or not, far too many users were impacted by breakage in its basic behaviour. Users relied on the behaviour. These became closer to de-facto stable through usage in official Nixpkgs and NixOS documentation. It may have been too late to do a major re-design of the UX.
We understand that this is an irreconcilable truth; the command has been purposefully listed as unstable, and the UX specifically listed as to be revised and finalised.
Many nix
commands are now Flakes-centric, even when Flakes are not enabled.
As a central example in user reports, the nix search
UX is broken by default without buying into Flakes.
See also
Not strictly breaking changes, but lack of response to major behaviour change.
Poor testing without experimental features
Tests for Nix always run with flakes
and nix-command
experimental features enabled.
This is not how experimental features should be tested.
First, commands were marked with the wrong feature, since it was not tested whether the command worked with the minimal subset of features:
Then, additional features were unclearly defined:
Then, it was found that some experimental features were not marked as such:
- nix registry: Mark experimental by samueldr · Pull Request #5542 · NixOS/nix · GitHub
- `nix repl` is available without the `nix-command` experimental feature · Issue #5604 · NixOS/nix · GitHub
Finally, some basic functions are broken
- nix search with -f ‘’ lacking attribute names / package names from results #5641
- nix search with -f works poorly with “installable” semantics #5642
“Breaking” nature of Flakes development
Reminder: This is not about the design of Flakes.
We believe the current approach at implementing Nix Flakes is made at the cost of non-Flakes Nix use.
Flakes has not been accepted as the future of Nix development through the RFC process.
Development of the feature in the main development branch was tolerated, under the assumption that it would not cause deleterious effects on the quality of Nix itself.
In reality, Flakes was implemented “from the top down”. Basically shoved into Nix, transforming it towards a vaguely specified vision.
The community is still divided into whether the Flakes vision is the right way forward or not. The community is, as far as we understand not against most of the overarching goals of Flakes.
Having to opt into Flakes to benefit from the basic improvements is a sign of lack of care about abstractions.
Also note previous grievances about the nix
command-line being changed beyond recognition in the name of Flakes.
What should be done right now?
We will be brutally honest. The upcoming NixOS upgrade with 2.4 will be bad. We think that Nix should be reverted back to 2.3 in NixOS, or issues resolved in an impossible timeline.
Users who were not following the nixUnstable
development are less likely to have migrated their infrastructure to whatever was needed for Flakes. They will be the worst hit individuals. We fear the trust of stable Nix, and stable NixOS users may be irreparably breached if Nix 2.4, a minor release, ends-up being incompatible with their existing setups.
From this moment, we expect to see announced, first, a stop-gap plan to help with the current situation, and later a proper plan to prevent such a situation to happen again.
Where to go next from here?
We also believe that the broad issues here show a problem with the development practices, and it must be figured out. We do not have a single easy solution. It is a harder problem that needs to be worked from multiple angles. And really, it should be worked on from within.
Still, here’s an unordered list of propositions to start from:
- Testing needs to consider all experimental features, and needs to test for correct behaviour with and without the feature enabled.
- Changing basic language features (
builtins
included) should be done through compartmentalized change sets for better community review and testing. The changes should also come with tests especially for added conditionals. - New features shouldn’t be implemented “from the top down”.
- Basic generic building blocks should be added, if missing, to the language or to the interpreter.
- Plugins should be used to provide experimental changes where new language-based semantics isn’t enough.
- Implementation of abstractions should be prototyped in Nix on top of the new abstractions.
We want to acknowledge there were in fact many improvements to the test suite and developer infra, exactly the kind of work needed to prevent these problems. This is a good start. We believe it would be better to put the new and exciting features work on a brief pause, and sort out the last of the testing infrastructure, to get a better handle on what is changing.
We sincerely believe that the upcoming change to calendar-based versioning could be harmful to the sustained quality of Nix without first tightening up the development workflow such that it will not cause constant breakage for stable features. Paradoxically, We also believe that the same calendar-based versioning is key to prevent a scope creep similar that happened with Nix 2.4 from happening again.
Signatories
(Alphabetically ordered)
- Andreas Rammhold (@andir)
- ashkitten (@ashkitten)
- CrystalGamma (@CrystalGamma)
- John Ericson (@Ericson2314)
- Samuel Dionne-Riel (@samueldr)
- Travis A. Everett (@abathur)
- Will Fancher (@ElvishJerricco)
- Xe (@Within)
Note
Community members are invited to edit the first reply to this thread to add their names to the list of signatories, if they agree with the message. Signing pseudonymously with your usual community pseudonym is accepted.