ClickHouse / ClickHouse/ClickHouse

Remove useless "install" from CMake

Open
#36,588 3 comments 0 reactions 0 assignees View on GitHub
build comp-build-system
Dominant language
C++
Stars
49.9k
Forks
9k
Avg merge
21h 32m
Merged PRs (30d)
515

Description

Step 1: remove useless "install" directives. Examples:

```
Apr 22 06:07:27 [41/42] Install the project...
Apr 22 06:07:27 -- Install configuration: "RelWithDebInfo"
Apr 22 06:07:27 -- Installing: /build/packages/root/usr/lib/libglibc-compatibility.a
Apr 22 06:07:27 -- Installing: /build/packages/root/usr/lib/libmemcpy.a
Apr 22 06:07:27 -- Installing: /build/packages/root/usr/lib/libharmful.a
Apr 22 06:07:27 -- Installing: /build/packages/root/usr/lib/libunwind.a
Apr 22 06:07:27 -- Installing: /build/packages/root/usr/lib/libcxxabi.a
Apr 22 06:07:27 -- Installing: /build/packages/root/usr/lib/libcxx.a
Apr 22 06:07:27 -- Installing: /build/packages/root/usr/cmake/global.cmake
Apr 22 06:07:27 -- Installing: /build/packages/root/usr/cmake/global-relwithdebinfo.cmake
Apr 22 06:07:27 -- Installing: /build/packages/root/etc/clickhouse-server/config.xml
Apr 22 06:07:27 -- Installing: /build/packages/root/etc/clickhouse-server/users.xml
Apr 22 06:07:27 -- Installing: /build/packages/root/etc/clickhouse-client/config.xml
Apr 22 06:07:27 -- Installing: /build/packages/root/usr/share/bash-completion/completions/clickhouse-bootstrap
Apr 22 06:07:27 -- Installing: /build/packages/root/usr/share/bash-completion/completions/clickhouse-client
Apr 22 06:07:27 -- Installing: /build/packages/root/usr/share/bash-completion/completions/clickhouse-local
Apr 22 06:07:27 -- Installing: /build/packages/root/usr/share/bash-completion/completions/clickhouse-benchmark
Apr 22 06:07:27 -- Installing: /build/packages/root/usr/share/bash-completion/completions/clickhouse
Apr 22 06:07:27 -- Installing: /build/packages/root/etc/clickhouse-keeper/keeper_config.xml
Apr 22 06:07:27 -- Installing: /build/packages/root/usr/bin/clickhouse-keeper
Apr 22 06:07:27 -- Installing: /build/packages/root/usr/lib/debug/usr/bin/clickhouse-keeper.debug/clickhouse-keeper.debug
Apr 22 06:07:27 -- Installing: /build/packages/root/usr/bin/clickhouse-odbc-bridge
Apr 22 06:07:27 -- Installing: /build/packages/root/usr/lib/debug/usr/bin/clickhouse-odbc-bridge.debug/clickhouse-odbc-bridge.debug
Apr 22 06:07:27 -- Installing: /build/packages/root/usr/bin/clickhouse-library-bridge
Apr 22 06:07:28 -- Installing: /build/packages/root/usr/lib/debug/usr/bin/clickhouse-library-bridge.debug/clickhouse-library-bridge.debug
Apr 22 06:07:28 -- Installing: /build/packages/root/usr/bin/clickhouse-server
Apr 22 06:07:28 -- Installing: /build/packages/root/usr/bin/clickhouse-client
Apr 22 06:07:28 -- Installing: /build/packages/root/usr/bin/clickhouse-local
Apr 22 06:07:28 -- Installing: /build/packages/root/usr/bin/clickhouse-benchmark
Apr 22 06:07:28 -- Installing: /build/packages/root/usr/bin/clickhouse-copier
Apr 22 06:07:28 -- Installing: /build/packages/root/usr/bin/clickhouse-extract-from-config
Apr 22 06:07:28 -- Installing: /build/packages/root/usr/bin/clickhouse-compressor
Apr 22 06:07:28 -- Installing: /build/packages/root/usr/bin/clickhouse-format
Apr 22 06:07:28 -- Installing: /build/packages/root/usr/bin/clickhouse-obfuscator
Apr 22 06:07:28 -- Installing: /build/packages/root/usr/bin/clickhouse-git-import
Apr 22 06:07:28 -- Installing: /build/packages/root/usr/bin/clickhouse-static-files-disk-uploader
Apr 22 06:07:28 -- Installing: /build/packages/root/usr/bin/clickhouse-keeper-converter
Apr 22 06:07:28 -- Installing: /build/packages/root/usr/bin/clickhouse
Apr 22 06:07:28 -- Installing: /build/packages/root/usr/lib/debug/usr/bin/clickhouse.debug/clickhouse.debug
Apr 22 06:07:29 -- Installing: /build/packages/root/usr/bin/clickhouse-report
Apr 22 06:07:29 + bash -x /build/packages/build
```

Step 2: don't use "install" from CMake at all.

Motivation:

The "install" feature from CMake is intended for installation of the built project to the system. It does not make sense for ClickHouse, because CMake is not being able to correctly install it. Nevertheless, it has been used to copy some files to some subdirectories before converting these subdirectories to packages. It was used when "debian" packages infrastructure was used. We don't use it anymore, so the "install" feature of CMake appeared almost useless. The risk of misunderstanding this feature by developers and the risk of accumulation of garbage remains. A second point is that CMake is very complex piece of technology, and it is reasonable to use it as little as possible, avoiding most of the features. We already get rid of most of its features like "find_library", because we are using hermetic builds. This will also help to switch to different build systems (like Bazel) more easily, anticipating the trend that CMake will become less and less relevant.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.