Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Install clang-19 and clang-14 on cpubuilder, enabling ASan builds. (#6)
Tested with the [`build_tools/cmake/build_and_test_asan.sh`](https://github.com/iree-org/iree/blob/main/build_tools/cmake/build_and_test_asan.sh) script from IREE. When I tried to build with ASan on clang-14, I got segfaults in llvm-tblgen and other tools. Not sure if that could be made to work, but rolling forward to a newer compiler seems fine for a sanitizer build. In the IREE repo, we had a split between `base` and `base-bleeding-edge` dockerfiles. Here, I'm just installing multiple compilers and letting the job choose between them (as on GitHub-managed runners). The binary size increase is fairly minor in the grand scheme of things. The diff to use this from IREE will look like this, at least for ASan (still working on TSan): ```diff ~/dev/projects/iree (users/scotttodd/ci_linux_x64_clang)$ git diff diff --git a/.github/workflows/ci_linux_x64_clang_asan.yml b/.github/workflows/ci_linux_x64_clang_asan.yml index d3d291af98..9274e84d67 100644 --- a/.github/workflows/ci_linux_x64_clang_asan.yml +++ b/.github/workflows/ci_linux_x64_clang_asan.yml @@ -34,21 +34,21 @@ jobs: - environment=${{ needs.setup.outputs.runner-env }} - cpu - os-family=Linux + container: ghcr.io/iree-org/cpubuilder_ubuntu_jammy_x86_64@sha256:latest + defaults: + run: + shell: bash steps: - name: "Checking out repository" uses: actions/[email protected] with: submodules: true - - name: "Building and testing with ASan" + - name: Install Python requirements + run: python3 -m pip install -r ./runtime/bindings/python/iree/runtime/build_requirements.txt + # TODO(#18238): add local or remote ccache + - name: Build and test with ASan env: - IREE_WRITE_REMOTE_CCACHE: ${{ needs.setup.outputs.write-caches }} - run: | - # Note that this uses the latest version of the clang compiler, etc. - # This gives us access to the latest features and validates that IREE - # builds using the latest versions. - ./build_tools/github_actions/docker_run.sh \ - --env "IREE_CCACHE_GCP_TOKEN=$(gcloud auth application-default print-access-token)" \ - --env "IREE_WRITE_REMOTE_CCACHE=${IREE_WRITE_REMOTE_CCACHE}" \ - --env "CCACHE_NAMESPACE=base-bleeding-edge@sha256:14200dacca3a0f3a66f8aa87c6f64729b83a2eeb403b689c24204074ad157418" \ - gcr.io/iree-oss/base-bleeding-edge@sha256:cf2e78194e64fd0166f4141317366261d7a62432b72e9a324cb8c2ff4e1a515a \ - ./build_tools/cmake/build_and_test_asan.sh + # The default compiler in this container (clang-14) is too old for ASan. + CC: clang-19 + CXX: clang++-19 + run: ./build_tools/cmake/build_and_test_asan.sh ```
- Loading branch information