Skip to content

Commit 949d142

Browse files
committed
Merge branch 'master' into ca-nar-cache
2 parents 94dd70e + a8087eb commit 949d142

65 files changed

Lines changed: 813 additions & 602 deletions

File tree

Some content is hidden

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

flake.lock

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
inputs.nixpkgs-regression.url = "github:NixOS/nixpkgs/215d4d0fd80ca5163643b03a33fde804a29cc1e2";
77
inputs.nixpkgs-23-11.url = "github:NixOS/nixpkgs/a62e6edd6d5e1fa0329b8653c801147986f8d446";
88
inputs.flake-compat = {
9-
url = "github:edolstra/flake-compat";
9+
url = "github:NixOS/flake-compat";
1010
flake = false;
1111
};
1212

src/libfetchers/path.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,6 @@ struct PathInputScheme : InputScheme
165165

166166
// To prevent `fetchToStore()` copying the path again to Nix
167167
// store, pre-create an entry in the fetcher cache.
168-
auto info = store.queryPathInfo(*storePath);
169168
accessor->fingerprint =
170169
fmt("path:%s", store.queryPathInfo(*storePath)->narHash.to_string(HashFormat::SRI, true));
171170
settings.getCache()->upsert(

src/libflake-tests/nix_api_flake.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,7 @@ TEST_F(nix_api_store_test, nix_api_load_flake_with_flags)
377377
assert_ctx_ok();
378378
ASSERT_EQ("Claire", helloStr);
379379

380+
nix_locked_flake_free(lockedFlake);
380381
nix_flake_reference_parse_flags_free(parseFlags);
381382
nix_flake_lock_flags_free(lockFlags);
382383
nix_flake_reference_free(flakeReference);

src/libstore/build/build-log.cc

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#include "nix/store/build/build-log.hh"
2+
3+
namespace nix {
4+
5+
BuildLog::BuildLog(size_t maxTailLines, std::unique_ptr<Activity> act)
6+
: maxTailLines(maxTailLines)
7+
, act(std::move(act))
8+
{
9+
}
10+
11+
void BuildLog::operator()(std::string_view data)
12+
{
13+
for (auto c : data)
14+
if (c == '\r')
15+
currentLogLinePos = 0;
16+
else if (c == '\n')
17+
flushLine();
18+
else {
19+
if (currentLogLinePos >= currentLogLine.size())
20+
currentLogLine.resize(currentLogLinePos + 1);
21+
currentLogLine[currentLogLinePos++] = c;
22+
}
23+
}
24+
25+
void BuildLog::flush()
26+
{
27+
if (!currentLogLine.empty())
28+
flushLine();
29+
}
30+
31+
void BuildLog::flushLine()
32+
{
33+
// Truncate to actual content (currentLogLinePos may be less than size due to \r)
34+
currentLogLine.resize(currentLogLinePos);
35+
36+
if (!handleJSONLogMessage(currentLogLine, *act, builderActivities, "the derivation builder", false)) {
37+
// Line was not handled as JSON, emit and add to tail
38+
act->result(resBuildLogLine, currentLogLine);
39+
logTail.push_back(currentLogLine);
40+
if (logTail.size() > maxTailLines)
41+
logTail.pop_front();
42+
}
43+
44+
currentLogLine.clear();
45+
currentLogLinePos = 0;
46+
}
47+
48+
} // namespace nix

0 commit comments

Comments
 (0)