diff --git a/.github/actions/1-setup/action.yml b/.github/actions/1-setup/action.yml index aa099699efe..ecc940839eb 100644 --- a/.github/actions/1-setup/action.yml +++ b/.github/actions/1-setup/action.yml @@ -121,8 +121,12 @@ runs: run: | set -euxo pipefail python3 --version - python3 -m pip install --user setuptools wheel - python3 -m pip install --user lit + if [[ '${{ runner.os }}-${{ inputs.arch }}' == 'macOS-arm64' ]]; then + brew install lit python-setuptools + else + python3 -m pip install --user setuptools wheel + python3 -m pip install --user lit + fi python3 -c "import lit.main; lit.main.main();" --version . | head -n 1 # the druntime tests require GNU make diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a01cc8875eb..9dec14ed55e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -51,6 +51,19 @@ jobs: -DEXTRA_CXXFLAGS=-flto=full with_pgo: true + - job_name: macOS arm64 + os: macos-14 + arch: arm64 + bootstrap_cmake_flags: >- + -DBUILD_LTO_LIBS=ON + -DD_COMPILER_FLAGS=-gcc=/usr/bin/c++ + extra_cmake_flags: >- + -DBUILD_LTO_LIBS=ON + -DD_COMPILER_FLAGS="-gcc=/usr/bin/c++ -O -flto=full -defaultlib=phobos2-ldc-lto,druntime-ldc-lto -L-exported_symbol '-L__*' -L-w" + # FIXME: 'LLVM ERROR: Unsupported stack probing method' when extending LTO to C++ parts and trying to link ldc2 + # -DEXTRA_CXXFLAGS=-flto=full + with_pgo: false # FIXME: ldc2-unittest hangs at runtime (at least sometimes?) with LTO+PGO + - job_name: Windows x64 os: windows-2022 arch: x64 @@ -76,12 +89,15 @@ jobs: runs-on: ${{ matrix.os }} timeout-minutes: 90 env: - MACOSX_DEPLOYMENT_TARGET: 10.12 + MACOSX_DEPLOYMENT_TARGET: ${{ matrix.arch == 'arm64' && '11.0' || '10.12' }} steps: - uses: actions/checkout@v3 with: submodules: true fetch-depth: 50 + - name: 'macOS 14: Switch to Xcode v15.3' + if: matrix.os == 'macos-14' + run: sudo xcode-select -switch /Applications/Xcode_15.3.app - name: Install prerequisites uses: ./.github/actions/1-setup with: @@ -160,19 +176,6 @@ jobs: matrix: include: - - job_name: macOS arm64 - host_os: macos-11 - os: osx - arch: arm64 - bootstrap_cmake_flags: -DD_COMPILER_FLAGS=-gcc=/usr/bin/c++ - # see native macOS job comment for extra flags (https://github.com/ldc-developers/ldc/issues/4462) - extra_cmake_flags: >- - -DBUILD_LTO_LIBS=ON - -DD_COMPILER_FLAGS="-O -flto=full -defaultlib=phobos2-ldc-lto,druntime-ldc-lto -L-exported_symbol '-L__*' -L-w" - -DEXTRA_CXXFLAGS=-flto=full - with_pgo: true - llvm_version: 17.0.6 # TODO - - job_name: Android armv7a host_os: ubuntu-20.04 os: android @@ -191,8 +194,6 @@ jobs: name: ${{ matrix.job_name }} runs-on: ${{ matrix.host_os }} timeout-minutes: 60 - env: - MACOSX_DEPLOYMENT_TARGET: 11.0 steps: - uses: actions/checkout@v4 with: @@ -202,7 +203,7 @@ jobs: uses: ./.github/actions/1-setup with: clang_version: ${{ env.CLANG_VERSION }} - llvm_version: ${{ matrix.llvm_version || env.LLVM_VERSION }} + llvm_version: ${{ env.LLVM_VERSION }} arch: x86_64 - name: Build bootstrap LDC uses: ./.github/actions/2-build-bootstrap @@ -218,7 +219,7 @@ jobs: with: arch: ${{ matrix.arch }} os: ${{ matrix.os }} - llvm_version: ${{ matrix.llvm_version || env.LLVM_VERSION }} + llvm_version: ${{ env.LLVM_VERSION }} cmake_flags: ${{ matrix.extra_cmake_flags }} with_pgo: ${{ matrix.with_pgo }} @@ -226,11 +227,6 @@ jobs: uses: ./.github/actions/5-install with: cross_compiling: true - - name: 'macOS: Cross-compile iOS libraries, copy to install dir & extend ldc2.conf' - if: matrix.os == 'osx' - uses: ./.github/actions/5a-ios - with: - arch: ${{ matrix.arch }} - name: 'Android: Cross-compile ${{ matrix.android_x86_arch }} libraries & copy to install dir' if: matrix.os == 'android' uses: ./.github/actions/5a-android-x86 @@ -249,9 +245,7 @@ jobs: name: macOS universal runs-on: macos-latest timeout-minutes: 30 - needs: - - build-native - - build-cross + needs: build-native steps: - uses: actions/checkout@v4 - name: Merge x86_64 & arm64 packages to universal one