Skip to content

Commit 29f3da1

Browse files
authored
Merge branch 'master' into fzakaria/small-clang-tidy-fix
2 parents 06a82da + 34bca92 commit 29f3da1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+490
-883
lines changed

src/libcmd/built-path.cc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,10 @@ RealisedPath::Set BuiltPath::toRealisedPaths(Store & store) const
117117
"the derivation '%s' has unrealised output '%s' (derived-path.cc/toRealisedPaths)",
118118
store.printStorePath(p.drvPath->outPath()),
119119
outputName);
120-
DrvOutput key{*drvOutput, outputName};
121-
auto thisRealisation = store.queryRealisation(key);
120+
auto thisRealisation = store.queryRealisation(DrvOutput{*drvOutput, outputName});
122121
assert(thisRealisation); // We’ve built it, so we must
123122
// have the realisation
124-
res.insert(Realisation{*thisRealisation, std::move(key)});
123+
res.insert(*thisRealisation);
125124
} else {
126125
res.insert(outputPath);
127126
}

src/libexpr/eval-profiler.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ void SampleStack::saveProfile()
324324
std::visit([&](auto && info) { info.symbolize(state, os, posCache); }, pos);
325325
}
326326
os << " " << count;
327-
writeLine(profileFd.get(), std::move(os).str());
327+
writeLine(profileFd.get(), os.str());
328328
/* Clear ostringstream. */
329329
os.str("");
330330
os.clear();

src/libstore-tests/common-protocol.cc

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -112,34 +112,32 @@ CHARACTERIZATION_TEST(
112112
"realisation",
113113
(std::tuple<Realisation, Realisation>{
114114
Realisation{
115-
{
116-
.outPath = StorePath{"g1w7hy3qg1w7hy3qg1w7hy3qg1w7hy3q-foo"},
117-
.signatures = {"asdf", "qwer"},
118-
},
119-
DrvOutput{
120-
.drvHash = Hash::parseSRI("sha256-FePFYIlMuycIXPZbWi7LGEiMmZSX9FMbaQenWBzm1Sc="),
121-
.outputName = "baz",
122-
},
115+
.id =
116+
DrvOutput{
117+
.drvHash = Hash::parseSRI("sha256-FePFYIlMuycIXPZbWi7LGEiMmZSX9FMbaQenWBzm1Sc="),
118+
.outputName = "baz",
119+
},
120+
.outPath = StorePath{"g1w7hy3qg1w7hy3qg1w7hy3qg1w7hy3q-foo"},
121+
.signatures = {"asdf", "qwer"},
123122
},
124123
Realisation{
125-
{
126-
.outPath = StorePath{"g1w7hy3qg1w7hy3qg1w7hy3qg1w7hy3q-foo"},
127-
.signatures = {"asdf", "qwer"},
128-
.dependentRealisations =
124+
.id =
125+
{
126+
.drvHash = Hash::parseSRI("sha256-FePFYIlMuycIXPZbWi7LGEiMmZSX9FMbaQenWBzm1Sc="),
127+
.outputName = "baz",
128+
},
129+
.outPath = StorePath{"g1w7hy3qg1w7hy3qg1w7hy3qg1w7hy3q-foo"},
130+
.signatures = {"asdf", "qwer"},
131+
.dependentRealisations =
132+
{
129133
{
130-
{
131-
DrvOutput{
132-
.drvHash = Hash::parseSRI("sha256-b4afnqKCO9oWXgYHb9DeQ2berSwOjS27rSd9TxXDc/U="),
133-
.outputName = "quux",
134-
},
135-
StorePath{"g1w7hy3qg1w7hy3qg1w7hy3qg1w7hy3q-foo"},
134+
DrvOutput{
135+
.drvHash = Hash::parseSRI("sha256-b4afnqKCO9oWXgYHb9DeQ2berSwOjS27rSd9TxXDc/U="),
136+
.outputName = "quux",
136137
},
138+
StorePath{"g1w7hy3qg1w7hy3qg1w7hy3qg1w7hy3q-foo"},
137139
},
138-
},
139-
{
140-
.drvHash = Hash::parseSRI("sha256-FePFYIlMuycIXPZbWi7LGEiMmZSX9FMbaQenWBzm1Sc="),
141-
.outputName = "baz",
142-
},
140+
},
143141
},
144142
}))
145143

src/libstore-tests/dummy-store.cc

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include <gtest/gtest.h>
22

3-
#include "nix/store/dummy-store-impl.hh"
3+
#include "nix/store/dummy-store.hh"
44
#include "nix/store/globals.hh"
55
#include "nix/store/realisation.hh"
66

@@ -13,7 +13,7 @@ TEST(DummyStore, realisation_read)
1313
auto store = [] {
1414
auto cfg = make_ref<DummyStoreConfig>(StoreReference::Params{});
1515
cfg->readOnly = false;
16-
return cfg->openDummyStore();
16+
return cfg->openStore();
1717
}();
1818

1919
auto drvHash = Hash::parseExplicitFormatUnprefixed(
@@ -22,17 +22,6 @@ TEST(DummyStore, realisation_read)
2222
auto outputName = "foo";
2323

2424
EXPECT_EQ(store->queryRealisation({drvHash, outputName}), nullptr);
25-
26-
UnkeyedRealisation value{
27-
.outPath = StorePath{"g1w7hy3qg1w7hy3qg1w7hy3qg1w7hy3q-foo.drv"},
28-
};
29-
30-
store->buildTrace.insert({drvHash, {{outputName, make_ref<UnkeyedRealisation>(value)}}});
31-
32-
auto value2 = store->queryRealisation({drvHash, outputName});
33-
34-
ASSERT_TRUE(value2);
35-
EXPECT_EQ(*value2, value);
3625
}
3726

3827
} // namespace nix

