authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2018-09-18 15:39:05-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2018-09-18 15:39:05-04:00
log84b963cb1b7cdc9b78eee315758914a9fae18064
tree73f3ab4c444a746239d933c64b393125d3475175
parent275b4100c0352cae6760797232489dba21bfb68f
parent148fe2e99970ca880a8e10ded5af308e28bbc342
signaturelock-open Commit is signed but in an unrecognized format.

Merge remote-tracking branch 'origin/master' into llvm7


1 files changed, 13 insertions(+), 8 deletions(-)

src/cache_hash.cpp+13-8
......@@ -441,18 +441,13 @@ static Error write_manifest_file(CacheHash *ch) {
441441}
442442
443443Error cache_final(CacheHash *ch, Buf *out_digest) {
444 Error err;
445
446444 assert(ch->manifest_file_path != nullptr);
447445
448 if (ch->manifest_dirty) {
449 if ((err = write_manifest_file(ch))) {
450 fprintf(stderr, "Warning: Unable to write cache file '%s': %s\n",
451 buf_ptr(ch->manifest_file_path), err_str(err));
452 }
453 }
454446 // We don't close the manifest file yet, because we want to
455447 // keep it locked until the API user is done using it.
448 // We also don't write out the manifest yet, because until
449 // cache_release is called we still might be working on creating
450 // the artifacts to cache.
456451
457452 uint8_t bin_digest[48];
458453 int rc = blake2b_final(&ch->blake, bin_digest, 48);
......@@ -465,5 +460,15 @@ Error cache_final(CacheHash *ch, Buf *out_digest) {
465460
466461void cache_release(CacheHash *ch) {
467462 assert(ch->manifest_file_path != nullptr);
463
464 Error err;
465
466 if (ch->manifest_dirty) {
467 if ((err = write_manifest_file(ch))) {
468 fprintf(stderr, "Warning: Unable to write cache file '%s': %s\n",
469 buf_ptr(ch->manifest_file_path), err_str(err));
470 }
471 }
472
468473 os_file_close(ch->manifest_file);
469474}