• Help needed: C++ compile error with nix 2.5.1

    From Thomas Koch@21:1/5 to All on Sun Jan 16 10:30:01 2022
    For a C++ programmer who cares about nix in Debian: https://github.com/NixOS/nix/issues/5923

    Thank you! Thomas

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jakub Wilk@21:1/5 to All on Mon Jan 17 07:30:01 2022
    * Thomas Koch <thomas@koch.ro>, 2022-01-16, 11:23: >https://github.com/NixOS/nix/issues/5923

    The first bad commit is: https://github.com/nlohmann/json/commit/0e694b4060ed55df

    (This happens to be also the first bad commit for <https://github.com/nlohmann/json/issues/3204>, so I guess it's the same issue.)

    I don't know what's going on here, but the attached patch seems to fix
    it.

    --
    Jakub Wilk

    diff --git a/src/libstore/realisation.cc b/src/libstore/realisation.cc
    index f871e6437..eb3ca0198 100644
    --- a/src/libstore/realisation.cc
    +++ b/src/libstore/realisation.cc
    @@ -78,7 +78,7 @@ Realisation Realisation::fromJSON(
    auto fieldIterator = json.find(fieldName);
    if (fieldIterator == json.end())
    return std::nullopt;
    - return *fieldIterator;
    + return std::string(*fieldIterator);
    };
    auto getField = [&](std::string fieldName) -> std::string {
    if (auto field = getOptionalField(fieldName))

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)