From 28df9e57d886376d93a99a3a37348cb533e56959 Mon Sep 17 00:00:00 2001 From: Joel Rosdahl Date: Mon, 28 Sep 2020 14:56:43 +0200 Subject: [PATCH] Use ubuntu-18.04 instead of ubuntu-20.04 for Clang-Tidy MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The ubuntu-20.04 VM has intermittent build errors that look like this: sudo apt-get install libzstd-dev clang-tidy [...] The following packages have unmet dependencies: clang-tidy : Depends: clang-tidy-10 (>= 10~) but it is not going to be installed E: Unable to correct problems, you have held broken packages. Clang-Tidy 9 also found “function ... has a definition with different parameter names” warnings that needed to be fixed as part of this. As discussed in #670. --- .github/workflows/build.yaml | 2 +- src/Util.cpp | 4 ++-- src/hashutil.cpp | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 12fa97708..a6c89e319 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -152,7 +152,7 @@ jobs: apt_get: libzstd1-dev asciidoc xsltproc - name: Clang-Tidy - os: ubuntu-20.04 + os: ubuntu-18.04 CC: clang CXX: clang++ RUN_TESTS: 0 diff --git a/src/Util.cpp b/src/Util.cpp index 24e4b4f28..793507290 100644 --- a/src/Util.cpp +++ b/src/Util.cpp @@ -496,14 +496,14 @@ fallocate(int fd, long new_size) void for_each_level_1_subdir(const std::string& cache_dir, - const SubdirVisitor& subdir_visitor, + const SubdirVisitor& visitor, const ProgressReceiver& progress_receiver) { for (int i = 0; i <= 0xF; i++) { double progress = 1.0 * i / 16; progress_receiver(progress); std::string subdir_path = fmt::format("{}/{:x}", cache_dir, i); - subdir_visitor(subdir_path, [&](double inner_progress) { + visitor(subdir_path, [&](double inner_progress) { progress_receiver(progress + inner_progress / 16); }); } diff --git a/src/hashutil.cpp b/src/hashutil.cpp index 1ecc3ab40..1b54561bd 100644 --- a/src/hashutil.cpp +++ b/src/hashutil.cpp @@ -506,10 +506,10 @@ hash_command_output(Hash& hash, bool hash_multicommand_output(Hash& hash, - const std::string& commands, + const std::string& command, const std::string& compiler) { - for (const std::string& cmd : Util::split_into_strings(commands, ";")) { + for (const std::string& cmd : Util::split_into_strings(command, ";")) { if (!hash_command_output(hash, cmd, compiler)) { return false; } -- 2.47.3