From 54548a7923c3500bc8932792328a69667e17f098 Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Tue, 4 Nov 2025 22:43:01 +0000 Subject: [PATCH 1/7] [GitHub][CI] Split out build tool setup from code-lint containre This way it can be shared with another container. --- .../github-action-ci-tooling/Dockerfile | 36 +++++++++++-------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/.github/workflows/containers/github-action-ci-tooling/Dockerfile b/.github/workflows/containers/github-action-ci-tooling/Dockerfile index 707bdb309b789..c01811e49fa95 100644 --- a/.github/workflows/containers/github-action-ci-tooling/Dockerfile +++ b/.github/workflows/containers/github-action-ci-tooling/Dockerfile @@ -47,6 +47,26 @@ RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers # as root in 'ci-container-code-format' and 'ci-container-code-lint' containers +FROM base AS ci-container-build-tools + +COPY --from=llvm-downloader /llvm-extract/LLVM-${LLVM_VERSION}-Linux-X64/bin/clang-${LLVM_VERSION_MAJOR} \ + ${LLVM_SYSROOT}/bin/ +COPY --from=llvm-downloader /llvm-extract/LLVM-${LLVM_VERSION}-Linux-X64/lib/clang/${LLVM_VERSION_MAJOR}/include \ + ${LLVM_SYSROOT}/lib/clang/${LLVM_VERSION_MAJOR}/include +RUN ln -s ${LLVM_SYSROOT}/bin/clang-${LLVM_VERSION_MAJOR} ${LLVM_SYSROOT}/bin/clang && \ + ln -s ${LLVM_SYSROOT}/bin/clang ${LLVM_SYSROOT}/bin/clang++ + +RUN apt-get update && \ + DEBIAN_FRONTEND=noninteractive apt-get install -y \ + cmake \ + ninja-build && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* + +ENV CC=${LLVM_SYSROOT}/bin/clang +ENV CXX=${LLVM_SYSROOT}/bin/clang++ + + FROM base AS ci-container-code-format ARG LLVM_VERSION @@ -63,28 +83,14 @@ USER gha WORKDIR /home/gha -FROM base AS ci-container-code-lint +FROM base AS ci-container-build-tools ARG LLVM_VERSION ARG LLVM_VERSION_MAJOR COPY --from=llvm-downloader /llvm-extract/LLVM-${LLVM_VERSION}-Linux-X64/bin/clang-tidy \ - /llvm-extract/LLVM-${LLVM_VERSION}-Linux-X64/bin/clang-${LLVM_VERSION_MAJOR} \ ${LLVM_SYSROOT}/bin/ -COPY --from=llvm-downloader /llvm-extract/LLVM-${LLVM_VERSION}-Linux-X64/lib/clang/${LLVM_VERSION_MAJOR}/include \ - ${LLVM_SYSROOT}/lib/clang/${LLVM_VERSION_MAJOR}/include COPY clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py ${LLVM_SYSROOT}/bin/clang-tidy-diff.py -RUN ln -s ${LLVM_SYSROOT}/bin/clang-${LLVM_VERSION_MAJOR} ${LLVM_SYSROOT}/bin/clang && \ - ln -s ${LLVM_SYSROOT}/bin/clang ${LLVM_SYSROOT}/bin/clang++ - - -RUN apt-get update && \ - DEBIAN_FRONTEND=noninteractive apt-get install -y \ - cmake \ - ninja-build && \ - apt-get clean && \ - rm -rf /var/lib/apt/lists/* - # Install dependencies for 'pr-code-lint.yml' job COPY llvm/utils/git/requirements_linting.txt requirements_linting.txt RUN pip install -r requirements_linting.txt --break-system-packages && \ From 5001ad5c61fa9bbfe1e75a7ff6040fc713e7a026 Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Tue, 4 Nov 2025 23:14:01 +0000 Subject: [PATCH 2/7] [GitHub][CI] Add container for the abi-tests --- .../github-action-ci-tooling/Dockerfile | 25 ++++++++++++++++++- .github/workflows/llvm-abi-tests.yml | 21 +++------------- 2 files changed, 28 insertions(+), 18 deletions(-) diff --git a/.github/workflows/containers/github-action-ci-tooling/Dockerfile b/.github/workflows/containers/github-action-ci-tooling/Dockerfile index c01811e49fa95..7e02d2309e832 100644 --- a/.github/workflows/containers/github-action-ci-tooling/Dockerfile +++ b/.github/workflows/containers/github-action-ci-tooling/Dockerfile @@ -48,6 +48,8 @@ RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers FROM base AS ci-container-build-tools +ARG LLVM_VERSION +ARG LLVM_VERSION_MAJOR COPY --from=llvm-downloader /llvm-extract/LLVM-${LLVM_VERSION}-Linux-X64/bin/clang-${LLVM_VERSION_MAJOR} \ ${LLVM_SYSROOT}/bin/ @@ -83,7 +85,7 @@ USER gha WORKDIR /home/gha -FROM base AS ci-container-build-tools +FROM ci-container-build-tools AS ci-container-code-lint ARG LLVM_VERSION ARG LLVM_VERSION_MAJOR @@ -97,3 +99,24 @@ RUN pip install -r requirements_linting.txt --break-system-packages && \ rm requirements_linting.txt USER gha WORKDIR /home/gha + + +FROM ci-container-build-tools as ci-container-abi-tests + +RUN apt-get update && \ + DEBIAN_FRONTEND=noninteractive apt-get install -y \ + abi-compliance-checker \ + abi-dumper \ + autoconf \ + pkg-config && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* + +RUN git clone https://github.com/universal-ctags/ctags.git && \ + cd ctags && \ + ./autogen.sh && \ + ./configure && \ + sudo make install && \ + rm -Rf ../ctags + + diff --git a/.github/workflows/llvm-abi-tests.yml b/.github/workflows/llvm-abi-tests.yml index b0c2d32d4a41b..2418949d2ebb8 100644 --- a/.github/workflows/llvm-abi-tests.yml +++ b/.github/workflows/llvm-abi-tests.yml @@ -72,6 +72,8 @@ jobs: if: github.repository_owner == 'llvm' needs: abi-dump-setup runs-on: ubuntu-24.04 + container: + image: ${{ format('ghcr.io/{0}/ci-container-abi-tests',github.repository_owner) }} strategy: matrix: name: @@ -87,19 +89,6 @@ jobs: ref: ${{ github.sha }} repo: ${{ github.repository }} steps: - - name: Install Ninja - uses: llvm/actions/install-ninja@42d80571b13f4599bbefbc7189728b64723c7f78 # main - - name: Install abi-compliance-checker - run: | - sudo apt-get update - sudo apt-get -y install abi-dumper autoconf pkg-config - - name: Install universal-ctags - run: | - git clone https://github.com/universal-ctags/ctags.git - cd ctags - ./autogen.sh - ./configure - sudo make install - name: Download source code uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: @@ -143,6 +132,8 @@ jobs: abi-compare: if: github.repository_owner == 'llvm' runs-on: ubuntu-24.04 + container: + image: ${{ format('ghcr.io/{0}/ci-container-abi-tests',github.repository_owner) }} needs: - abi-dump-setup - abi-dump @@ -163,10 +154,6 @@ jobs: name: symbol-list path: symbol-list - - name: Install abi-compliance-checker - run: | - sudo apt-get update - sudo apt-get -y install abi-compliance-checker - name: Compare ABI run: | if [ -s symbol-list/llvm.symbols ]; then From 9809e74ec0f44ea7a25cf11a69a0155b50fd4090 Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Fri, 7 Nov 2025 03:20:17 +0000 Subject: [PATCH 3/7] Build the container --- .github/workflows/build-ci-container-tooling.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build-ci-container-tooling.yml b/.github/workflows/build-ci-container-tooling.yml index 46dc38fe600a3..a29b859a4c171 100644 --- a/.github/workflows/build-ci-container-tooling.yml +++ b/.github/workflows/build-ci-container-tooling.yml @@ -36,6 +36,9 @@ jobs: test-command: 'cd $HOME && clang-format --version | grep version && git-clang-format -h | grep usage && black --version | grep black' - container-name: code-lint test-command: 'cd $HOME && clang-tidy --version | grep version && clang-tidy-diff.py -h | grep usage' + + - container-name: abi-tests + test-command: 'cd $HOME && abi-compliance-checker --help' steps: - name: Checkout LLVM uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 From 68ab308ae0aded5ecd53bb4bf3dd6d379d32b8ab Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Fri, 7 Nov 2025 09:01:10 -0800 Subject: [PATCH 4/7] Update .github/workflows/containers/github-action-ci-tooling/Dockerfile Co-authored-by: Baranov Victor --- .github/workflows/containers/github-action-ci-tooling/Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/containers/github-action-ci-tooling/Dockerfile b/.github/workflows/containers/github-action-ci-tooling/Dockerfile index 7e02d2309e832..be61264b93753 100644 --- a/.github/workflows/containers/github-action-ci-tooling/Dockerfile +++ b/.github/workflows/containers/github-action-ci-tooling/Dockerfile @@ -119,4 +119,3 @@ RUN git clone https://github.com/universal-ctags/ctags.git && \ sudo make install && \ rm -Rf ../ctags - From 5c5e3f1a859e90909285c2e6f7cf4b3fc76ae07d Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Fri, 7 Nov 2025 16:54:38 +0000 Subject: [PATCH 5/7] Remove llvm-abi-tests changes --- .github/workflows/llvm-abi-tests.yml | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/.github/workflows/llvm-abi-tests.yml b/.github/workflows/llvm-abi-tests.yml index 2418949d2ebb8..b0c2d32d4a41b 100644 --- a/.github/workflows/llvm-abi-tests.yml +++ b/.github/workflows/llvm-abi-tests.yml @@ -72,8 +72,6 @@ jobs: if: github.repository_owner == 'llvm' needs: abi-dump-setup runs-on: ubuntu-24.04 - container: - image: ${{ format('ghcr.io/{0}/ci-container-abi-tests',github.repository_owner) }} strategy: matrix: name: @@ -89,6 +87,19 @@ jobs: ref: ${{ github.sha }} repo: ${{ github.repository }} steps: + - name: Install Ninja + uses: llvm/actions/install-ninja@42d80571b13f4599bbefbc7189728b64723c7f78 # main + - name: Install abi-compliance-checker + run: | + sudo apt-get update + sudo apt-get -y install abi-dumper autoconf pkg-config + - name: Install universal-ctags + run: | + git clone https://github.com/universal-ctags/ctags.git + cd ctags + ./autogen.sh + ./configure + sudo make install - name: Download source code uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: @@ -132,8 +143,6 @@ jobs: abi-compare: if: github.repository_owner == 'llvm' runs-on: ubuntu-24.04 - container: - image: ${{ format('ghcr.io/{0}/ci-container-abi-tests',github.repository_owner) }} needs: - abi-dump-setup - abi-dump @@ -154,6 +163,10 @@ jobs: name: symbol-list path: symbol-list + - name: Install abi-compliance-checker + run: | + sudo apt-get update + sudo apt-get -y install abi-compliance-checker - name: Compare ABI run: | if [ -s symbol-list/llvm.symbols ]; then From 794f7bb4b0de2a12bd3634293c773c83d7e71111 Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Fri, 7 Nov 2025 16:55:42 +0000 Subject: [PATCH 6/7] Fix formatting --- .github/workflows/build-ci-container-tooling.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build-ci-container-tooling.yml b/.github/workflows/build-ci-container-tooling.yml index da525335d2824..35f46e10fbb99 100644 --- a/.github/workflows/build-ci-container-tooling.yml +++ b/.github/workflows/build-ci-container-tooling.yml @@ -36,7 +36,6 @@ jobs: test-command: 'cd $HOME && clang-format --version | grep version && git-clang-format -h | grep usage && black --version | grep black' - container-name: code-lint test-command: 'cd $HOME && clang-tidy --version | grep version && clang-tidy-diff.py -h | grep usage' - - container-name: abi-tests test-command: 'cd $HOME && abi-compliance-checker --help' steps: From 31cdd97f1889ae41aed91d63757ec36759c94e0b Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Sat, 8 Nov 2025 01:13:07 +0000 Subject: [PATCH 7/7] Fix up target --- .github/workflows/build-ci-container-tooling.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-ci-container-tooling.yml b/.github/workflows/build-ci-container-tooling.yml index 170f875fadb28..531da2ccbd446 100644 --- a/.github/workflows/build-ci-container-tooling.yml +++ b/.github/workflows/build-ci-container-tooling.yml @@ -38,6 +38,7 @@ jobs: test-command: 'cd $HOME && clang-tidy --version | grep version && clang-tidy-diff.py -h | grep usage' - container-name: abi-tests test-command: 'cd $HOME && abi-compliance-checker --help' + target: abi-tests steps: - name: Checkout LLVM uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 @@ -54,7 +55,7 @@ jobs: with: container-name: ci-ubuntu-24.04-${{ matrix.container-name }} dockerfile: .github/workflows/containers/github-action-ci-tooling/Dockerfile - target: ci-container-code-${{ matrix.container-name }} + target: ci-container-${{ matrix.target || format('code-{0}', matrix.container-name) }} test-command: ${{ matrix.test-command }} push-ci-container: