Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions nix-meson-build-support/common/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ add_project_arguments(
'-Wignored-qualifiers',
'-Wimplicit-fallthrough',
'-Wno-deprecated-declarations',
'-Wno-dangling-reference',
language : 'cpp',
)
8 changes: 4 additions & 4 deletions src/libstore/derivations.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1228,13 +1228,13 @@ DerivationOutput DerivationOutput::fromJSON(
keys.insert(key);

auto methodAlgo = [&]() -> std::pair<ContentAddressMethod, HashAlgorithm> {
auto & method_ = getString(valueAt(json, "method"));
ContentAddressMethod method = ContentAddressMethod::parse(method_);
ContentAddressMethod method = ContentAddressMethod::parse(
getString(valueAt(json, "method")));
if (method == ContentAddressMethod::Raw::Text)
xpSettings.require(Xp::DynamicDerivations);

auto & hashAlgo_ = getString(valueAt(json, "hashAlgo"));
auto hashAlgo = parseHashAlgo(hashAlgo_);
auto hashAlgo = parseHashAlgo(
getString(valueAt(json, "hashAlgo")));
return { std::move(method), std::move(hashAlgo) };
};

Expand Down
4 changes: 1 addition & 3 deletions src/libutil-tests/json-utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,7 @@ TEST(valueAt, simpleObject) {

auto nested = R"({ "hello": { "world": "" } })"_json;

auto & nestedObject = valueAt(getObject(nested), "hello");

ASSERT_EQ(valueAt(nestedObject, "world"), "");
ASSERT_EQ(valueAt(valueAt(getObject(nested), "hello"), "world"), "");
}

TEST(valueAt, missingKey) {
Expand Down
Loading