aboutsummaryrefslogtreecommitdiff
path: root/doc/manual
diff options
context:
space:
mode:
authorJade Lovelace <lix@jade.fyi>2024-07-18 19:21:23 +0200
committerjade <lix@jade.fyi>2024-07-18 19:27:33 +0000
commit10cc3b288d0e73a16f5da983c99b8d78f3a7ded1 (patch)
treed10c1e80d3146ad19a5e497a8dac4854789ed3d6 /doc/manual
parent50a63f8435f03e47aa85136e3145ed58dff65734 (diff)
Add release notes for removing overflow from Nix language
Change-Id: Ib75ab5b8b4d879035d7ee7678f9cd0c491a39c0a
Diffstat (limited to 'doc/manual')
-rw-r--r--doc/manual/rl-next/ban-integer-overflow.md23
1 files changed, 23 insertions, 0 deletions
diff --git a/doc/manual/rl-next/ban-integer-overflow.md b/doc/manual/rl-next/ban-integer-overflow.md
new file mode 100644
index 000000000..d704db651
--- /dev/null
+++ b/doc/manual/rl-next/ban-integer-overflow.md
@@ -0,0 +1,23 @@
+---
+synopsis: Define integer overflow in the Nix language as an error
+issues: [fj#423]
+cls: [1594, 1595, 1597, 1609]
+category: Fixes
+credits: [jade]
+---
+
+Previously, integer overflow in the Nix language invoked C++ level signed overflow, which was undefined behaviour, but *probably* manifested as wrapping around on overflow.
+
+Since prior to the public release of Lix, Lix had C++ signed overflow defined to crash the process and nobody noticed this having accidentally removed overflow from the Nix language for three months until it was caught by fiddling around.
+Given the significant body of actual Nix code that has been evaluated by Lix in that time, it does not appear that nixpkgs or much of importance depends on integer overflow, so it is safe to turn into an error.
+
+Some other overflows were fixed:
+- `builtins.fromJSON` of values greater than the maximum representable value in a signed 64-bit integer will generate an error.
+- `nixConfig` in flakes will no longer accept negative values for configuration options.
+
+Integer overflow now looks like the following:
+
+```
+ยป nix eval --expr '9223372036854775807 + 1'
+error: integer overflow in adding 9223372036854775807 + 1
+```