Skip to content

Commit

Permalink
Merge pull request #8260 from edolstra/lazy-trees-cherrypicks
Browse files Browse the repository at this point in the history
lazy-trees cherrypicks
  • Loading branch information
edolstra authored Apr 25, 2023
2 parents 249ce28 + 87f676b commit 946fd29
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/libexpr/eval-cache.cc
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,8 @@ string_t AttrCursor::getStringWithContext()
NixStringContext context;
copyContext(v, context);
return {v.string.s, std::move(context)};
} else if (v.type() == nPath)
}
else if (v.type() == nPath)
return {v.path().to_string(), {}};
else
root->state.error("'%s' is not a string but %s", getAttrPathStr()).debugThrow<TypeError>();
Expand Down
4 changes: 2 additions & 2 deletions src/libutil/tarfile.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ static ssize_t callback_read(struct archive * archive, void * _self, const void
*buffer = self->buffer.data();

try {
return self->source->read((char *) self->buffer.data(), 4096);
return self->source->read((char *) self->buffer.data(), self->buffer.size());
} catch (EndOfFile &) {
return 0;
} catch (std::exception & err) {
Expand All @@ -39,7 +39,7 @@ void TarArchive::check(int err, const std::string & reason)
throw Error(reason, archive_error_string(this->archive));
}

TarArchive::TarArchive(Source & source, bool raw) : buffer(4096)
TarArchive::TarArchive(Source & source, bool raw) : buffer(65536)
{
this->archive = archive_read_new();
this->source = &source;
Expand Down
1 change: 1 addition & 0 deletions src/libutil/tarfile.hh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ struct TarArchive {

~TarArchive();
};

void unpackTarfile(Source & source, const Path & destDir);

void unpackTarfile(const Path & tarFile, const Path & destDir);
Expand Down
6 changes: 4 additions & 2 deletions src/nix/build.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@ nlohmann::json builtPathsWithResultToJSON(const std::vector<BuiltPathWithResult>
std::visit([&](const auto & t) {
auto j = t.toJSON(store);
if (b.result) {
j["startTime"] = b.result->startTime;
j["stopTime"] = b.result->stopTime;
if (b.result->startTime)
j["startTime"] = b.result->startTime;
if (b.result->stopTime)
j["stopTime"] = b.result->stopTime;
if (b.result->cpuUser)
j["cpuUser"] = ((double) b.result->cpuUser->count()) / 1000000;
if (b.result->cpuSystem)
Expand Down

0 comments on commit 946fd29

Please sign in to comment.