diff --git a/.cirrus.yml b/.cirrus.yml deleted file mode 100644 index 00237d1b00e4b1e..000000000000000 --- a/.cirrus.yml +++ /dev/null @@ -1,107 +0,0 @@ -environment: - CIRRUS_CLONE_DEPTH: 50 - CLANG_VERSION: '15.0.3' # 15.0.6 requires a more recent libstdc++.so.6 than shipped with Ubuntu 20 - LLVM_PROJECTS_TO_ENABLE: compiler-rt;lld;bolt - # keep these in sync with .github/workflows/ldc-release.yml for Linux x64: - LLVM_TARGETS_TO_BUILD: all - LLVM_EXPERIMENTAL_TARGETS_TO_BUILD: SPIRV;Xtensa - BASE_CMAKE_FLAGS: -DLLVM_ENABLE_TERMINFO=OFF -DLLVM_ENABLE_LIBEDIT=OFF -DLLVM_USE_STATIC_ZSTD=TRUE -DCOMPILER_RT_INCLUDE_TESTS=OFF -DLLVM_INCLUDE_TESTS=OFF -DCOMPILER_RT_USE_LIBCXX=OFF - EXTRA_CMAKE_FLAGS: -DLLVM_BINUTILS_INCDIR=/usr/include -DLLVM_STATIC_LINK_CXX_STDLIB=ON - -task: - name: Ubuntu 20.04 $TASK_NAME_SUFFIX - compute_engine_instance: - image_project: ubuntu-os-cloud - image: family/ubuntu-2004-lts-arm64 - platform: linux - architecture: arm64 - cpu: 4 - memory: 8G - disk: 20 - timeout_in: 120m - environment: - PARALLELISM: 4 - GITHUB_TOKEN: ENCRYPTED[79b00f4f535df0fdfe3ceea87f9d4ec2ba7628e0c60730b99bcd91c7888af275409f02b2f1bc90015c2cb9cc4fb2dd12] - matrix: - - TASK_NAME_SUFFIX: aarch64 - LLVM_ENABLE_ASSERTIONS: 'OFF' - - TASK_NAME_SUFFIX: aarch64 withAsserts - LLVM_ENABLE_ASSERTIONS: 'ON' - install_prerequisites_script: | - export DEBIAN_FRONTEND=noninteractive - apt-get -q update - apt-get -yq install git-core curl xz-utils ninja-build g++ python3 pkg-config binutils-dev libxml2-dev libzstd-dev zlib1g-dev p7zip-full - # install a more recent version of CMake - curl -fL --retry 3 --max-time 300 -o cmake.tar.gz https://github.com/Kitware/CMake/releases/download/v3.28.4/cmake-3.28.4-linux-aarch64.tar.gz - mkdir cmake_bin - tar -xf cmake.tar.gz --strip 1 -C cmake_bin - rm cmake.tar.gz - # download & extract clang - curl -fL --retry 3 --max-time 300 -o clang.tar.xz https://github.com/llvm/llvm-project/releases/download/llvmorg-$CLANG_VERSION/clang+llvm-$CLANG_VERSION-aarch64-linux-gnu.tar.xz - mkdir clang_bin - tar -xf clang.tar.xz --strip 1 -C clang_bin - rm clang.tar.xz - # make lld the default linker - ln -sf "$PWD/clang_bin/bin/ld.lld" /usr/bin/ld - ld --version - clone_submodules_script: | - git submodule update --init --depth $CIRRUS_CLONE_DEPTH - build_script: | - export PATH="$PWD/cmake_bin/bin:$PATH" - export CC="$PWD/clang_bin/bin/clang" - export CXX="$PWD/clang_bin/bin/clang++" - nproc - free - cmake --version - ninja --version - mkdir build - cd build - cmake -G Ninja ../llvm \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_PREFIX=$PWD/../install \ - -DLLVM_ENABLE_PROJECTS="$LLVM_PROJECTS_TO_ENABLE" \ - -DLLVM_TARGETS_TO_BUILD="$LLVM_TARGETS_TO_BUILD" \ - -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD="$LLVM_EXPERIMENTAL_TARGETS_TO_BUILD" \ - -DLLVM_ENABLE_ASSERTIONS=$LLVM_ENABLE_ASSERTIONS \ - $BASE_CMAKE_FLAGS $EXTRA_CMAKE_FLAGS - ninja -j$PARALLELISM install - cd .. - pack_artifact_script: | - if [[ "${CIRRUS_TAG:-}" == ldc-v* ]]; then - artifactID=${CIRRUS_TAG:5} - else - artifactID=${CIRRUS_CHANGE_IN_REPO:0:8} - fi - assertsSuffix="" - if [[ "$LLVM_ENABLE_ASSERTIONS" == "ON" ]]; then - assertsSuffix="-withAsserts" - fi - artifactName=llvm-$artifactID-linux-aarch64$assertsSuffix - mv install $artifactName - chmod -R go=rX $artifactName - artifact=$artifactName.tar.xz - tar -cf - --owner=0 --group=0 $artifactName | 7za a $artifact -si -txz -mx9 -mmt$PARALLELISM - ls -lh $artifact - # Upload to GitHub release (only for branches and tags, no PRs) - upload_to_github_script: | - if [[ "${CIRRUS_TAG:-}" == ldc-v* ]]; then - releaseTag=$CIRRUS_TAG - elif [[ "${CIRRUS_TAG:-}" == "" && "${CIRRUS_PR:-}" == "" ]]; then - releaseTag=CI - else - echo 'Skipping upload' - exit 0 - fi - releaseID="$(set -eo pipefail; curl -fsS https://api.github.com/repos/ldc-developers/llvm-project/releases/tags/"$releaseTag" | grep '^ "id":' | head -n1 || echo "")" - if [[ "$releaseID" == "" ]]; then - echo "Error: no GitHub release found for tag '$releaseTag'" >&2 - exit 1 - fi - releaseID=${releaseID:8:-1} - artifact=$(ls llvm-*.tar.xz) - echo "Uploading $artifact to GitHub release $releaseTag ($releaseID)..." - curl -fsS \ - -H "Authorization: token $GITHUB_TOKEN" \ - -H "Content-Type: application/octet-stream" \ - --data-binary @$artifact \ - https://uploads.github.com/repos/ldc-developers/llvm-project/releases/$releaseID/assets?name=$artifact diff --git a/.github/actions/1-setup/action.yml b/.github/actions/1-setup/action.yml index fa87ad182ad511f..e3bb794e9776e14 100644 --- a/.github/actions/1-setup/action.yml +++ b/.github/actions/1-setup/action.yml @@ -15,9 +15,8 @@ runs: set -eux export DEBIAN_FRONTEND=noninteractive sudo apt-get -q update - sudo apt-get -yq install \ - git-core cmake g++ binutils-dev libzstd-dev python p7zip-full unzip - + sudo -E apt-get -yq install \ + git-core curl xz-utils cmake ninja-build g++ python3 pkg-config binutils-dev libxml2-dev libzstd-dev zlib1g-dev p7zip-full unzip - name: 'Linux: Download & extract clang' # into ../clang if: runner.os == 'Linux' shell: bash @@ -25,8 +24,13 @@ runs: set -eux cd .. version='${{ inputs.clang_version }}' + arch='${{ inputs.arch }}' + extraSuffix='' + if [[ $arch == x86_64 ]]; then + extraSuffix='-ubuntu-18.04' + fi curl -fL --retry 3 --max-time 300 -o clang.tar.xz \ - https://github.com/llvm/llvm-project/releases/download/llvmorg-$version/clang+llvm-$version-x86_64-linux-gnu-ubuntu-18.04.tar.xz + https://github.com/llvm/llvm-project/releases/download/llvmorg-$version/clang+llvm-$version-$arch-linux-gnu$extraSuffix.tar.xz mkdir clang tar -xf clang.tar.xz --strip 1 -C clang rm clang.tar.xz @@ -64,7 +68,8 @@ runs: echo "ASMFLAGS=-m32" >> $GITHUB_ENV fi - - name: Install ninja + - name: 'Non-Linux: Install ninja' + if: runner.os != 'Linux' uses: seanmiddleditch/gha-setup-ninja@v4 - name: 'Windows: Set LDC_VSDIR env variable' diff --git a/.github/actions/3-package/action.yml b/.github/actions/3-package/action.yml index c0b165ce23b990e..67ce97e0b97fbcd 100644 --- a/.github/actions/3-package/action.yml +++ b/.github/actions/3-package/action.yml @@ -68,8 +68,8 @@ runs: echo "ARTIFACT_ID=$artifactID" >> $GITHUB_ENV echo "ARTIFACT_NAME=$os-${{ inputs.arch }}$assertsSuffix" >> $GITHUB_ENV - - name: 'Linux: Pack source dir' - if: runner.os == 'Linux' && inputs.os == '' && inputs.with_asserts == 'false' + - name: 'Linux x86_64: Pack source dir' + if: runner.os == 'Linux' && inputs.os == '' && inputs.arch == 'x86_64' && inputs.with_asserts == 'false' shell: bash run: | set -euxo pipefail diff --git a/.github/workflows/ldc-release.yml b/.github/workflows/ldc-release.yml index 93c0bc3689ddff4..e2411321f91271e 100644 --- a/.github/workflows/ldc-release.yml +++ b/.github/workflows/ldc-release.yml @@ -33,18 +33,22 @@ jobs: os: windows-2022 arch: x64 with_asserts: false + clang_version: 19.1.3 # the MSVC headers require clang 16+ - job_name: Windows x64 withAsserts os: windows-2022 arch: x64 with_asserts: true + clang_version: 19.1.3 # the MSVC headers require clang 16+ - job_name: Windows x86 os: windows-2022 arch: x86 with_asserts: false + clang_version: 19.1.3 # the MSVC headers require clang 16+ - job_name: Windows x86 withAsserts os: windows-2022 arch: x86 with_asserts: true + clang_version: 19.1.3 # the MSVC headers require clang 16+ - job_name: Linux x86_64 os: ubuntu-20.04 arch: x86_64 @@ -53,6 +57,18 @@ jobs: os: ubuntu-20.04 arch: x86_64 with_asserts: true + - job_name: Linux aarch64 + os: ubuntu-22.04-arm # Ubuntu 20 not natively supported + container_image: ubuntu:20.04 + arch: aarch64 + with_asserts: false + clang_version: 15.0.3 # 15.0.6 requires a more recent libstdc++.so.6 than shipped with Ubuntu 20 + - job_name: Linux aarch64 withAsserts + os: ubuntu-22.04-arm # Ubuntu 20 not natively supported + container_image: ubuntu:20.04 + arch: aarch64 + with_asserts: true + clang_version: 15.0.3 # 15.0.6 requires a more recent libstdc++.so.6 than shipped with Ubuntu 20 - job_name: macOS arm64 os: macos-15 arch: arm64 @@ -71,16 +87,23 @@ jobs: with_asserts: true name: ${{ matrix.job_name }} runs-on: ${{ matrix.os }} + container: ${{ matrix.container_image }} timeout-minutes: 240 env: MACOSX_DEPLOYMENT_TARGET: ${{ matrix.arch == 'arm64' && '11.0' || '10.12' }} steps: + - name: 'Container: Install git and sudo' + if: matrix.container_image + shell: bash + run: | + set -eux + apt-get -q update + DEBIAN_FRONTEND=noninteractive apt-get -yq install git-core sudo - uses: actions/checkout@v4 - name: Install prerequisites uses: ./.github/actions/1-setup with: - # on Windows, the MSVC headers require clang 16+ - clang_version: ${{ runner.os == 'Windows' && '19.1.3' || env.CLANG_VERSION }} + clang_version: ${{ matrix.clang_version || env.CLANG_VERSION }} arch: ${{ matrix.arch }} # BOLT supports ELF binaries only, so include it for Linux packages only - name: Build & install LLVM incl. LLD, compiler-rt${{ runner.os == 'Linux' && ', BOLT' || '' }}