Skip to content

Commit c8b16c2

Browse files
Upgrade jdk-21 Windows builds to use MS VS2022 (#3475)
* Upgrade jdk-21 Windows builds to use MS VS2022 Signed-off-by: Andrew Leonard <[email protected]> * Update build .github workflow to use win2022 Signed-off-by: Andrew Leonard <[email protected]> --------- Signed-off-by: Andrew Leonard <[email protected]>
1 parent d42e421 commit c8b16c2

File tree

2 files changed

+39
-11
lines changed

2 files changed

+39
-11
lines changed

.github/workflows/build.yml

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
fail-fast: false
2828
matrix:
2929
os: [linux]
30-
version: [jdk8u, jdk11u, jdk17u, jdk19u, jdk] #jdk head == jdk20
30+
version: [jdk8u, jdk11u, jdk17u, jdk] #jdk head == jdk22
3131
variant: [temurin]
3232
image: [adoptopenjdk/centos7_build_image]
3333
include:
@@ -43,10 +43,6 @@ jobs:
4343
version: jdk17u
4444
variant: temurin
4545
image: adoptopenjdk/alpine3_build_image
46-
- os: alpine-linux
47-
version: jdk19u
48-
vm: temurin
49-
image: adoptopenjdk/alpine3_build_image
5046
- os: alpine-linux
5147
version: jdk
5248
variant: temurin
@@ -197,12 +193,13 @@ jobs:
197193
strategy:
198194
fail-fast: false
199195
matrix:
200-
os: [windows-2019]
196+
os: [windows-2022]
201197
version: [jdk8u, jdk11u, jdk17u, jdk]
202198
variant: [temurin]
203199

204200
env:
205-
VS2017_URL: "https://github.com/akashche/msvs_2017_installer_bootstrap/raw/master/vs_community__7955ddbf8a9b49dda0f8d18876e93bd2.exe"
201+
VS2017_URL: "https://download.visualstudio.microsoft.com/download/pr/c5c75dfa-1b29-4419-80f8-bd39aed6bcd9/7ed8fa27575648163e07548ff5667b55b95663a2323e2b2a5f87b16284e481e6/vs_Community.exe"
202+
VS2019_URL: "https://download.visualstudio.microsoft.com/download/pr/6b655578-de8c-4862-ad77-65044ca714cf/f29399a618bd3a8d1dcc96d349453f686b6176590d904308402a6402543e310b/vs_Community.exe"
206203

207204
steps:
208205
- name: Restore cygwin packages from cache
@@ -256,15 +253,24 @@ jobs:
256253
path: ~/vs2017.exe
257254
key: vs2017
258255

256+
- name: Restore Visual Studio 2019 from cache
257+
id: vs2019
258+
if: matrix.version == 'jdk11u' || matrix.version == 'jdk17u'
259+
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2
260+
with:
261+
path: ~/vs2019.exe
262+
key: vs2019
263+
259264
- name: Uninstall WinSDKs
260-
if: matrix.version == 'jdk8u'
265+
if: matrix.version == 'jdk8u' || matrix.version == 'jdk11u' || matrix.version == 'jdk17u'
261266
run: >
262267
Start-Process -FilePath 'C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installer.exe' -Wait -NoNewWindow -ArgumentList
263-
'modify --installPath "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise"
268+
'modify --installPath "C:\Program Files (x86)\Microsoft Visual Studio\2022\Enterprise"
264269
--remove Microsoft.VisualStudio.Component.Windows10SDK.18362
265270
--remove Microsoft.VisualStudio.Component.Windows10SDK.19041
266271
--remove Microsoft.VisualStudio.Component.Windows10SDK.20348
267272
--remove Microsoft.VisualStudio.Component.Windows10SDK.22000
273+
--remove Microsoft.VisualStudio.Component.Windows10SDK.22621
268274
--quiet'
269275
270276
- name: Download Visual Studio 2017
@@ -282,6 +288,21 @@ jobs:
282288
--add Microsoft.VisualStudio.Component.Windows10SDK.17763
283289
--quiet --wait'
284290
291+
- name: Download Visual Studio 2019
292+
run: |
293+
curl -L "$env:VS2019_URL" -o "$HOME/vs2019.exe"
294+
if: steps.vs2019.outputs.cache-hit != 'true' && (matrix.version == 'jdk11u' || matrix.version == 'jdk17u')
295+
296+
- name: Install Visual Studio 2019
297+
if: matrix.version == 'jdk11u' || matrix.version == 'jdk17u'
298+
run: >
299+
Start-Process -FilePath "$HOME\vs2019.exe" -Wait -NoNewWindow -ArgumentList
300+
'install --productId Microsoft.VisualStudio.Product.Community --channelId VisualStudio.15.Release
301+
--add Microsoft.VisualStudio.Workload.NativeDesktop
302+
--add Microsoft.VisualStudio.Component.VC.Tools.x86.x64
303+
--add Microsoft.VisualStudio.Component.Windows10SDK.22000
304+
--quiet --wait'
305+
285306
- name: Install Git
286307
run: |
287308
Invoke-WebRequest 'https://github.com/git-for-windows/git/releases/download/v2.14.3.windows.1/Git-2.14.3-64-bit.exe' -OutFile 'C:\temp\git.exe'

build-farm/platform-specific-configurations/windows.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,10 +142,14 @@ then
142142
then
143143
export TOOLCHAIN_VERSION="2017"
144144
export CONFIGURE_ARGS_FOR_ANY_PLATFORM="${CONFIGURE_ARGS_FOR_ANY_PLATFORM} --disable-ccache"
145-
elif [ "$JAVA_FEATURE_VERSION" -gt 11 ]
145+
elif [ "$JAVA_FEATURE_VERSION" -gt 11 ] && [ "$JAVA_FEATURE_VERSION" -lt 21 ]
146146
then
147147
TOOLCHAIN_VERSION="2019"
148148
export CONFIGURE_ARGS_FOR_ANY_PLATFORM="${CONFIGURE_ARGS_FOR_ANY_PLATFORM} --disable-ccache"
149+
elif [ "$JAVA_FEATURE_VERSION" -ge 21 ]
150+
then
151+
TOOLCHAIN_VERSION="2022"
152+
export CONFIGURE_ARGS_FOR_ANY_PLATFORM="${CONFIGURE_ARGS_FOR_ANY_PLATFORM} --disable-ccache"
149153
fi
150154
fi
151155
fi
@@ -210,9 +214,12 @@ then
210214
then
211215
export BUILD_ARGS="${BUILD_ARGS} --freetype-version 39ce3ac499d4cd7371031a062f410953c8ecce29" # 2.8.1
212216
export PATH="/cygdrive/c/openjdk/make-3.82/:$PATH"
213-
elif [ "$JAVA_FEATURE_VERSION" -ge 11 ]
217+
elif [ "$JAVA_FEATURE_VERSION" -ge 11 ] && [ "$JAVA_FEATURE_VERSION" -lt 21 ]
214218
then
215219
TOOLCHAIN_VERSION="2019"
220+
elif [ "$JAVA_FEATURE_VERSION" -ge 21 ]
221+
then
222+
TOOLCHAIN_VERSION="2022"
216223
fi
217224
fi
218225

0 commit comments

Comments
 (0)