diff --git a/.github/actions/get-msys2/action.yml b/.github/actions/get-msys2/action.yml index 7351a120ac4..4082aad0c1a 100644 --- a/.github/actions/get-msys2/action.yml +++ b/.github/actions/get-msys2/action.yml @@ -25,20 +25,49 @@ name: 'Get MSYS2' description: 'Download MSYS2 and prepare a Windows host' +inputs: + architecture: + description: 'Architecture' + required: true runs: using: composite steps: - - name: 'Install MSYS2' - id: msys2 + - name: 'Install MSYS2 on x86.x64' + id: msys2-x64 uses: msys2/setup-msys2@v2.31.0 with: install: 'autoconf tar unzip zip make' path-type: minimal release: false + if: ${{ inputs.architecture == 'x86.x64' }} + + - name: 'Install MSYS2 on ARM64' + id: msys2-arm64 + uses: msys2/setup-msys2@v2.31.0 + with: + install: 'autoconf tar unzip zip make' + path-type: minimal + release: true + location: ${{ runner.tool_cache }}/msys2 + if: ${{ inputs.architecture == 'ARM64' }} # We can't run bash until this is completed, so stick with pwsh - - name: 'Set MSYS2 path' + - name: 'Set MSYS2 path for x64' run: | - echo "${{ steps.msys2.outputs.msys2-location }}/usr/bin" >> $env:GITHUB_PATH + echo "${{ steps.msys2-x64.outputs.msys2-location }}/usr/bin" >> $env:GITHUB_PATH shell: pwsh + if: ${{ inputs.architecture == 'x86.x64' }} + + - name: 'Set MSYS2 path for ARM64' + run: | + echo "${{ steps.msys2-arm64.outputs.msys2-location }}/usr/bin" >> $env:GITHUB_PATH + shell: pwsh + if: ${{ inputs.architecture == 'ARM64' }} + + # Remove the default config.site file provided by MSYS2 to ensure config.guess accurately detects the host system. + - name: 'Remove default config.site' + run: | + echo "Removing default config.site" + rm -f /etc/config.site + shell: env /usr/bin/bash --login -eo pipefail {0} diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index 49071de7771..002cbe7cd56 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -48,7 +48,7 @@ on: msvc-toolset-version: required: true type: string - msvc-toolset-architecture: + architecture: required: true type: string configure-arguments: @@ -90,12 +90,14 @@ jobs: - name: 'Get MSYS2' uses: ./.github/actions/get-msys2 + with: + architecture: ${{ inputs.architecture }} - name: 'Get the BootJDK' id: bootjdk uses: ./.github/actions/get-bootjdk with: - platform: windows-x64 + platform: ${{ inputs.platform }} - name: 'Get JTReg' id: jtreg @@ -105,26 +107,49 @@ jobs: id: gtest uses: ./.github/actions/get-gtest - - name: 'Check toolchain installed' - id: toolchain-check + - name: 'Check toolchain installed for x64' + id: toolchain-check-x64 run: | set +e '/c/Program Files/Microsoft Visual Studio/2022/Enterprise/vc/auxiliary/build/vcvars64.bat' -vcvars_ver=${{ inputs.msvc-toolset-version }} if [ $? -eq 0 ]; then - echo "Toolchain is already installed" + echo "Toolchain is already installed for x64" echo "toolchain-installed=true" >> $GITHUB_OUTPUT else - echo "Toolchain is not yet installed" + echo "Toolchain is not yet installed for x64" echo "toolchain-installed=false" >> $GITHUB_OUTPUT fi + if: ${{ inputs.architecture == 'x86.x64' }} - - name: 'Install toolchain and dependencies' + - name: 'Check toolchain installed for ARM64' + id: toolchain-check-arm64 + run: | + set +e + "/c/Program Files/Microsoft Visual Studio/2022/Enterprise/vc/auxiliary/build/vcvarsarm64.bat" -vcvars_ver=${{ inputs.msvc-toolset-version }} + if [ $? -eq 0 ]; then + echo "Toolchain is already installed for ARM64" + echo "toolchain-installed=true" >> $GITHUB_OUTPUT + else + echo "Toolchain is not yet installed for ARM64" + echo "toolchain-installed=false" >> $GITHUB_OUTPUT + fi + if: ${{ inputs.architecture == 'ARM64' }} + + - name: 'Install toolchain and dependencies for x64' run: | # Run Visual Studio Installer '/c/Program Files (x86)/Microsoft Visual Studio/Installer/vs_installer.exe' \ modify --quiet --installPath 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise' \ - --add Microsoft.VisualStudio.Component.VC.${{ inputs.msvc-toolset-version }}.${{ inputs.msvc-toolset-architecture }} - if: steps.toolchain-check.outputs.toolchain-installed != 'true' + --add Microsoft.VisualStudio.Component.VC.${{ inputs.msvc-toolset-version }}.x86.x64 + if: ${{ (inputs.architecture == 'x86.x64') && (steps.toolchain-check-x64.outputs.toolchain-installed != 'true') }} + + - name: 'Install toolchain and dependencies for ARM64' + run: | + # Run Visual Studio Installer + '/c/Program Files (x86)/Microsoft Visual Studio/Installer/vs_installer.exe' \ + modify --quiet --installPath 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise' \ + --add Microsoft.VisualStudio.Component.VC.${{ inputs.msvc-toolset-version }}.ARM64 + if: ${{ ( inputs.architecture == 'ARM64') && (steps.toolchain-check-arm64.outputs.toolchain-installed != 'true') }} - name: 'Configure' run: > diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 44eb5b48a9a..bcb9ea6e0b8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -370,8 +370,8 @@ jobs: with: platform: windows-x64 runs-on: windows-2022 + architecture: 'x86.x64' msvc-toolset-version: '14.44' - msvc-toolset-architecture: 'x86.x64' configure-arguments: ${{ github.event.inputs.configure-arguments }} make-arguments: ${{ github.event.inputs.make-arguments }} dry-run: ${{ needs.prepare.outputs.dry-run == 'true' }} @@ -383,11 +383,9 @@ jobs: uses: ./.github/workflows/build-windows.yml with: platform: windows-aarch64 - runs-on: windows-2022 + runs-on: windows-11-arm + architecture: 'ARM64' msvc-toolset-version: '14.44' - msvc-toolset-architecture: 'arm64' - make-target: 'hotspot' - extra-conf-options: '--openjdk-target=aarch64-unknown-cygwin' configure-arguments: ${{ github.event.inputs.configure-arguments }} make-arguments: ${{ github.event.inputs.make-arguments }} dry-run: ${{ needs.prepare.outputs.dry-run == 'true' }} @@ -477,6 +475,21 @@ jobs: with: platform: windows-x64 bootjdk-platform: windows-x64 + architecture: 'x86.x64' runs-on: windows-2022 dry-run: ${{ needs.prepare.outputs.dry-run == 'true' }} debug-suffix: -debug + + test-windows-aarch64: + name: windows-aarch64 + needs: + - prepare + - build-windows-aarch64 + uses: ./.github/workflows/test.yml + with: + platform: windows-aarch64 + bootjdk-platform: windows-aarch64 + architecture: 'ARM64' + runs-on: windows-11-arm + dry-run: ${{ needs.prepare.outputs.dry-run == 'true' }} + debug-suffix: -debug diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b240b42fb97..6270e44d746 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -37,6 +37,9 @@ on: runs-on: required: true type: string + architecture: + required: false + type: string xcode-toolset-version: required: false type: string @@ -132,6 +135,8 @@ jobs: - name: 'Get MSYS2' uses: ./.github/actions/get-msys2 + with: + architecture: ${{ inputs.architecture }} if: runner.os == 'Windows' - name: 'Get the BootJDK' diff --git a/make/conf/github-actions.conf b/make/conf/github-actions.conf index 320ec49a850..9aee8e87e3c 100644 --- a/make/conf/github-actions.conf +++ b/make/conf/github-actions.conf @@ -51,3 +51,7 @@ MACOS_X64_BOOT_JDK_SHA256=8642b89d889c14ede2c446fd5bbe3621c8a3082e3df02013fd1658 WINDOWS_X64_BOOT_JDK_EXT=zip WINDOWS_X64_BOOT_JDK_URL=https://download.java.net/java/GA/jdk26/c3cc523845074aa0af4f5e1e1ed4151d/35/GPL/openjdk-26_windows-x64_bin.zip WINDOWS_X64_BOOT_JDK_SHA256=2dd2d92c9374cd49a120fe9d916732840bf6bb9f0e0cc29794917a3c08b99c5f + +WINDOWS_AARCH64_BOOT_JDK_EXT=zip +WINDOWS_AARCH64_BOOT_JDK_URL=https://github.com/adoptium/temurin26-binaries/releases/download/jdk-26%2B35-ea-beta/OpenJDK26U-jdk_aarch64_windows_hotspot_26_35-ea.zip +WINDOWS_AARCH64_BOOT_JDK_SHA256=4892cd9714e222947de1a7415a696f43adf691560522dc5858c0a8af070912c0