Skip to content

Build LLVM from sources#66793

Closed
alexey-milovidov wants to merge 18 commits intomasterfrom
llvm-from-sources
Closed

Build LLVM from sources#66793
alexey-milovidov wants to merge 18 commits intomasterfrom
llvm-from-sources

Conversation

@alexey-milovidov
Copy link
Copy Markdown
Member

Changelog category (leave one):

  • Build/Testing/Packaging Improvement

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

Pin the compiler and tools version by building LLVM from sources. This eliminates a fragile supply-chain dependency. This closes #66493. See llvm/llvm-project#99453

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

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

@robot-ch-test-poll robot-ch-test-poll added the pr-build Pull request with build/testing/packaging improvement label Jul 20, 2024
@robot-ch-test-poll2
Copy link
Copy Markdown
Contributor

robot-ch-test-poll2 commented Jul 20, 2024

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

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

Check nameDescriptionStatus
Integration testsThe integration tests report. In parenthesis the package type is given, and in square brackets are the optional part/total tests❌ failure
Stateless testsRuns stateless functional tests for ClickHouse binaries built in various configurations -- release, debug, with sanitizers, etc❌ failure
Successful checks
Check nameDescriptionStatus
AST fuzzerRuns randomly generated queries to catch program errors. The build type is optionally given in parenthesis. If it fails, ask a maintainer for help✅ success
BuildsThere's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
ClickBenchRuns [ClickBench](https://github.com/ClickHouse/ClickBench/) with instant-attach table✅ success
Compatibility checkChecks that clickhouse binary runs on distributions with old libc versions. If it fails, ask a maintainer for help✅ 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
Fast testNormally this is the first check that is ran for a PR. It builds ClickHouse and runs most of stateless functional tests, omitting some. If it fails, further checks are not started until it is fixed. Look at the report to see which tests fail, then reproduce the failure locally as described here✅ success
Flaky testsChecks if new added or modified tests are flaky by running them repeatedly, in parallel, with more randomization. Functional tests are run 100 times with address sanitizer, and additional randomization of thread scheduling. Integration tests are run up to 10 times. If at least once a new test has failed, or was too long, this check will be red. We don't allow flaky tests, read the doc✅ success
Install packagesChecks that the built packages are installable in a clear environment✅ success
Performance ComparisonMeasure changes in query performance. The performance test report is described in detail here. In square brackets are the optional part/total tests✅ success
Push to DockerhubThe check for building and pushing the CI related docker images to docker hub✅ success
Stateful testsRuns stateful functional tests for ClickHouse binaries built in various configurations -- release, debug, with sanitizers, etc✅ success
Stress testRuns stateless functional tests concurrently from several clients to detect concurrency-related errors✅ 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
Unit testsRuns the unit tests for different release types✅ success
Upgrade checkRuns stress tests on server version from last release and then tries to upgrade it to the version from the PR. It checks if the new server can successfully startup without any errors, crashes or sanitizer asserts✅ success


# Install cmake 3.20+ for Rust support
# Used https://askubuntu.com/a/1157132 as reference
RUN curl -s https://apt.kitware.com/keys/kitware-archive-latest.asc | gpg --dearmor - > /etc/apt/trusted.gpg.d/kitware.gpg \
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may merge this in one big RUN so that we don't have intermediate layers with unnecessary dependencies.

@thevar1able thevar1able self-assigned this Jul 20, 2024
Copy link
Copy Markdown
Member

@alesapin alesapin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm strongly against building such complex tools as clang or llvm at docker build stage. It's very unclear, implicit, and slow down these jobs. All other CI jobs depend on them.

docker build command shouldn't take hours if your laptop is not powerful enough.

Let's introduce a separate job for it which will publish artifacts to S3. We can even introduce fancy URLs for them and it will be available for every clickhouse developer.

@thevar1able
Copy link
Copy Markdown
Member

I somewhat agree with @alesapin, this approach will work, but is very inefficient and will slow down CI significantly. Would be much nicer to make something like FROM clickhouse/llvm:<llvm-hash>, then that image could be rebuilt only on LLVM commit hash update.

@alexey-milovidov
Copy link
Copy Markdown
Member Author

alexey-milovidov commented Jul 22, 2024

The util Docker image is rebuilt only when it is changed, so it isn't a problem.

@alesapin
Copy link
Copy Markdown
Member

It's a huge problem. What if I want to use locally exactly the same compiler/llvm which CI uses? I have to rebuild it (what if my PC is slow), or execute weird commands to extract it from docker image. Separate job with artifacts is much better than this solution.

@alexey-milovidov
Copy link
Copy Markdown
Member Author

Ok, but this PR is still a step forward. Today you have a difficult way to get exactly the same compiler, either on your machine or in CI. After this pull request, it becomes easier.

@alexey-milovidov alexey-milovidov added the 🍃 green ci 🌿 Fixing flaky tests in CI label Jul 24, 2024
@alexey-milovidov
Copy link
Copy Markdown
Member Author

Reopen if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🍃 green ci 🌿 Fixing flaky tests in CI pr-build Pull request with build/testing/packaging improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Compile clang/llvm from sources

5 participants