mirror of
https://github.com/NixOS/nix
synced 2025-06-30 19:57:59 +02:00
LocalFSStore::getBuildLog(): Handle corrupted logs
This commit is contained in:
parent
ed5c0f69f2
commit
895a74a814
3 changed files with 21 additions and 14 deletions
|
@ -94,6 +94,7 @@ std::shared_ptr<std::string> LocalFSStore::getBuildLog(const Path & path_)
|
|||
|
||||
assertStorePath(path);
|
||||
|
||||
|
||||
if (!isDerivation(path)) {
|
||||
try {
|
||||
path = queryPathInfo(path)->deriver;
|
||||
|
@ -116,8 +117,12 @@ std::shared_ptr<std::string> LocalFSStore::getBuildLog(const Path & path_)
|
|||
if (pathExists(logPath))
|
||||
return std::make_shared<std::string>(readFile(logPath));
|
||||
|
||||
else if (pathExists(logBz2Path))
|
||||
return decompress("bzip2", readFile(logBz2Path));
|
||||
else if (pathExists(logBz2Path)) {
|
||||
try {
|
||||
return decompress("bzip2", readFile(logBz2Path));
|
||||
} catch (Error &) { }
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue