Skip to content

Enough LLD changes to bootstrap OpenBSD on sparc64 #315821

Enough LLD changes to bootstrap OpenBSD on sparc64

Enough LLD changes to bootstrap OpenBSD on sparc64 #315821

Workflow file for this run

name: CI Checks
permissions:
contents: read
on:
pull_request:
types:
- opened
- synchronize
- reopened
# When a PR is closed, we still start this workflow, but then skip
# all the jobs, which makes it effectively a no-op. The reason to
# do this is that it allows us to take advantage of concurrency groups
# to cancel in progress CI jobs whenever the PR is closed.
- closed
push:
branches:
- 'release/**'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
jobs:
premerge-checks-linux:
name: Build and Test Linux${{ (startsWith(matrix.runs-on, 'depot-ubuntu-24.04-arm') && ' AArch64') || '' }}
if: >-
github.repository_owner == 'llvm' &&
(github.event_name != 'pull_request' || github.event.action != 'closed')
strategy:
fail-fast: false
matrix:
runs-on:
- depot-ubuntu-24.04-arm-16
- llvm-premerge-linux-runners
runs-on: ${{ matrix.runs-on }}
container:
# The llvm-premerge agents are already containers and running the
# this same image, so we can't use a container for the github action
# job. The depot containers are running on VMs, so we can use a
# container. This helps ensure the build environment is as close
# as possible on both the depot runners and the llvm-premerge runners.
image: ${{ (startsWith(matrix.runs-on, 'depot-ubuntu-24.04-arm') && format('ghcr.io/{0}/arm64v8/ci-ubuntu-24.04',github.repository_owner) ) || null }}
# --privileged is needed to run the lldb tests that disable aslr.
# The SCCACHE environment variables are need to be copied from the host
# to the container to make sure it is configured correctly to use the
# depot cache.
options: >-
--privileged
--env SCCACHE_WEBDAV_ENDPOINT
--env SCCACHE_WEBDAV_TOKEN
defaults:
run:
# The run step defaults to using sh as the shell when running in a
# container, so make bash the default to ensure consistency between
# container and non-container jobs.
shell: bash
steps:
- name: Checkout LLVM
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false
fetch-depth: 2
- name: Build and Test
timeout-minutes: 120
env:
GITHUB_TOKEN: ${{ github.token }}
GITHUB_PR_NUMBER: ${{ github.event.pull_request.number }}
run: |
git config --global --add safe.directory '*'
source <(git diff --name-only HEAD~1...HEAD | python3 .ci/compute_projects.py)
if [[ "${projects_to_build}" == "" ]]; then
echo "No projects to build"
exit 0
fi
echo "Building projects: ${projects_to_build}"
echo "Running project checks targets: ${project_check_targets}"
echo "Building runtimes: ${runtimes_to_build}"
echo "Running runtimes checks targets: ${runtimes_check_targets}"
echo "Running runtimes checks requiring reconfiguring targets: ${runtimes_check_targets_needs_reconfig}"
export CC=/opt/llvm/bin/clang
export CXX=/opt/llvm/bin/clang++
# The linux-premerge runners are hosted on GCP and have a different
# cache setup than the depot runners.
if [[ "${{ matrix.runs-on }}" = "llvm-premerge-linux-runners" ]]; then
# This environment variable is passes into the container through the
# runner pod definition. This differs between our two clusters which
# why we do not hardcode it.
export SCCACHE_GCS_BUCKET=$CACHE_GCS_BUCKET
export SCCACHE_GCS_RW_MODE=READ_WRITE
fi
env
# Set the idle timeout to zero to ensure sccache runs for the
# entire duration of the job. Otherwise it might stop if we run
# several test suites in a row and discard statistics that we want
# to save in the end.
export SCCACHE_IDLE_TIMEOUT=0
mkdir artifacts
SCCACHE_LOG=info SCCACHE_ERROR_LOG=$(pwd)/artifacts/sccache.log sccache --start-server
./.ci/monolithic-linux.sh "${projects_to_build}" "${project_check_targets}" "${runtimes_to_build}" "${runtimes_check_targets}" "${runtimes_check_targets_needs_reconfig}" "${enable_cir}"
- name: Upload Artifacts
# In some cases, Github will fail to upload the artifact. We want to
# continue anyways as a failed artifact upload is an infra failure, not
# a checks failure.
# https://github.com/actions/upload-artifact/issues/569
continue-on-error: true
if: '!cancelled()'
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: Premerge Artifacts (Linux ${{ runner.arch }})
path: artifacts/
retention-days: 5
include-hidden-files: 'true'
- name: Upload Comment
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
if: ${{ always() && !startsWith(matrix.runs-on, 'depot-ubuntu-24.04-arm') }}
continue-on-error: true
with:
name: workflow-args-x86-linux
path: |
comments-Linux-x86_64
premerge-checks-windows:
name: Build and Test Windows
if: >-
github.repository_owner == 'llvm' &&
(github.event_name != 'pull_request' || github.event.action != 'closed')
runs-on: llvm-premerge-windows-2022-runners
defaults:
run:
shell: bash
steps:
- name: Checkout LLVM
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false
fetch-depth: 2
- name: Compute Projects
id: vars
run: |
source <(git diff --name-only HEAD~1...HEAD | python .ci/compute_projects.py)
if [[ "${projects_to_build}" == "" ]]; then
echo "No projects to build"
fi
echo "Building projects: ${projects_to_build}"
echo "Running project checks targets: ${project_check_targets}"
echo "Building runtimes: ${runtimes_to_build}"
echo "Running runtimes checks targets: ${runtimes_check_targets}"
echo "windows-projects=${projects_to_build}" >> $GITHUB_OUTPUT
echo "windows-check-targets=${project_check_targets}" >> $GITHUB_OUTPUT
echo "windows-runtimes=${runtimes_to_build}" >> $GITHUB_OUTPUT
echo "windows-runtimes-check-targets=${runtimes_check_targets}" >> $GITHUB_OUTPUT
- name: Build and Test
timeout-minutes: 180
if: ${{ steps.vars.outputs.windows-projects != '' }}
shell: cmd
env:
GITHUB_TOKEN: ${{ github.token }}
GITHUB_PR_NUMBER: ${{ github.event.pull_request.number }}
WINDOWS_PROJECTS: ${{ steps.vars.outputs.windows-projects }}
WINDOWS_CHECK_TARGETS: ${{ steps.vars.outputs.windows-check-targets }}
WINDOWS_RUNTIMES: ${{ steps.vars.outputs.windows-runtimes }}
WINDOWS_RUNTIMES_CHECK_TARGETS: ${{ steps.vars.outputs.windows-runtimes-check-targets }}
run: |
call C:\\BuildTools\\Common7\\Tools\\VsDevCmd.bat -arch=amd64 -host_arch=amd64
# See the comments above in the Linux job for why we define each of
# these environment variables.
bash -c "export SCCACHE_GCS_BUCKET=$CACHE_GCS_BUCKET; export SCCACHE_GCS_RW_MODE=READ_WRITE; export SCCACHE_IDLE_TIMEOUT=0; mkdir artifacts; SCCACHE_LOG=info SCCACHE_ERROR_LOG=$(pwd)/artifacts/sccache.log sccache --start-server; .ci/monolithic-windows.sh \"$WINDOWS_PROJECTS\" \"$WINDOWS_CHECK_TARGETS\" \"$WINDOWS_RUNTIMES\" \"$WINDOWS_RUNTIMES_CHECK_TARGETS\""
- name: Upload Artifacts
# In some cases, Github will fail to upload the artifact. We want to
# continue anyways as a failed artifact upload is an infra failure, not
# a checks failure.
# https://github.com/actions/upload-artifact/issues/569
continue-on-error: true
if: '!cancelled()'
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: Premerge Artifacts (Windows)
path: artifacts/
retention-days: 5
include-hidden-files: 'true'
- name: Upload Comment
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
if: always()
continue-on-error: true
with:
name: workflow-args-windows
path: |
comments-Windows-AMD64
# Computes which projects/check-targets to build and test on the
# self-hosted macOS runners. This job intentionally runs on a
# GitHub-hosted runner rather than a self-hosted one, since self-hosted
# macOS capacity is limited and shouldn't be spent just to compute what
# to build. Its outputs feed premerge-check-macos below, which does the
# actual build/test on the self-hosted runners, so changes here directly
# affect what runs there.
premerge-compute-macos:
name: Compute macOS Projects
if: >-
github.repository_owner == 'llvm' &&
(github.event_name != 'pull_request' || github.event.action != 'closed')
runs-on: ubuntu-22.04
permissions:
contents: read
pull-requests: read
outputs:
macos-projects: ${{ steps.vars.outputs.macos-projects }}
macos-check-targets: ${{ steps.vars.outputs.macos-check-targets }}
steps:
# For pull requests we get the changed files from the GitHub API, so we
# only need a sparse checkout of .ci/ to run compute_projects.py. For
# pushes (e.g. release branches) there is no PR to query, so we fall
# back to a git diff, which needs real history.
- name: Checkout LLVM (sparse)
if: github.event_name == 'pull_request'
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false
sparse-checkout: .ci
sparse-checkout-cone-mode: false
- name: Checkout LLVM
if: github.event_name != 'pull_request'
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false
fetch-depth: 2
- name: Get Changed Files
env:
GH_TOKEN: ${{ github.token }}
PR_NUMBER: ${{ github.event.pull_request.number }}
REPO: ${{ github.repository }}
run: |
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
gh api "repos/${REPO}/pulls/${PR_NUMBER}/files" --paginate --jq '.[].filename' > /tmp/changed_files.txt
else
git diff --name-only HEAD~1...HEAD > /tmp/changed_files.txt
fi
- name: Compute Projects
id: vars
run: |
python3 .ci/compute_projects.py Darwin < /tmp/changed_files.txt > /tmp/env_vars.sh
source /tmp/env_vars.sh
echo "Building projects: ${projects_to_build}"
echo "Running project checks targets: ${project_check_targets}"
echo "Building runtimes: ${runtimes_to_build}"
echo "Running runtimes checks targets: ${runtimes_check_targets}"
echo "Running runtimes checks requiring reconfiguring targets: ${runtimes_check_targets_needs_reconfig}"
echo "macos-projects=${projects_to_build}" >> $GITHUB_OUTPUT
echo "macos-check-targets=${project_check_targets}" >> $GITHUB_OUTPUT
premerge-check-macos:
name: Build and Test macOS arm64
needs: premerge-compute-macos
runs-on: [self-hosted, macOS, ARM64, apple-runners]
# Skip the self-hosted runner entirely if there is nothing to build,
# rather than tying up a runner slot for a no-op run.
if: >-
github.repository_owner == 'llvm' &&
(github.event_name != 'pull_request' || github.event.action != 'closed') &&
needs.premerge-compute-macos.outputs.macos-projects != ''
steps:
- name: Checkout LLVM
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false
fetch-depth: 2
- name: Install Ninja, CMake, and sccache
run: |
brew install ninja cmake
command -v sccache >/dev/null || brew install sccache
- name: Build and Test
timeout-minutes: 240
env:
SCCACHE_BUCKET: sccache-bucket
SCCACHE_REGION: us-west-2
PROJECTS: ${{ needs.premerge-compute-macos.outputs.macos-projects }}
CHECK_TARGETS: ${{ needs.premerge-compute-macos.outputs.macos-check-targets }}
CLANG_TOOLCHAIN_PROGRAM_TIMEOUT: 120
run: |
export SCCACHE_IDLE_TIMEOUT=0
mkdir -p artifacts
SCCACHE_LOG=info SCCACHE_ERROR_LOG=$(pwd)/artifacts/sccache.log sccache --start-server
xcrun cmake -G Ninja \
-B build \
-S llvm \
-DLLVM_ENABLE_PROJECTS="${PROJECTS}" \
-DLLVM_DISABLE_ASSEMBLY_FILES=ON \
-DCMAKE_BUILD_TYPE=Release \
-DLLDB_INCLUDE_TESTS=OFF \
-DLLVM_ENABLE_ASSERTIONS=ON \
-DCMAKE_C_COMPILER_LAUNCHER=sccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache
ninja -C build ${CHECK_TARGETS}
- name: Show sccache stats
if: always()
run: |
mkdir -p artifacts
sccache --show-stats
sccache --show-stats >> artifacts/sccache_stats.txt
- name: Upload Artifacts
# In some cases, Github will fail to upload the artifact. We want to
# continue anyways as a failed artifact upload is an infra failure, not
# a checks failure.
# https://github.com/actions/upload-artifact/issues/569
continue-on-error: true
if: '!cancelled()'
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: Premerge Artifacts (macOS arm64)
path: artifacts/
retention-days: 5
include-hidden-files: 'true'