src/libstore-tests/realisation.cc

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,16 @@ INSTANTIATE_TEST_SUITE_P(
4949
RealisationJsonTest,
5050
([] {
5151
Realisation simple{
52-
{
53-
.outPath = StorePath{"g1w7hy3qg1w7hy3qg1w7hy3qg1w7hy3q-foo.drv"},
54-
},
55-
{
56-
.drvHash = Hash::parseExplicitFormatUnprefixed(
57-
"ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad",
58-
HashAlgorithm::SHA256,
59-
HashFormat::Base16),
60-
.outputName = "foo",
61-
},
52+
53+
.id =
54+
{
55+
.drvHash = Hash::parseExplicitFormatUnprefixed(
56+
"ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad",
57+
HashAlgorithm::SHA256,
58+
HashFormat::Base16),
59+
.outputName = "foo",
60+
},
61+
.outPath = StorePath{"g1w7hy3qg1w7hy3qg1w7hy3qg1w7hy3q-foo.drv"},
6262
};
6363
return ::testing::Values(
6464
std::pair{

src/libstore-tests/serve-protocol.cc

Lines changed: 35 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -95,34 +95,32 @@ VERSIONED_CHARACTERIZATION_TEST(
9595
defaultVersion,
9696
(std::tuple<Realisation, Realisation>{
9797
Realisation{
98-
{
99-
.outPath = StorePath{"g1w7hy3qg1w7hy3qg1w7hy3qg1w7hy3q-foo"},
100-
.signatures = {"asdf", "qwer"},
101-
},
102-
{
103-
.drvHash = Hash::parseSRI("sha256-FePFYIlMuycIXPZbWi7LGEiMmZSX9FMbaQenWBzm1Sc="),
104-
.outputName = "baz",
105-
},
98+
.id =
99+
DrvOutput{
100+
.drvHash = Hash::parseSRI("sha256-FePFYIlMuycIXPZbWi7LGEiMmZSX9FMbaQenWBzm1Sc="),
101+
.outputName = "baz",
102+
},
103+
.outPath = StorePath{"g1w7hy3qg1w7hy3qg1w7hy3qg1w7hy3q-foo"},
104+
.signatures = {"asdf", "qwer"},
106105
},
107106
Realisation{
108-
{
109-
.outPath = StorePath{"g1w7hy3qg1w7hy3qg1w7hy3qg1w7hy3q-foo"},
110-
.signatures = {"asdf", "qwer"},
111-
.dependentRealisations =
107+
.id =
108+
{
109+
.drvHash = Hash::parseSRI("sha256-FePFYIlMuycIXPZbWi7LGEiMmZSX9FMbaQenWBzm1Sc="),
110+
.outputName = "baz",
111+
},
112+
.outPath = StorePath{"g1w7hy3qg1w7hy3qg1w7hy3qg1w7hy3q-foo"},
113+
.signatures = {"asdf", "qwer"},
114+
.dependentRealisations =
115+
{
112116
{
113-
{
114-
DrvOutput{
115-
.drvHash = Hash::parseSRI("sha256-b4afnqKCO9oWXgYHb9DeQ2berSwOjS27rSd9TxXDc/U="),
116-
.outputName = "quux",
117-
},
118-
StorePath{"g1w7hy3qg1w7hy3qg1w7hy3qg1w7hy3q-foo"},
117+
DrvOutput{
118+
.drvHash = Hash::parseSRI("sha256-b4afnqKCO9oWXgYHb9DeQ2berSwOjS27rSd9TxXDc/U="),
119+
.outputName = "quux",
119120
},
121+
StorePath{"g1w7hy3qg1w7hy3qg1w7hy3qg1w7hy3q-foo"},
120122
},
121-
},
122-
{
123-
.drvHash = Hash::parseSRI("sha256-FePFYIlMuycIXPZbWi7LGEiMmZSX9FMbaQenWBzm1Sc="),
124-
.outputName = "baz",
125-
},
123+
},
126124
},
127125
}))
128126

@@ -198,27 +196,25 @@ VERSIONED_CHARACTERIZATION_TEST(
198196
{
199197
"foo",
200198
{
201-
{
202-
.outPath = StorePath{"g1w7hy3qg1w7hy3qg1w7hy3qg1w7hy3q-foo"},
203-
},
204-
DrvOutput{
205-
.drvHash =
206-
Hash::parseSRI("sha256-b4afnqKCO9oWXgYHb9DeQ2berSwOjS27rSd9TxXDc/U="),
207-
.outputName = "foo",
208-
},
199+
.id =
200+
DrvOutput{
201+
.drvHash =
202+
Hash::parseSRI("sha256-b4afnqKCO9oWXgYHb9DeQ2berSwOjS27rSd9TxXDc/U="),
203+
.outputName = "foo",
204+
},
205+
.outPath = StorePath{"g1w7hy3qg1w7hy3qg1w7hy3qg1w7hy3q-foo"},
209206
},
210207
},
211208
{
212209
"bar",
213210
{
214-
{
215-
.outPath = StorePath{"g1w7hy3qg1w7hy3qg1w7hy3qg1w7hy3q-bar"},
216-
},
217-
DrvOutput{
218-
.drvHash =
219-
Hash::parseSRI("sha256-b4afnqKCO9oWXgYHb9DeQ2berSwOjS27rSd9TxXDc/U="),
220-
.outputName = "bar",
221-
},
211+
.id =
212+
DrvOutput{
213+
.drvHash =
214+
Hash::parseSRI("sha256-b4afnqKCO9oWXgYHb9DeQ2berSwOjS27rSd9TxXDc/U="),
215+
.outputName = "bar",
216+
},
217+
.outPath = StorePath{"g1w7hy3qg1w7hy3qg1w7hy3qg1w7hy3q-bar"},
222218
},
223219
},
224220
},

0 commit comments

Comments
 (0)