[all-commits] [llvm/llvm-project] db2315: [clang] Merge gtest binaries into AllClangUnitTest...

Reid Kleckner via All-commits all-commits at lists.llvm.org
Tue Apr 29 06:32:29 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: db2315afa8db1153e3b85d452cd14d5a1b957350
      https://github.com/llvm/llvm-project/commit/db2315afa8db1153e3b85d452cd14d5a1b957350
  Author: Reid Kleckner <rnk at google.com>
  Date:   2025-04-29 (Tue, 29 Apr 2025)

  Changed paths:
    M clang/lib/CodeGen/BackendUtil.cpp
    M clang/unittests/CMakeLists.txt
    M clang/unittests/Driver/ModuleCacheTest.cpp
    M clang/unittests/Frontend/OutputStreamTest.cpp
    M clang/unittests/Interpreter/CMakeLists.txt
    M clang/unittests/Interpreter/ExceptionTests/CMakeLists.txt
    M clang/unittests/Parse/CMakeLists.txt

  Log Message:
  -----------
  [clang] Merge gtest binaries into AllClangUnitTests (#134196)

This reduces the size of the clang/unittests build directory by 64% and
my overall build dir size by 5%. Static linking is the real driving
factor here, but even if the default build configuration used shared
libraries, I don't see why we should be building so many unit test
binaries.

To make the project more approachable for new contributors, I'm
attempting to make the build a bit less resource-intensive. Build
directory size is a common complaint, and this is low-hanging fruit.

I've noticed that incremental builds leave behind the old, stale gtest binaries, and lit will keep running them. This mostly doesn't matter unless they use shared libraries, which will eventually stop working after successive builds. You can clean up the old test binaries with this command in the build directory:
  $ find tools/clang/unittests/ -iname '*Tests' -type f | xargs rm

... or you can simply clean the build directory in a more holistic way.

---------

Co-authored-by: Petr Hosek <phosek at google.com>



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list