Fix GraalVM for JDK 17+ detection in MSVC feature.

Fixes #88
This commit is contained in:
Fabio Niephaus 2024-03-11 22:34:51 +01:00 committed by Fabio Niephaus
parent 5393c3d809
commit b03aef7455
3 changed files with 16 additions and 21 deletions

14
dist/main/index.js generated vendored
View File

@ -94270,15 +94270,15 @@ function run() {
const cache = core.getInput(c.INPUT_CACHE);
const enableCheckForUpdates = core.getInput(c.INPUT_CHECK_FOR_UPDATES) === 'true';
const enableNativeImageMusl = core.getInput(c.INPUT_NI_MUSL) === 'true';
const isGraalVMforJDK17OrLater = distribution.length > 0 || graalVMVersion.length == 0;
if (c.IS_WINDOWS) {
(0, msvc_1.setUpWindowsEnvironment)(javaVersion, graalVMVersion);
(0, msvc_1.setUpWindowsEnvironment)(javaVersion, graalVMVersion, isGraalVMforJDK17OrLater);
}
yield (0, dependencies_1.setUpDependencies)(components);
if (enableNativeImageMusl) {
yield (0, musl_1.setUpNativeImageMusl)();
}
// Download GraalVM JDK
const isGraalVMforJDK17OrLater = distribution.length > 0 || graalVMVersion.length == 0;
let graalVMHome;
if (isGraalVMforJDK17OrLater) {
if (enableCheckForUpdates &&
@ -94572,7 +94572,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.setUpWindowsEnvironment = void 0;
const core = __importStar(__nccwpck_require__(2186));
const semver = __importStar(__nccwpck_require__(1383));
const child_process_1 = __nccwpck_require__(2081);
const fs_1 = __nccwpck_require__(7147);
const constants_1 = __nccwpck_require__(9042);
@ -94596,15 +94595,12 @@ function findVcvarsallPath() {
}
throw new Error('Failed to find vcvarsall.bat');
}
function setUpWindowsEnvironment(javaVersion, graalVMVersion) {
function setUpWindowsEnvironment(javaVersion, graalVMVersion, isGraalVMforJDK17OrLater) {
if (javaVersion === javaVersion || graalVMVersion === constants_1.VERSION_DEV) {
return; // no longer required in dev builds
}
const javaVersionSemVer = semver.coerce(javaVersion);
if (javaVersionSemVer &&
semver.valid(javaVersionSemVer) &&
semver.gte(javaVersionSemVer, '18.0.0')) {
return; // no longer required in GraalVM for JDK 17 and later. JDK 17 builds from 22.3 still need this, so skip 17.X.X
else if (isGraalVMforJDK17OrLater) {
return; // no longer required in GraalVM for JDK 17 and later.
}
core.startGroup('Updating Windows environment...');
const vcvarsallPath = findVcvarsallPath();

View File

@ -30,9 +30,15 @@ async function run(): Promise<void> {
const enableCheckForUpdates =
core.getInput(c.INPUT_CHECK_FOR_UPDATES) === 'true'
const enableNativeImageMusl = core.getInput(c.INPUT_NI_MUSL) === 'true'
const isGraalVMforJDK17OrLater =
distribution.length > 0 || graalVMVersion.length == 0
if (c.IS_WINDOWS) {
setUpWindowsEnvironment(javaVersion, graalVMVersion)
setUpWindowsEnvironment(
javaVersion,
graalVMVersion,
isGraalVMforJDK17OrLater
)
}
await setUpDependencies(components)
if (enableNativeImageMusl) {
@ -40,8 +46,6 @@ async function run(): Promise<void> {
}
// Download GraalVM JDK
const isGraalVMforJDK17OrLater =
distribution.length > 0 || graalVMVersion.length == 0
let graalVMHome
if (isGraalVMforJDK17OrLater) {
if (

View File

@ -30,18 +30,13 @@ function findVcvarsallPath(): string {
export function setUpWindowsEnvironment(
javaVersion: string,
graalVMVersion: string
graalVMVersion: string,
isGraalVMforJDK17OrLater: boolean
): void {
if (javaVersion === javaVersion || graalVMVersion === VERSION_DEV) {
return // no longer required in dev builds
}
const javaVersionSemVer = semver.coerce(javaVersion)
if (
javaVersionSemVer &&
semver.valid(javaVersionSemVer) &&
semver.gte(javaVersionSemVer, '18.0.0')
) {
return // no longer required in GraalVM for JDK 17 and later. JDK 17 builds from 22.3 still need this, so skip 17.X.X
} else if (isGraalVMforJDK17OrLater) {
return // no longer required in GraalVM for JDK 17 and later.
}
core.startGroup('Updating Windows environment...')