summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/python-openstackclient
diff options
context:
space:
mode:
authorEmily <vcs@emily.moe>2025-08-14 15:41:55 +0100
committerEmily <vcs@emily.moe>2025-08-14 21:02:11 +0100
commit449ad44f163198718caaf8bc89080e6187418dc9 (patch)
tree95e08882dae3fa538943a77d16466d48dc66afe8 /pkgs/development/python-modules/python-openstackclient
parent6673e05ad065b0f2388c94cc3b3445f9f7da780e (diff)
lib: fix overflowing `fromHexString` tests and example
`fromHexString` is backed by `builtins.fromTOML`. Per [the TOML v1.0.0 specification]: > Arbitrary 64-bit signed integers (from −2^63 to 2^63−1) should be > accepted and handled losslessly. If an integer cannot be represented > losslessly, an error must be thrown. [the TOML v1.0.0 specification]: <https://toml.io/en/v1.0.0#integer> The saturating behaviour of the toml11 version currently used by Nix is not lossless, and is therefore a violation of the TOML specification. We should not be relying on it. This blocks the update of toml11, as it became stricter about reporting this condition. This, yes, is arguably an evaluation compatibility break. However, integer overflow was recently explicitly defined as an error by both Nix and Lix, as opposed to the C++ undefined behaviour it was previously implemented as: * <https://nix.dev/manual/nix/stable/release-notes/rl-2.25> * <https://docs.lix.systems/manual/lix/stable/release-notes/rl-2.91.html#fixes> This included changing `builtins.fromJSON` to explicitly reject overflowing integer literals. I believe that the case for `builtins.fromTOML` is comparable, and that we are effectively testing undefined behaviour in TOML and the Nix language here, in the same way that we would have been if we had tests relying on overflowing integer arithmetic. I am not aware of any use of this behaviour outside of these tests; the reverted toml11 bump in Nix did not break the 23.11 evaluation regression test, for example. C++ undefined behaviour is not involved here, as toml11 used the C++ formatted input functions that are specified to saturate on invalid values. But it’s still a violation of the TOML specification caused by insufficient error checking in the old version of the library, and inconsistent with the handling of overflowing literals in the rest of Nix. Let’s fix this so that Nix implementations can correctly flag up this error and we can unblock the toml11 update.
Diffstat (limited to 'pkgs/development/python-modules/python-openstackclient')
0 files changed, 0 insertions, 0 deletions