From 99221a546b10545a7ed7af53044b088217e150eb Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 9 Sep 2021 08:43:34 +0200 Subject: Compress result manifest uploaded by worker These files contain build logs and can be quite large. And large files sometimes trip up upload on Windows. --- bbot/utility.txx | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'bbot/utility.txx') diff --git a/bbot/utility.txx b/bbot/utility.txx index e485a80..3199a61 100644 --- a/bbot/utility.txx +++ b/bbot/utility.txx @@ -150,8 +150,25 @@ namespace bbot if (!file_exists (f)) fail (fh) << what << " manifest file " << f << " does not exist"; - ifdstream ifs (f); - return parse_manifest (ifs, f.string (), what, fh, iu); + bool d (f.extension () == "lz4"); + + ifdstream ifs (f, (d + ? ifdstream::badbit + : ifdstream::badbit | ifdstream::failbit)); + ilz4stream izs; + + if (d) + izs.open (ifs, true /* end */); + + return parse_manifest (d + ? static_cast (izs) + : static_cast (ifs), + f.string (), what, fh, iu); + } + catch (const invalid_argument& e) // Invalid compressed content. + { + fail (fh) << "invalid " << what << " manifest " << f << ": " << e + << endf; } catch (const system_error& e) // EACCES, etc. { -- cgit v1.1