From: Joel Rosdahl Date: Thu, 18 Jun 2020 18:26:58 +0000 (+0200) Subject: Let “ccache --hash-file” perform raw hashing again X-Git-Tag: v4.0~389 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9875edc2e1de486d2db1131595a7a1a4fc858dce;p=thirdparty%2Fccache.git Let “ccache --hash-file” perform raw hashing again Unintended or not, #577 (213d9883) changed the behavior of “ccache --hash-file” to use hash_binary_file, which essentially performs hash(hash(path)) if the i-node cache is enabled, otherwise hash(path). This means that “ccache --hash-file” behaves differently depending on if i-node cache is enabled and also that it’s no longer usable for benchmarking purposes. Fix this by simply using “hash_file” again. --- diff --git a/src/ccache.cpp b/src/ccache.cpp index 7d4f9aaec..41f1e6332 100644 --- a/src/ccache.cpp +++ b/src/ccache.cpp @@ -2293,7 +2293,7 @@ handle_main_options(int argc, const char* const* argv) if (str_eq(optarg, "-")) { hash_fd(hash, STDIN_FILENO); } else { - hash_binary_file(ctx, hash, optarg); + hash_file(hash, optarg); } puts(hash_result(hash).to_string().c_str()); hash_free(hash);