Skip to content

Commit d3dddb6

Browse files
lewurmmagicus
authored andcommitted
8256657: Add cross-compiled build for Windows+Arm64 to submit workflow
Reviewed-by: shade, ihse
1 parent 616b1f1 commit d3dddb6

File tree

1 file changed

+92
-1
lines changed

1 file changed

+92
-1
lines changed

.github/workflows/submit.yml

Lines changed: 92 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
platforms:
1010
description: "Platform(s) to execute on"
1111
required: true
12-
default: "Linux additional (hotspot only), Linux x64, Linux x86, Windows x64, macOS x64"
12+
default: "Linux additional (hotspot only), Linux x64, Linux x86, Windows aarch64, Windows x64, macOS x64"
1313

1414
jobs:
1515
prerequisites:
@@ -21,6 +21,7 @@ jobs:
2121
platform_linux_additional: ${{ steps.check_platforms.outputs.platform_linux_additional }}
2222
platform_linux_x64: ${{ steps.check_platforms.outputs.platform_linux_x64 }}
2323
platform_linux_x86: ${{ steps.check_platforms.outputs.platform_linux_x86 }}
24+
platform_windows_aarch64: ${{ steps.check_platforms.outputs.platform_windows_aarch64 }}
2425
platform_windows_x64: ${{ steps.check_platforms.outputs.platform_windows_x64 }}
2526
platform_macos_x64: ${{ steps.check_platforms.outputs.platform_macos_x64 }}
2627
dependencies: ${{ steps.check_deps.outputs.dependencies }}
@@ -36,6 +37,7 @@ jobs:
3637
echo "::set-output name=platform_linux_additional::${{ contains(github.event.inputs.platforms, 'linux additional (hotspot only)') || (github.event.inputs.platforms == '' && (secrets.JDK_SUBMIT_PLATFORMS == '' || contains(secrets.JDK_SUBMIT_PLATFORMS, 'linux additional (hotspot only)'))) }}"
3738
echo "::set-output name=platform_linux_x64::${{ contains(github.event.inputs.platforms, 'linux x64') || (github.event.inputs.platforms == '' && (secrets.JDK_SUBMIT_PLATFORMS == '' || contains(secrets.JDK_SUBMIT_PLATFORMS, 'linux x64'))) }}"
3839
echo "::set-output name=platform_linux_x86::${{ contains(github.event.inputs.platforms, 'linux x86') || (github.event.inputs.platforms == '' && (secrets.JDK_SUBMIT_PLATFORMS == '' || contains(secrets.JDK_SUBMIT_PLATFORMS, 'linux x86'))) }}"
40+
echo "::set-output name=platform_windows_aarch64::${{ contains(github.event.inputs.platforms, 'windows aarch64') || (github.event.inputs.platforms == '' && (secrets.JDK_SUBMIT_PLATFORMS == '' || contains(secrets.JDK_SUBMIT_PLATFORMS, 'windows aarch64'))) }}"
3941
echo "::set-output name=platform_windows_x64::${{ contains(github.event.inputs.platforms, 'windows x64') || (github.event.inputs.platforms == '' && (secrets.JDK_SUBMIT_PLATFORMS == '' || contains(secrets.JDK_SUBMIT_PLATFORMS, 'windows x64'))) }}"
4042
echo "::set-output name=platform_macos_x64::${{ contains(github.event.inputs.platforms, 'macos x64') || (github.event.inputs.platforms == '' && (secrets.JDK_SUBMIT_PLATFORMS == '' || contains(secrets.JDK_SUBMIT_PLATFORMS, 'macos x64'))) }}"
4143
if: steps.check_submit.outputs.should_run != 'false'
@@ -846,6 +848,94 @@ jobs:
846848
path: ~/linux-x86${{ matrix.artifact }}_testsupport_${{ env.logsuffix }}.zip
847849
continue-on-error: true
848850

