Skip to content

Slow Build Time with Ninja Build System for ClickHouse #66251

@Zawa-ll

Description

@Zawa-ll

Company or project name

No response

Question

Hello ClickHouse team,

I am experiencing significant delays while building ClickHouse using the ninja build system. Despite attempting several optimizations, the build process remains quite slow, particularly when running the command ninja clickhouse clickhouse-tests.

Steps to Reproduce:

Configure the build with cmake:
cmake -DCMAKE_C_COMPILER=$CC -DCMAKE_CXX_COMPILER=$CXX ..
Run the build using ninja:
ninja -j$(nproc) clickhouse clickhouse-tests

Error Logs:
When running the build, it seems to hang or take a particularly long time(nearly 48 hours so far) during certain steps. Here is an example output:

[18/2079] Building CXX object src/CMakeFiles/dbms.dir/Interpreters/InterpreterSystemQuery.cpp.o
FAILED: src/CMakeFiles/dbms.dir/Interpreters/InterpreterSystemQuery.cpp.o
...

Additional Context:
I am currently working on issue #66074 (SYSTEM LOAD PRIMARY KEY). The changes are in place, but due to the extended build times, I am unable to efficiently run the unit tests I added to verify the changes. Any guidance on how to further optimize the build process or potential areas to investigate would be greatly appreciated!

Attempts to Resolve
I have tried the following steps to optimize the build process:

Increased parallel jobs with -j20
Limited build targets
Cleared temporary files
Ensured sufficient disk space is available
Used ccache to speed up recompilations
Clean build

Metadata

Metadata

Assignees

No one assigned

    Labels

    buildquestionQuestion?st-need-infoWe need extra data to continue (waiting for response). Either some details or a repro of the issue.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions