Skip to content

Commit

Permalink
8283723: Update Visual Studio 2022 to version 17.1.0 for Oracle build…
Browse files Browse the repository at this point in the history
…s on Windows

Reviewed-by: mbaesken
Backport-of: a9a9b901b4b340dc573ace72d64edcb0a1b8ef94
  • Loading branch information
GoeLin committed Jul 28, 2022
1 parent 25ad9d6 commit 6fa5281
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 14 deletions.
2 changes: 1 addition & 1 deletion doc/building.html
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ <h2 id="native-compiler-toolchain-requirements">Native Compiler (Toolchain) Requ
</tr>
<tr class="odd">
<td style="text-align: left;">Windows</td>
<td style="text-align: left;">Microsoft Visual Studio 2019 update 16.7.2</td>
<td style="text-align: left;">Microsoft Visual Studio 2022 update 17.1.0</td>
</tr>
</tbody>
</table>
Expand Down
2 changes: 1 addition & 1 deletion doc/building.md
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ issues.
------------------ -------------------------------------------------------
Linux gcc 10.2.0
macOS Apple Xcode 10.1 (using clang 10.0.0)
Windows Microsoft Visual Studio 2019 update 16.7.2
Windows Microsoft Visual Studio 2022 update 17.1.0

All compilers are expected to be able to compile to the C99 language standard,
as some C99 features are used in the source code. Microsoft Visual Studio
Expand Down
2 changes: 1 addition & 1 deletion make/conf/jib-profiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -1049,7 +1049,7 @@ var getJibProfilesDependencies = function (input, common) {
var devkit_platform_revisions = {
linux_x64: "gcc10.3.0-OL6.4+1.0",
macosx: "Xcode12.4+1.0",
windows_x64: "VS2019-16.9.3+1.0",
windows_x64: "VS2022-17.1.0+1.0",
linux_aarch64: "gcc10.3.0-OL7.6+1.0",
linux_arm: "gcc8.2.0-Fedora27+1.0",
linux_ppc64le: "gcc8.2.0-Fedora27+1.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
#
# Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -28,14 +28,19 @@
# suitable for building OpenJDK and OracleJDK. Needs to run in Cygwin or WSL.
# erik.joelsson@oracle.com

VS_VERSION="2019"
VS_VERSION_NUM_NODOT="160"
usage_and_exit() {
echo "Usage: createWindowsDevkit.sh <2019 | 2022>"
exit 1
}

if [ ! $# = 1 ]; then
usage_and_exit
fi

VS_VERSION="$1"

VS_DLL_VERSION="140"
SDK_VERSION="10"
SDK_FULL_VERSION="10.0.17763.0"
MSVC_DIR="Microsoft.VC142.CRT"
MSVC_FULL_VERSION="14.12.27508"
REDIST_FULL_VERSION="14.20.27508"

SCRIPT_DIR="$(cd "$(dirname $0)" > /dev/null && pwd)"
BUILD_DIR="${SCRIPT_DIR}/../../build/devkit"
Expand Down Expand Up @@ -66,13 +71,33 @@ fi

# Work around the insanely named ProgramFiles(x86) env variable
PROGRAMFILES_X86="$($WINDOWS_PATH_TO_UNIX_PATH "$(cmd.exe /c set | sed -n 's/^ProgramFiles(x86)=//p' | tr -d '\r')")"
PROGRAMFILES="$($WINDOWS_PATH_TO_UNIX_PATH "$PROGRAMFILES")"

case $VS_VERSION in
2019)
MSVC_PROGRAMFILES_DIR="${PROGRAMFILES_X86}"
MSVC_CRT_DIR="Microsoft.VC142.CRT"
VS_VERSION_NUM_NODOT="160"
;;

2022)
MSVC_PROGRAMFILES_DIR="${PROGRAMFILES}"
MSVC_CRT_DIR="Microsoft.VC143.CRT"
VS_VERSION_NUM_NODOT="170"
;;
*)
echo "Unexpected VS version: $VS_VERSION"
usage_and_exit
;;
esac


# Find Visual Studio installation dir
VSNNNCOMNTOOLS=`cmd.exe /c echo %VS${VS_VERSION_NUM_NODOT}COMNTOOLS% | tr -d '\r'`
if [ -d "$VSNNNCOMNTOOLS" ]; then
VS_INSTALL_DIR="$($WINDOWS_PATH_TO_UNIX_PATH "$VSNNNCOMNTOOLS/../..")"
else
VS_INSTALL_DIR="${PROGRAMFILES_X86}/Microsoft Visual Studio/2019"
VS_INSTALL_DIR="${MSVC_PROGRAMFILES_DIR}/Microsoft Visual Studio/$VS_VERSION"
VS_INSTALL_DIR="$(ls -d "${VS_INSTALL_DIR}/"{Community,Professional,Enterprise} 2>/dev/null | head -n1)"
fi
echo "VS_INSTALL_DIR: $VS_INSTALL_DIR"
Expand Down Expand Up @@ -101,9 +126,9 @@ DEVKIT_BUNDLE="${DEVKIT_ROOT}.tar.gz"

echo "Creating devkit in $DEVKIT_ROOT"

MSVCR_DLL=${MSVC_DIR}/vcruntime${VS_DLL_VERSION}.dll
VCRUNTIME_1_DLL=${MSVC_DIR}/vcruntime${VS_DLL_VERSION}_1.dll
MSVCP_DLL=${MSVC_DIR}/msvcp${VS_DLL_VERSION}.dll
MSVCR_DLL=${MSVC_CRT_DIR}/vcruntime${VS_DLL_VERSION}.dll
VCRUNTIME_1_DLL=${MSVC_CRT_DIR}/vcruntime${VS_DLL_VERSION}_1.dll
MSVCP_DLL=${MSVC_CRT_DIR}/msvcp${VS_DLL_VERSION}.dll

################################################################################
# Copy Visual Studio files
Expand Down

3 comments on commit 6fa5281

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RealCLanger
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/backport jdk11u-dev

@openjdk
Copy link

@openjdk openjdk bot commented on 6fa5281 May 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RealCLanger Could not automatically backport 6fa5281c to openjdk/jdk11u-dev due to conflicts in the following files:

  • doc/building.html
  • doc/building.md
  • make/conf/jib-profiles.js

Please fetch the appropriate branch/commit and manually resolve these conflicts by using the following commands in your personal fork of openjdk/jdk11u-dev. Note: these commands are just some suggestions and you can use other equivalent commands you know.

# Fetch the up-to-date version of the target branch
$ git fetch --no-tags https://git.openjdk.org/jdk11u-dev.git master:master

# Check out the target branch and create your own branch to backport
$ git checkout master
$ git checkout -b RealCLanger-backport-6fa5281c

# Fetch the commit you want to backport
$ git fetch --no-tags https://git.openjdk.org/jdk17u-dev.git 6fa5281c6b7df007a89c0b6e8a7e268a06927540

# Backport the commit
$ git cherry-pick --no-commit 6fa5281c6b7df007a89c0b6e8a7e268a06927540
# Resolve conflicts now

# Commit the files you have modified
$ git add files/with/resolved/conflicts
$ git commit -m 'Backport 6fa5281c6b7df007a89c0b6e8a7e268a06927540'

Once you have resolved the conflicts as explained above continue with creating a pull request towards the openjdk/jdk11u-dev with the title Backport 6fa5281c6b7df007a89c0b6e8a7e268a06927540.

Please sign in to comment.