851+
windows_aarch64_build:
852+
name: Windows aarch64
853+
runs-on: "windows-2019"
854+
needs: prerequisites
855+
if: needs.prerequisites.outputs.should_run != 'false' && needs.prerequisites.outputs.platform_windows_aarch64 != 'false'
856+
857+
strategy:
858+
fail-fast: false
859+
matrix:
860+
flavor:
861+
- build debug
862+
include:
863+
- flavor: build debug
864+
flags: --enable-debug
865+
artifact: -debug
866+
867+
env:
868+
JDK_VERSION: "${{ fromJson(needs.prerequisites.outputs.dependencies).DEFAULT_VERSION_FEATURE }}"
869+
BOOT_JDK_VERSION: "${{ fromJson(needs.prerequisites.outputs.dependencies).BOOT_JDK_VERSION }}"
870+
BOOT_JDK_FILENAME: "${{ fromJson(needs.prerequisites.outputs.dependencies).WINDOWS_X64_BOOT_JDK_FILENAME }}"
871+
BOOT_JDK_URL: "${{ fromJson(needs.prerequisites.outputs.dependencies).WINDOWS_X64_BOOT_JDK_URL }}"
872+
BOOT_JDK_SHA256: "${{ fromJson(needs.prerequisites.outputs.dependencies).WINDOWS_X64_BOOT_JDK_SHA256 }}"
873+
874+
steps:
875+
- name: Restore cygwin packages from cache
876+
id: cygwin
877+
uses: actions/cache@v2
878+
with:
879+
path: ~/cygwin/packages
880+
key: cygwin-packages-${{ runner.os }}-v1
881+
882+
- name: Install cygwin
883+
run: |
884+
New-Item -Force -ItemType directory -Path "$HOME\cygwin"
885+
& curl -L "https://www.cygwin.com/setup-x86_64.exe" -o "$HOME/cygwin/setup-x86_64.exe"
886+
Start-Process -FilePath "$HOME\cygwin\setup-x86_64.exe" -ArgumentList "--quiet-mode --packages autoconf,make,zip,unzip --root $HOME\cygwin\cygwin64 --local-package-dir $HOME\cygwin\packages --site http://mirrors.kernel.org/sourceware/cygwin --no-desktop --no-shortcuts --no-startmenu --no-admin" -Wait -NoNewWindow
887+
888+
- name: Checkout the source
889+
uses: actions/checkout@v2
890+
with:
891+
path: jdk
892+
893+
- name: Restore boot JDK from cache
894+
id: bootjdk
895+
uses: actions/cache@v2
896+
with:
897+
path: ~/bootjdk/${{ env.BOOT_JDK_VERSION }}
898+
key: bootjdk-${{ runner.os }}-${{ env.BOOT_JDK_VERSION }}-${{ env.BOOT_JDK_SHA256 }}-v1
899+
900+
- name: Download boot JDK
901+
run: |
902+
mkdir -p "$HOME\bootjdk\$env:BOOT_JDK_VERSION"
903+
& curl -L "$env:BOOT_JDK_URL" -o "$HOME/bootjdk/$env:BOOT_JDK_FILENAME"
904+
$FileHash = Get-FileHash -Algorithm SHA256 "$HOME/bootjdk/$env:BOOT_JDK_FILENAME"
905+
$FileHash.Hash -eq $env:BOOT_JDK_SHA256
906+
& tar -xf "$HOME/bootjdk/$env:BOOT_JDK_FILENAME" -C "$HOME/bootjdk/$env:BOOT_JDK_VERSION"
907+
Get-ChildItem "$HOME\bootjdk\$env:BOOT_JDK_VERSION\*\*" | Move-Item -Destination "$HOME\bootjdk\$env:BOOT_JDK_VERSION"
908+
if: steps.bootjdk.outputs.cache-hit != 'true'
909+
910+
- name: Ensure a specific version of MSVC is installed
911+
run: >
912+
Start-Process -FilePath 'C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installer.exe' -Wait -NoNewWindow -ArgumentList
913+
'modify --installPath "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise" --quiet
914+
--add Microsoft.VisualStudio.Component.VC.14.28.arm64'
915+
916+
- name: Configure
917+
run: >
918+
$env:Path = "$HOME\cygwin\cygwin64\bin;$HOME\cygwin\cygwin64\bin;$env:Path" ;
919+
$env:Path = $env:Path -split ";" -match "C:\\Windows|PowerShell|cygwin" -join ";" ;
920+
$env:BOOT_JDK = cygpath "$HOME/bootjdk/$env:BOOT_JDK_VERSION" ;
921+
& bash configure
922+
--with-conf-name=windows-aarch64
923+
--with-msvc-toolset-version=14.28
924+
--openjdk-target=aarch64-unknown-cygwin
925+
${{ matrix.flags }}
926+
--with-version-opt="$env:GITHUB_ACTOR-$env:GITHUB_SHA"
927+
--with-version-build=0
928+
--with-boot-jdk="$env:BOOT_JDK"
929+
--with-default-make-target="hotspot"
930+
working-directory: jdk
931+
932+
- name: Build
933+
run: |
934+
$env:Path = "$HOME\cygwin\cygwin64\bin;$HOME\cygwin\cygwin64\bin;$env:Path" ;
935+
$env:Path = $env:Path -split ";" -match "C:\\Windows|PowerShell|cygwin" -join ";" ;
936+
& make CONF_NAME=windows-aarch64
937+
working-directory: jdk
938+
849939
windows_x64_build:
850940
name: Windows x64
851941
runs-on: "windows-2019"
@@ -1466,6 +1556,7 @@ jobs:
14661556
needs:
14671557
- prerequisites
14681558
- linux_additional_build
1559+
- windows_aarch64_build
14691560
- linux_x64_test
14701561
- linux_x86_test
14711562
- windows_x64_test

0 commit comments

Comments
 (0)