Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

clang-tidy with 1 extra custom rule executable 2GB+ #50837

Open Quuxplusone opened 2 years ago

Quuxplusone commented 2 years ago
Bugzilla Link PR51870
Status NEW
Importance P normal
Reported by Ben Morris (bensan.morris@googlemail.com)
Reported on 2021-09-15 08:38:49 -0700
Last modified on 2021-09-16 00:56:00 -0700
Version unspecified
Hardware Other Linux
CC alexfh@google.com, djasper@google.com, klimek@google.com
Fixed by commit(s)
Attachments
Blocks
Blocked by
See also
Hi, I've added some custom checks to clang-tidy and am building under CMake as
described below.

The generated clang-tidy executable is huge (2GB).

# just configure for building clang-tools-extra
cmake -G "Ninja" -B build -DLLVM_CCACHE_BUILD=ON -
DLLVM_CCACHE_DIR=$(CCACHE_DIR) -DLLVM_TARGETS_TO_BUILD=X86 -
DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra"

# build clang tidy
cd build
cmake --build . --config Release --target clang-tidy

Why is clang-tidy so large?

Also, regarding deployment of a custom clang-tidy I tried to generate an
install from the above configuration as follows:

# install so we can zip up and distribute just what we've configured above
cmake --install . --config Release --prefix some_path

but the make install failed owing to what appears to be targets (not built by
the above config) expecting to have been generated / installable.

Many thanks in advance,
Ben.
Quuxplusone commented 2 years ago

If I strip -s clang-tidy its file size reduces to 153MB (was 2GB)