Re: Help needed: C++ compile error with nix 2.5.1
* 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))
Reply to: