aboutsummaryrefslogtreecommitdiff
path: root/src/zenremotestore/builds/buildstorageoperations.cpp
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2025-11-01 14:04:35 +0100
committerGitHub Enterprise <[email protected]>2025-11-01 14:04:35 +0100
commita58da97f98697580bf128ed5723ba720cc30f0dc (patch)
tree798e392ddf76128a506293dc0803aaf852203dcd /src/zenremotestore/builds/buildstorageoperations.cpp
parentfix use-after-free in TEST_CASE("compactcas.threadedinsert") (#620) (diff)
downloadzen-a58da97f98697580bf128ed5723ba720cc30f0dc.tar.xz
zen-a58da97f98697580bf128ed5723ba720cc30f0dc.zip
Various fixes to address issues flagged by gcc / non-UE toolchain build (#621)
* gcc: avoid using memset on nontrivial struct * redundant `return std::move` * fixed various compilation issues flagged by gcc * fix issue in xmake.lua detecting whether we are building with the UE toolchain or not * add GCC ignore -Wundef (comment is inaccurate) * remove redundant std::move * don't catch exceptions by value * unreferenced variables * initialize "by the book" instead of memset * remove unused exception reference * add #include <cstring> to fix gcc build * explicitly poulate KeyValueMap by traversing input spans fixes gcc compilation * remove unreferenced variable * eliminate redundant `std::move` which gcc complains about * fix gcc compilation by including <cstring> * tag unreferenced variable to fix gcc compilation * fixes for various cases of naming members the same as their type
Diffstat (limited to 'src/zenremotestore/builds/buildstorageoperations.cpp')
-rw-r--r--src/zenremotestore/builds/buildstorageoperations.cpp22
1 files changed, 15 insertions, 7 deletions
diff --git a/src/zenremotestore/builds/buildstorageoperations.cpp b/src/zenremotestore/builds/buildstorageoperations.cpp
index f106b7b18..ecf5853b8 100644
--- a/src/zenremotestore/builds/buildstorageoperations.cpp
+++ b/src/zenremotestore/builds/buildstorageoperations.cpp
@@ -180,7 +180,7 @@ namespace {
return SB.ToString();
}
- void DownloadLargeBlob(BuildStorage& Storage,
+ void DownloadLargeBlob(BuildStorageBase& Storage,
const std::filesystem::path& DownloadFolder,
const Oid& BuildId,
const IoHash& ChunkHash,
@@ -6804,7 +6804,7 @@ BuildsOperationUploadFolder::CompressChunk(const ChunkedFolderContent& Content,
}
BuildsOperationValidateBuildPart::BuildsOperationValidateBuildPart(BuildOpLogOutput& LogOutput,
- BuildStorage& Storage,
+ BuildStorageBase& Storage,
std::atomic<bool>& AbortFlag,
std::atomic<bool>& PauseFlag,
WorkerThreadPool& IOWorkerPool,
@@ -6883,15 +6883,23 @@ BuildsOperationValidateBuildPart::Execute()
ZEN_CONSOLE("Validating build part {}/{} ({})", m_BuildId, m_BuildPartId, NiceBytes(BuildPart.GetSize()));
}
std::vector<IoHash> ChunkAttachments;
- for (CbFieldView LooseFileView : BuildPart["chunkAttachments"sv].AsObjectView()["rawHashes"sv])
+ if (const CbObjectView ChunkAttachmentsView = BuildPart["chunkAttachments"sv].AsObjectView())
{
- ChunkAttachments.push_back(LooseFileView.AsBinaryAttachment());
+ for (CbFieldView LooseFileView : ChunkAttachmentsView["rawHashes"sv])
+ {
+ ChunkAttachments.push_back(LooseFileView.AsBinaryAttachment());
+ }
}
m_ValidateStats.ChunkAttachmentCount = ChunkAttachments.size();
std::vector<IoHash> BlockAttachments;
- for (CbFieldView BlocksView : BuildPart["blockAttachments"sv].AsObjectView()["rawHashes"sv])
+ if (const CbObjectView BlockAttachmentsView = BuildPart["blockAttachments"sv].AsObjectView())
{
- BlockAttachments.push_back(BlocksView.AsBinaryAttachment());
+ {
+ for (CbFieldView BlocksView : BlockAttachmentsView["rawHashes"sv])
+ {
+ BlockAttachments.push_back(BlocksView.AsBinaryAttachment());
+ }
+ }
}
m_ValidateStats.BlockAttachmentCount = BlockAttachments.size();
@@ -7375,7 +7383,7 @@ BuildsOperationPrimeCache::Execute()
CompositeBuffer
ValidateBlob(std::atomic<bool>& AbortFlag,
- BuildStorage& Storage,
+ BuildStorageBase& Storage,
const Oid& BuildId,
const IoHash& BlobHash,
uint64_t& OutCompressedSize,