Skip to content

Speed up binary_tidy: 37min -> 8min - #73647

Merged
pamarcos merged 11 commits into
masterfrom
speed-up-build-tidy
Dec 24, 2024
Merged

pamarcos merged 11 commits into
masterfrom
speed-up-build-tidy

Conversation

@pamarcos

@pamarcos pamarcos commented Dec 19, 2024 •

Copy link
Copy Markdown
Member

Linking takes a lot of the time for binary_tidy. Building also takes a bit, but since we're using sccache it's barely noticeable. In any case, we don't need to produce real binaries during the analysis stage, at least on the CI.

This PR speeds up the binary_tidy step 4.5x: from 37min to 8min:

  • Use dummy launchers by default for tidy builds. The launcher is used for building, linking and stripping. The launcher just creates an empty file to trick the build system. The tricky part is that we still need to use a real compiler for some parts of the code that generate other source files required: protoc, llvm-tlbgen and all their dependants. We surround those CMakeLists.txt with the prolog set_original_launchers_if_needed and close it with set_dummy_launchers_if_needed.
  • Allow running the build along with the static analysis by setting ENABLE_DUMMY_LAUNCHERS=0
  • Add the binary_tidy build for sync PRs. This job was broken for several days. Let's prevent that by running it now that it's very fast
  • Build job testing that the check works as expected after introducing a linting error on purpose at 4b90e75 (#73647): https://github.com/ClickHouse/ClickHouse/actions/runs/12430017196/job/34710092969?pr=73647

Changelog category (leave one):

  • CI Fix or Improvement (changelog entry is not required)

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):

...

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

Information about CI checks: https://clickhouse.com/docs/en/development/continuous-integration/

CI Settings (Only check the boxes if you know what you are doing):

  • Allow: All Required Checks
  • Allow: Stateless tests
  • Allow: Stateful tests
  • Allow: Integration Tests
  • Allow: Performance tests
  • Allow: All Builds
  • Allow: batch 1, 2 for multi-batch jobs
  • Allow: batch 3, 4, 5, 6 for multi-batch jobs

  • Exclude: Style check
  • Exclude: Fast test
  • Exclude: All with ASAN
  • Exclude: All with TSAN, MSAN, UBSAN, Coverage
  • Exclude: All with aarch64, release, debug

  • Run only fuzzers related jobs (libFuzzer fuzzers, AST fuzzers, etc.)
  • Exclude: AST fuzzers

  • Do not test
  • Woolen Wolfdog
  • Upload binaries for special builds
  • Disable merge-commit
  • Disable CI cache

@robot-clickhouse-ci-1 robot-clickhouse-ci-1 added pr-feature Pull request with new product feature submodule changed At least one submodule changed in this PR. labels Dec 19, 2024
@robot-ch-test-poll2 robot-ch-test-poll2 added pr-ci and removed pr-feature Pull request with new product feature labels Dec 19, 2024
@robot-ch-test-poll

robot-ch-test-poll commented Dec 19, 2024 •

Copy link
Copy Markdown
Contributor

This is an automated comment for commit 9fc4eec with description of existing statuses. It's updated for the latest CI running

✅ Click here to open a full report in a separate page

Successful checks
Check nameDescriptionStatus
BuildsThere's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
Docker keeper imageThe check to build and optionally push the mentioned image to docker hub✅ success
Docker server imageThe check to build and optionally push the mentioned image to docker hub✅ success
Docs checkBuilds and tests the documentation✅ success
Style checkRuns a set of checks to keep the code style clean. If some of tests failed, see the related log from the report✅ success

@pamarcos
pamarcos force-pushed the speed-up-build-tidy branch from ea6d1ab to fbfcfc8 Compare December 20, 2024 05:22
@pamarcos pamarcos changed the title Speed up build_tidy Speed up build_tidy: 37min -> 8min Dec 20, 2024
@pamarcos
pamarcos marked this pull request as ready for review December 20, 2024 07:49
@pamarcos
pamarcos requested a review from rschu1ze December 20, 2024 07:50
@divanik divanik self-assigned this Dec 20, 2024
Turns out that if we set the dummy launchers at
the end of the CMakeLists.txt, that'll be the one
used for that project.

In order to make sure that the original ones are
used, we need to set it outside of the add_subdirectory
statement.
Comment thread cmake/utils.cmake Resolved
Comment thread cmake/utils.cmake Resolved
Comment thread contrib/CMakeLists.txt Resolved
Comment thread docker/packager/packager Resolved
@pamarcos
pamarcos added this pull request to the merge queue Dec 24, 2024
Merged via the queue into master with commit af4d561 Dec 24, 2024
@pamarcos
pamarcos deleted the speed-up-build-tidy branch December 24, 2024 09:03
@robot-ch-test-poll2 robot-ch-test-poll2 added the pr-synced-to-cloud The PR is synced to the cloud repo label Dec 24, 2024
rschu1ze added a commit to rschu1ze/ClickHouse that referenced this pull request Jan 6, 2025
github-merge-queue Bot pushed a commit that referenced this pull request Jan 7, 2025
@pamarcos pamarcos changed the title Speed up build_tidy: 37min -> 8min Speed up binary_tidy: 37min -> 8min Jan 16, 2025
@Algunenano Algunenano added the 🚀 Fast CI 🥒 A fast database deserves a fast CI label Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🚀 Fast CI 🥒 A fast database deserves a fast CI pr-ci pr-synced-to-cloud The PR is synced to the cloud repo submodule changed At least one submodule changed in this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants