-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
builtins.toJSON changed floats in 2.12 #8259
Comments
Discussed in the Nix team meeting:
|
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/2023-05-05-nix-team-meeting-minutes-52/27893/1 |
Discussed again in today's Nix team meeting.
EDIT: More discussions going on actually |
The old output or the new output? Just trying to figure out whether I should expect NixOS 23.05 to contain the breakage or not, before I explode prod. :) |
Ah, your edit happened just as I submitted. Awaiting eagerly 🙏 |
Summary of the extra discussion: Getting back to the old behaviour would be prohibitively costly (the initial reason why it got changed was removing a bunch of in-house code), and we don't really know how to move forward if we go that way. So we'll keep and commit to the new behaviour which is more correct (the old one wasn't round-tripping in particular) and much easier to maintain in the long run. We don't do this lightly, but we have weighed our options and considering that the floating point logic is unlikely to affect actual packages, the cost of mismatched hashes only applies to configuration files, such as those that use |
How will this change in behavior be communicated to users? |
@ajs124 Release notes for starters. If you have other suggestions I'm sure we'd be happy to hear them. It is not useful for users to "rely on bugs" "rely on undefined bheavior" etc. The old behavior was a lawless accident. The new behavior has a law, which is that it round-trips property. (As a corollary, we also know that it must not truncate.) It was always the intention that |
Sounds good to me! And yes, I agree that it's an improvement, even if it breaks reproducibility across nix versions in a surprising way, my only concern is that it will ruin someone's day bigtime if it isn't noticed beforehand. Strong warnings in the NixOS release notes will certainly help aleviate some of that. :) |
If someone can communicate this in our NixOS release notes, that'd be great too. |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/2023-05-22-nix-team-meeting-minutes-57/28447/1 |
Where are these? |
Links to the corresponding release notes, and mentions NixOS/nix#8259 which isn't included in it (and is somewhat important since it's a language semantics change)
Done in NixOS/nixpkgs#233975 |
Describe the bug
Before 09f00dd:
After 09f00dd:
Related:
Actual change: #7313
Wish for this change: #5733
(Edit: accidentally included the same copy-paste twice, hiding the problem)
The text was updated successfully, but these errors were encountered: