Skip to content

eval-okay-fromTOML-timestamps test fails on toml11-4.2.0 #11441

Closed

Description

@trofi

Describe the bug

When built against toml-4.2.0 nix test fails.

Steps To Reproduce

Update timl11 in nixpkgs locally:

--- a/pkgs/development/libraries/toml11/default.nix
+++ b/pkgs/development/libraries/toml11/default.nix
@@ -6,13 +6,13 @@

 stdenv.mkDerivation (finalAttrs: {
   pname = "toml11";
-  version = "3.7.1";
+  version = "4.2.0";

   src = fetchFromGitHub {
     owner = "ToruNiina";
     repo = "toml11";
     rev = "v${finalAttrs.version}";
-    hash = "sha256-HnhXBvIjo1JXhp+hUQvjs83t5IBVbNN6o3ZGhB4WESQ=";
+    hash = "sha256-NUuEgTpq86rDcsQnpG0IsSmgLT0cXhd1y32gT57QPAw=";
   };

   nativeBuildInputs = [

Built latest nix:

$ nix build --no-link -f. nixVersions.git
...
    --- lang/eval-okay-fromTOML-timestamps.exp  1970-01-01 00:00:01.000000000 +0000
    +++ lang/eval-okay-fromTOML-timestamps.out  2024-09-06 21:04:32.702012446 +0000
    @@ -1 +1 @@
    -{ "1234" = "value"; "127.0.0.1" = "value"; a = { b = { c = { }; }; }; arr1 = [ 1 2 3 ]; arr2 = [ "red" "yellow" "green" ]; arr3 = [ [ 1 2 ] [ 3 4 5 ] ]; arr4 = [ "all" "strings" "are the same" "type" ]; arr5 = [ [ 1 2 ] [ "a" "b" "c" ] ]; arr7 = [ 1 2 3 ]; arr8 = [ 1 2 ]; bare-key = "value"; bare_key = "value"; bin1 = 214; bool1 = true; bool2 = false; "character encoding" = "value"; d = { e = { f = { }; }; }; dog = { "tater.man" = { type = { name = "pug"; }; }; }; flt1 = 1; flt2 = 3.1415; flt3 = -0.01; flt4 = 5e+22; flt5 = 1e+06; flt6 = -0.02; flt7 = 6.626e-34; flt8 = 9.22462e+06; fruit = [ { name = "apple"; physical = { color = "red"; shape = "round"; }; variety = [ { name = "red delicious"; } { name = "granny smith"; } ]; } { name = "banana"; variety = [ { name = "plantain"; } ]; } ]; g = { h = { i = { }; }; }; hex1 = 3735928559; hex2 = 3735928559; hex3 = 3735928559; int1 = 99; int2 = 42; int3 = 0; int4 = -17; int5 = 1000; int6 = 5349221; int7 = 12345; j = { "ʞ" = { l = { }; }; }; key = "value"; key2 = "value"; ld1 = { _type = "timestamp"; value = "1979-05-27"; }; ldt1 = { _type = "timestamp"; value = "1979-05-27T07:32:00"; }; ldt2 = { _type = "timestamp"; value = "1979-05-27T00:32:00.999999"; }; lt1 = { _type = "timestamp"; value = "07:32:00"; }; lt2 = { _type = "timestamp"; value = "00:32:00.999999"; }; name = "Orange"; oct1 = 342391; oct2 = 493; odt1 = { _type = "timestamp"; value = "1979-05-27T07:32:00Z"; }; odt2 = { _type = "timestamp"; value = "1979-05-27T00:32:00-07:00"; }; odt3 = { _type = "timestamp"; value = "1979-05-27T00:32:00.999999-07:00"; }; odt4 = { _type = "timestamp"; value = "1979-05-27T07:32:00Z"; }; physical = { color = "orange"; shape = "round"; }; products = [ { name = "Hammer"; sku = 738594937; } { } { color = "gray"; name = "Nail"; sku = 284758393; } ]; "quoted \"value\"" = "value"; site = { "google.com" = true; }; str = "I'm a string. \"You can quote me\". Name\tJosé\nLocation\tSF."; table-1 = { key1 = "some string"; key2 = 123; }; table-2 = { key1 = "another string"; key2 = 456; }; x = { y = { z = { w = { animal = { type = { name = "pug"; }; }; name = { first = "Tom"; last = "Preston-Werner"; }; point = { x = 1; y = 2; }; }; }; }; }; "ʎǝʞ" = "value"; }
    +{ "1234" = "value"; "127.0.0.1" = "value"; a = { b = { c = { }; }; }; arr1 = [ 1 2 3 ]; arr2 = [ "red" "yellow" "green" ]; arr3 = [ [ 1 2 ] [ 3 4 5 ] ]; arr4 = [ "all" "strings" "are the same" "type" ]; arr5 = [ [ 1 2 ] [ "a" "b" "c" ] ]; arr7 = [ 1 2 3 ]; arr8 = [ 1 2 ]; bare-key = "value"; bare_key = "value"; bin1 = 214; bool1 = true; bool2 = false; "character encoding" = "value"; d = { e = { f = { }; }; }; dog = { "tater.man" = { type = { name = "pug"; }; }; }; flt1 = 1; flt2 = 3.1415; flt3 = -0.01; flt4 = 5e+22; flt5 = 1e+06; flt6 = -0.02; flt7 = 6.626e-34; flt8 = 9.22462e+06; fruit = [ { name = "apple"; physical = { color = "red"; shape = "round"; }; variety = [ { name = "red delicious"; } { name = "granny smith"; } ]; } { name = "banana"; variety = [ { name = "plantain"; } ]; } ]; g = { h = { i = { }; }; }; hex1 = 3735928559; hex2 = 3735928559; hex3 = 3735928559; int1 = 99; int2 = 42; int3 = 0; int4 = -17; int5 = 1000; int6 = 5349221; int7 = 12345; j = { "ʞ" = { l = { }; }; }; key = "value"; key2 = "value"; ld1 = { _type = "timestamp"; value = "1979-05-27"; }; ldt1 = { _type = "timestamp"; value = "1979-05-27T07:32:00"; }; ldt2 = { _type = "timestamp"; value = "1979-05-27T00:32:00.999999"; }; lt1 = { _type = "timestamp"; value = "07:32:00"; }; lt2 = { _type = "timestamp"; value = "00:32:00.999999"; }; name = "Orange"; oct1 = 342391; oct2 = 493; odt1 = { _type = "timestamp"; value = "1979-05-27T07:32:00Z"; }; odt2 = { _type = "timestamp"; value = "1979-05-27T00:32:00-07:00"; }; odt3 = { _type = "timestamp"; value = "1979-05-27T00:32:00.999999-07:00"; }; odt4 = { _type = "timestamp"; value = "1979-05-27 07:32:00Z"; }; physical = { color = "orange"; shape = "round"; }; products = [ { name = "Hammer"; sku = 738594937; } { } { color = "gray"; name = "Nail"; sku = 284758393; } ]; "quoted \"value\"" = "value"; site = { "google.com" = true; }; str = "I'm a string. \"You can quote me\". Name\tJosé\nLocation\tSF."; table-1 = { key1 = "some string"; key2 = 123; }; table-2 = { key1 = "another string"; key2 = 456; }; x = { y = { z = { w = { animal = { type = { name = "pug"; }; }; name = { first = "Tom"; last = "Preston-Werner"; }; point = { x = 1; y = 2; }; }; }; }; }; "ʎǝʞ" = "value"; }

The problem is timestamp difference of otd4:

  • odt4 = { _type = "timestamp"; value = "1979-05-27T07:32:00Z"; }
  • odt4 = { _type = "timestamp"; value = "1979-05-27 07:32:00Z"; }

Priorities

Add 👍 to issues you find important.

Activity

  1. added
    regression
    language
    on Sep 9, 2024
  2. roberth commented on Sep 18, 2024

    @roberth
    Member

    This behavior is behind the parse-toml-timestamps, so we could choose to accept the changed behavior, but for the feature to stabilize, we'll need to know the details.
    The tests did their job, which is a good sign, but it'd be wise to review the tests again for completeness before we call the feature stable.

  3. roberth commented on Sep 25, 2024

    @roberth
    Member

    Triaged in Nix team meeting 181

    Fortunately we had the foresight to keep this experimental, and this event is a valuable data point.

    It changed from T (always?) to verbatim.

    @andreabedini, what do you think? Could you check with upstream docs / ask them?

    It is possible that this value from the library is supposed to be verbatim, or in a canonical form of sorts. If it's the latter, we need to know whether upstream can promise not to change the format.

  4. nixos-discourse commented on Sep 25, 2024

    @nixos-discourse
  5. emilazy commented on Nov 25, 2024

    @emilazy
    Member

    Hi there, any update on this? There are things in Nixpkgs blocked on the toml11 update. Perhaps we could simply disable this test downstream?

  6. roberth commented on Nov 26, 2024

    @roberth
    Member

    This is an experimental feature, and we haven't got a response from the author, so maybe we should just accept the changed behavior to keep things simple. It seems to be more verbatim now, and that's probably good.

  7. moved this from 🏁 Review to To triage in Nix teamon Nov 26, 2024
  8. emilazy commented on Nov 26, 2024

    @emilazy
    Member

    Seems reasonable enough. It would restrict using a TOML implementation that performs that normalization in future, but that might be okay. It could potentially cause issues trying to match the spec in other languages (but there are many more issues like that in Nix, of course; just flagging it up as a consideration).

    In Nixpkgs we’ll probably backport the test change where applicable or disable the test, whichever’s easiest.

  9. moved this from To triage to 🏁 Review in Nix teamon Nov 27, 2024
  10. nixos-discourse commented on Nov 27, 2024

    @nixos-discourse
  11. roberth commented on Nov 27, 2024

    @roberth
    Member

    @emilazy the change seems to be about reducing normalization, i.e. returning the input syntax verbatim or close to verbatim (I'd have to check).


    Meeting minutes excerpt:

    We accept the upstream change. Reasons:

    • verbatim is slightly better
    • feature is still experimental
      • perhaps not very important - least resistance [consider opportunity cost]
  12. emilazy commented on May 22, 2025

    @emilazy
    Member

    We need to bump toml11 in Nixpkgs for the CMake 4.0 update, so we will have to disable the test if this is not fixed in Nix soon.

  13. self-assigned this
    on Aug 12, 2025
  14. xokdvium commented on Aug 12, 2025

    @xokdvium
    Contributor

    The issue here is that toml11 has switched to using C++ stdlib for printing dates: https://github.com/ToruNiina/toml11/blob/2a18a89008d3daac6d8f9db03ddd582173032c7a/include/toml11/impl/datetime_impl.hpp#L514.

    This really can't be relied upon, especially when it has to do anything with locales. I think we should just freeze the serialization code as it was in 3.7.1, since it would prevent any footguns. Frankly I don't trust std::chrono to uphold the sort of back-compat and purity guarantees that we need.

    EDIT: Disregard this comment, I've jumped to conclusions a bit too soon. Seems like now toml11 preserves the delimiter https://github.com/ToruNiina/toml11/blob/2a18a89008d3daac6d8f9db03ddd582173032c7a/include/toml11/fwd/format_fwd.hpp#L144.

  15. moved this from 🏁 Review to Done in Nix teamon Aug 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

buglanguageregression

Projects

  • Status
    Done

Relationships

None yet

Development

No branches or pull requests

Issue actions