Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update GraalVM to 17.0.7 (23.0.0 JDK17) #7176

Merged
merged 56 commits into from
Jul 20, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
ec3ae53
Update GraalVM to 23.0.0 JDK17
Akirathan Jun 30, 2023
075d1ac
Update CHANGELOG
Akirathan Jun 30, 2023
39ef06a
Update build tool for new Graal release names
Akirathan Jun 30, 2023
ac57e18
Merge branch 'develop' into wip/akirathan/5300-graalvm-update-23-00
JaroslavTulach Jul 1, 2023
cba65de
Do not use @CachedLibrary parameter in method behind TruffleBoundary
Akirathan Jul 3, 2023
5b55b63
Add .idea dir to gitignore in tools/enso4igv
Akirathan Jul 3, 2023
c8d9091
Improve .gitignore
Akirathan Jul 3, 2023
e8bb86d
Fix gu program find
Akirathan Jul 3, 2023
efe8afe
GraalVM root directory name includes the build metadata identifier
Akirathan Jul 4, 2023
01b0577
Fix native image build of engine-runner
Akirathan Jul 4, 2023
ef99bea
Remove deprecations
Akirathan Jul 4, 2023
a341b2b
Dispose context before System.exit
Akirathan Jul 4, 2023
15244d2
Get rid of some warnings - Add @Shared to some @Cached parameters
Akirathan Jul 4, 2023
24ea89d
Suppress all the Node inlining warnings in runtime projects
Akirathan Jul 5, 2023
f279100
Suppress BigInteger message implement warning
Akirathan Jul 5, 2023
74b6e04
Get rid of warnings in runtime.
Akirathan Jul 5, 2023
7b448d8
Merge branch 'develop' into wip/akirathan/5300-graalvm-update-23-00
Akirathan Jul 5, 2023
04dbffa
Fix build.sbt after merge
Akirathan Jul 5, 2023
fdbf421
Add some `@Shared` parameters after develop merge
Akirathan Jul 5, 2023
f0a24aa
Remove Truffle DSL processor options from projects that don't run the…
Akirathan Jul 5, 2023
1f59a62
Rollback .idea run configuration changes
Akirathan Jul 5, 2023
83ca384
Build tool: No Aarch64 graalvm package for Apple M1
Akirathan Jul 5, 2023
611212c
Fix order in CHANGELOG
Akirathan Jul 6, 2023
c5a892e
Remove every dir in PATH exists asserts from build script
Akirathan Jul 6, 2023
c986937
Bools and numbers do not share interop lib
Akirathan Jul 11, 2023
1cd76f9
Remove `@NonIdempotent` annotation from specialization
Akirathan Jul 11, 2023
7118056
Rename shared cached parameter names
Akirathan Jul 11, 2023
4888b7a
Remove project/EnvironmentCheck
Akirathan Jul 13, 2023
c2b72eb
Merge branch 'develop' into wip/akirathan/5300-graalvm-update-23-00
Akirathan Jul 17, 2023
ea95a16
Remove @CachedLibrary parameters from methods behind @TruffleBoundary
Akirathan Jul 17, 2023
07ce2bf
Fix GraalVM version handling in project-manager
Akirathan Jul 17, 2023
b69bc0d
fmt
Akirathan Jul 17, 2023
8e26c2e
java version is specified as SemVer
Akirathan Jul 17, 2023
0fc2621
Add version requirements to GraalVMVersion
Akirathan Jul 17, 2023
3d4ccc6
Fix enso-build-cli GraalVM version handling
Akirathan Jul 18, 2023
955868e
Loose requirements for GraalVMVersion
Akirathan Jul 18, 2023
f56f742
Do not use invalid GraalVM version in tests
Akirathan Jul 18, 2023
cd1a3d2
fmt
Akirathan Jul 18, 2023
e9079fc
Formatting build.sbt
JaroslavTulach Jul 19, 2023
276f059
Formatting scala sources
JaroslavTulach Jul 19, 2023
800aa1b
cargo fmt
JaroslavTulach Jul 19, 2023
013e161
Merge branch 'wip/akirathan/5300-graalvm-update-23-00' of enso:enso-o…
JaroslavTulach Jul 19, 2023
c66e3bd
Remove @Shared warning in ReadArgumentCheckNode
Akirathan Jul 19, 2023
051b2cd
Add a missing placeholder for a runtime-version-manager-test
radeusgd Jul 19, 2023
93f504c
Add RuntimeVersionManager test for the new GraalVM versioning
Akirathan Jul 19, 2023
881c983
Bump minimal versions in manifest template
Akirathan Jul 19, 2023
821a5b8
fmt
Akirathan Jul 19, 2023
71aa1e9
Fix EngineManagementApi project-manager test
Akirathan Jul 20, 2023
77551f6
Merge branch 'develop' into wip/akirathan/5300-graalvm-update-23-00
Akirathan Jul 20, 2023
7389e41
Use raw string literal
Akirathan Jul 20, 2023
2064a5c
Do not use new variable name just to hold temporary expression.
Akirathan Jul 20, 2023
57c37ed
Implement VersionExt.to_string_core
Akirathan Jul 20, 2023
0a0545e
Remove unnecessary test.
Akirathan Jul 20, 2023
2a1f553
Do not use assert! in non-tests
Akirathan Jul 20, 2023
aca13c0
fix linter errors
Akirathan Jul 20, 2023
0cf26c3
Remove @NonIdempotent annotation from specializations
Akirathan Jul 20, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 42 additions & 39 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@ import java.io.File
// ============================================================================

val scalacVersion = "2.13.11"
val graalVersion = "23.0.0"
val javaVersion = "17"
// Since the release of GraalVM 23.0.0, the versioning is the same for Graal and Java
val graalVersion = "17.0.7"
// Verwsion used for the Graal/Truffle related Maven packages
val graalMavenVersion = "23.0.0"
val javaLangVersion = "17"
Akirathan marked this conversation as resolved.
Show resolved Hide resolved
val defaultDevEnsoVersion = "0.0.0-dev"
val ensoVersion = sys.env.getOrElse(
"ENSO_VERSION",
Expand Down Expand Up @@ -153,8 +156,8 @@ analyzeDependency := GatherLicenses.analyzeDependency.evaluated

val packageBuilder = new DistributionPackage.Builder(
ensoVersion = ensoVersion,
graalVersion = graalVersion,
graalJavaVersion = javaVersion,
graalVersion = graalMavenVersion,
graalJavaVersion = javaLangVersion,
artifactRoot = file("built-distribution")
)

Expand Down Expand Up @@ -638,7 +641,7 @@ lazy val `akka-native` = project
akkaActor
),
// Note [Native Image Workaround for GraalVM 20.2]
libraryDependencies += "org.graalvm.nativeimage" % "svm" % graalVersion % "provided"
libraryDependencies += "org.graalvm.nativeimage" % "svm" % graalMavenVersion % "provided"
)

lazy val `profiling-utils` = project
Expand Down Expand Up @@ -692,7 +695,7 @@ lazy val `logging-service` = project
"junit" % "junit" % junitVersion % Test,
"com.novocode" % "junit-interface" % junitIfVersion % Test exclude ("junit", "junit-dep"),
"org.scalatest" %% "scalatest" % scalatestVersion % Test,
"org.graalvm.nativeimage" % "svm" % graalVersion % "provided"
"org.graalvm.nativeimage" % "svm" % graalMavenVersion % "provided"
)
)
.settings(
Expand All @@ -711,7 +714,7 @@ lazy val `logging-truffle-connector` = project
version := "0.1",
libraryDependencies ++= Seq(
"org.slf4j" % "slf4j-api" % slf4jVersion,
"org.graalvm.truffle" % "truffle-api" % graalVersion % "provided"
"org.graalvm.truffle" % "truffle-api" % graalMavenVersion % "provided"
)
)
.dependsOn(`logging-utils`)
Expand Down Expand Up @@ -760,7 +763,7 @@ lazy val `version-output` = (project in file("lib/scala/version-output"))
defaultDevEnsoVersion = defaultDevEnsoVersion,
ensoVersion = ensoVersion,
scalacVersion = scalacVersion,
graalVersion = graalVersion,
graalVersion = graalMavenVersion,
currentEdition = currentEdition
)
}.taskValue
Expand Down Expand Up @@ -960,8 +963,8 @@ lazy val `interpreter-dsl-test` =
),
commands += WithDebugCommand.withDebug,
libraryDependencies ++= Seq(
"org.graalvm.truffle" % "truffle-api" % graalVersion % "provided",
"org.graalvm.truffle" % "truffle-dsl-processor" % graalVersion % "provided",
"org.graalvm.truffle" % "truffle-api" % graalMavenVersion % "provided",
"org.graalvm.truffle" % "truffle-dsl-processor" % graalMavenVersion % "provided",
"junit" % "junit" % junitVersion % Test,
"com.novocode" % "junit-interface" % junitIfVersion % Test exclude ("junit", "junit-dep")
)
Expand Down Expand Up @@ -1014,8 +1017,8 @@ lazy val `polyglot-api` = project
Seq(s"-Dtruffle.class.path.append=$runtimeClasspath")
},
libraryDependencies ++= Seq(
"org.graalvm.sdk" % "polyglot-tck" % graalVersion % "provided",
"org.graalvm.truffle" % "truffle-api" % graalVersion % "provided",
"org.graalvm.sdk" % "polyglot-tck" % graalMavenVersion % "provided",
"org.graalvm.truffle" % "truffle-api" % graalMavenVersion % "provided",
"com.google.flatbuffers" % "flatbuffers-java" % flatbuffersVersion,
"org.scalatest" %% "scalatest" % scalatestVersion % Test,
"org.scalacheck" %% "scalacheck" % scalacheckVersion % Test
Expand Down Expand Up @@ -1046,7 +1049,7 @@ lazy val `language-server` = (project in file("engine/language-server"))
"com.typesafe.akka" %% "akka-http-testkit" % akkaHTTPVersion % Test,
"org.scalatest" %% "scalatest" % scalatestVersion % Test,
"org.scalacheck" %% "scalacheck" % scalacheckVersion % Test,
"org.graalvm.sdk" % "polyglot-tck" % graalVersion % "provided",
"org.graalvm.sdk" % "polyglot-tck" % graalMavenVersion % "provided",
"org.eclipse.jgit" % "org.eclipse.jgit" % jgitVersion
),
Test / testOptions += Tests
Expand Down Expand Up @@ -1134,7 +1137,7 @@ lazy val frgaalJavaCompilerSetting = Seq(
Compile / compile / compilers := FrgaalJavaCompiler.compilers(
(Compile / dependencyClasspath).value,
compilers.value,
javaVersion
javaLangVersion
),
// This dependency is needed only so that developers don't download Frgaal manually.
// Sadly it cannot be placed under plugins either because meta dependencies are not easily
Expand All @@ -1160,8 +1163,8 @@ lazy val instrumentationSettings = frgaalJavaCompilerSetting ++ Seq(
"--enable-preview"
),
libraryDependencies ++= Seq(
"org.graalvm.truffle" % "truffle-api" % graalVersion % "provided",
"org.graalvm.truffle" % "truffle-dsl-processor" % graalVersion % "provided"
"org.graalvm.truffle" % "truffle-api" % graalMavenVersion % "provided",
"org.graalvm.truffle" % "truffle-dsl-processor" % graalMavenVersion % "provided"
),
(Compile / javacOptions) ++= Seq(
"-s",
Expand Down Expand Up @@ -1277,16 +1280,16 @@ lazy val runtime = (project in file("engine/runtime"))
libraryDependencies ++= jmh ++ jaxb ++ circe ++ Seq(
"org.apache.commons" % "commons-lang3" % commonsLangVersion,
"org.apache.tika" % "tika-core" % tikaVersion,
"org.graalvm.sdk" % "graal-sdk" % graalVersion % "provided",
"org.graalvm.sdk" % "polyglot-tck" % graalVersion % "provided",
"org.graalvm.truffle" % "truffle-api" % graalVersion % "provided",
"org.graalvm.truffle" % "truffle-dsl-processor" % graalVersion % "provided",
"org.graalvm.truffle" % "truffle-tck" % graalVersion % "provided",
"org.graalvm.truffle" % "truffle-tck-common" % graalVersion % "provided",
"org.graalvm.sdk" % "graal-sdk" % graalMavenVersion % "provided",
"org.graalvm.sdk" % "polyglot-tck" % graalMavenVersion % "provided",
"org.graalvm.truffle" % "truffle-api" % graalMavenVersion % "provided",
"org.graalvm.truffle" % "truffle-dsl-processor" % graalMavenVersion % "provided",
"org.graalvm.truffle" % "truffle-tck" % graalMavenVersion % "provided",
"org.graalvm.truffle" % "truffle-tck-common" % graalMavenVersion % "provided",
"org.scalacheck" %% "scalacheck" % scalacheckVersion % Test,
"org.scalactic" %% "scalactic" % scalacticVersion % Test,
"org.scalatest" %% "scalatest" % scalatestVersion % Test,
"org.graalvm.truffle" % "truffle-api" % graalVersion % Benchmark,
"org.graalvm.truffle" % "truffle-api" % graalMavenVersion % Benchmark,
"org.typelevel" %% "cats-core" % catsVersion,
"junit" % "junit" % junitVersion % Test,
"com.novocode" % "junit-interface" % junitIfVersion % Test exclude ("junit", "junit-dep"),
Expand All @@ -1306,8 +1309,8 @@ lazy val runtime = (project in file("engine/runtime"))
),
bootstrap := CopyTruffleJAR.bootstrapJARs.value,
Global / onLoad := EnvironmentCheck.addVersionCheck(
graalVersion,
javaVersion
graalMavenVersion,
javaLangVersion
)((Global / onLoad).value)
)
.settings(
Expand Down Expand Up @@ -1450,8 +1453,8 @@ lazy val `runtime-with-instruments` =
),
libraryDependencies ++= Seq(
"org.scalatest" %% "scalatest" % scalatestVersion % Test,
"org.graalvm.truffle" % "truffle-api" % graalVersion % Test,
"org.graalvm.truffle" % "truffle-dsl-processor" % graalVersion % Test
"org.graalvm.truffle" % "truffle-api" % graalMavenVersion % Test,
"org.graalvm.truffle" % "truffle-dsl-processor" % graalMavenVersion % Test
),
// Note [Unmanaged Classpath]
Test / unmanagedClasspath += (baseDirectory.value / ".." / ".." / "app" / "gui" / "view" / "graph-editor" / "src" / "builtin" / "visualization" / "native" / "inc"),
Expand Down Expand Up @@ -1519,7 +1522,7 @@ lazy val `runtime-with-polyglot` =
"ENSO_TEST_DISABLE_IR_CACHE" -> "false"
),
libraryDependencies ++= Seq(
"org.graalvm.sdk" % "graal-sdk" % graalVersion % "provided",
"org.graalvm.sdk" % "graal-sdk" % graalMavenVersion % "provided",
"org.scalatest" %% "scalatest" % scalatestVersion % Test
)
)
Expand Down Expand Up @@ -1580,8 +1583,8 @@ lazy val `engine-runner` = project
commands += WithDebugCommand.withDebug,
inConfig(Compile)(truffleRunOptionsSettings),
libraryDependencies ++= Seq(
"org.graalvm.sdk" % "polyglot-tck" % graalVersion % "provided",
"org.graalvm.truffle" % "truffle-api" % graalVersion % "provided",
"org.graalvm.sdk" % "polyglot-tck" % graalMavenVersion % "provided",
"org.graalvm.truffle" % "truffle-api" % graalMavenVersion % "provided",
"commons-cli" % "commons-cli" % commonsCliVersion,
"com.monovore" %% "decline" % declineVersion,
"org.jline" % "jline" % jlineVersion,
Expand Down Expand Up @@ -1918,7 +1921,7 @@ lazy val `std-base` = project
Compile / packageBin / artifactPath :=
`base-polyglot-root` / "std-base.jar",
libraryDependencies ++= Seq(
"org.graalvm.sdk" % "graal-sdk" % graalVersion % "provided",
"org.graalvm.sdk" % "graal-sdk" % graalMavenVersion % "provided",
"org.netbeans.api" % "org-openide-util-lookup" % netbeansApiVersion % "provided"
),
Compile / packageBin := Def.task {
Expand Down Expand Up @@ -1946,7 +1949,7 @@ lazy val `common-polyglot-core-utils` = project
`base-polyglot-root` / "common-polyglot-core-utils.jar",
libraryDependencies ++= Seq(
"com.ibm.icu" % "icu4j" % icuVersion,
"org.graalvm.sdk" % "graal-sdk" % graalVersion % "provided"
"org.graalvm.sdk" % "graal-sdk" % graalMavenVersion % "provided"
)
)

Expand All @@ -1958,7 +1961,7 @@ lazy val `enso-test-java-helpers` = project
Compile / packageBin / artifactPath :=
file("test/Tests/polyglot/java/helpers.jar"),
libraryDependencies ++= Seq(
"org.graalvm.sdk" % "graal-sdk" % graalVersion % "provided"
"org.graalvm.sdk" % "graal-sdk" % graalMavenVersion % "provided"
),
Compile / packageBin := Def.task {
val result = (Compile / packageBin).value
Expand Down Expand Up @@ -1991,7 +1994,7 @@ lazy val `std-table` = project
(Antlr4 / sourceManaged).value / "main" / "antlr4"
},
libraryDependencies ++= Seq(
"org.graalvm.sdk" % "graal-sdk" % graalVersion % "provided",
"org.graalvm.sdk" % "graal-sdk" % graalMavenVersion % "provided",
"org.netbeans.api" % "org-openide-util-lookup" % netbeansApiVersion % "provided",
"com.univocity" % "univocity-parsers" % univocityParsersVersion,
"org.apache.poi" % "poi-ooxml" % poiOoxmlVersion,
Expand Down Expand Up @@ -2069,7 +2072,7 @@ lazy val `std-database` = project
Compile / packageBin / artifactPath :=
`database-polyglot-root` / "std-database.jar",
libraryDependencies ++= Seq(
"org.graalvm.sdk" % "graal-sdk" % graalVersion % "provided",
"org.graalvm.sdk" % "graal-sdk" % graalMavenVersion % "provided",
"org.netbeans.api" % "org-openide-util-lookup" % netbeansApiVersion % "provided",
"org.xerial" % "sqlite-jdbc" % sqliteVersion,
"org.postgresql" % "postgresql" % "42.4.0"
Expand Down Expand Up @@ -2175,8 +2178,8 @@ buildEngineDistribution := {
distributionRoot = root,
cacheFactory = cacheFactory,
log = log,
graalVersion = graalVersion,
javaVersion = javaVersion,
graalVersion = graalMavenVersion,
javaVersion = javaLangVersion,
ensoVersion = ensoVersion,
editionName = currentEdition,
sourceStdlibVersion = stdLibVersion,
Expand All @@ -2199,8 +2202,8 @@ buildEngineDistributionNoIndex := {
distributionRoot = root,
cacheFactory = cacheFactory,
log = log,
graalVersion = graalVersion,
javaVersion = javaVersion,
graalVersion = graalMavenVersion,
javaVersion = javaLangVersion,
ensoVersion = ensoVersion,
editionName = currentEdition,
sourceStdlibVersion = stdLibVersion,
Expand Down
2 changes: 0 additions & 2 deletions build/build/src/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use crate::prelude::*;

use crate::get_graal_version;
use crate::get_java_major_version;
use crate::paths::generated;

use artifact::IsArtifact;
Expand Down Expand Up @@ -304,7 +303,6 @@ pub async fn deduce_graal(
Ok(ide_ci::cache::goodie::graalvm::GraalVM {
client,
graal_version: get_graal_version(&build_sbt_content)?,
java_version: get_java_major_version(&build_sbt_content)?,
os: TARGET_OS,
arch: TARGET_ARCH,
})
Expand Down
2 changes: 1 addition & 1 deletion build/build/src/engine/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ impl RunContext {
// Some GraalVM components depend on Sulong and are not available on all platforms (like
// Windows or M1 macOS). Thus, we treat them as optional. See e.g.
// https://github.com/oracle/graalpython/issues/156
let optional_components = [graal::ComponentId::Python, graal::ComponentId::R];
let optional_components = [graal::ComponentId::Python];
graal::install_missing_components(required_components, optional_components).await?;
prepare_simple_library_server.await??;
Ok(())
Expand Down
53 changes: 31 additions & 22 deletions build/ci_utils/src/cache/goodie/graalvm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@ use crate::cache::goodie::Goodie;
use crate::cache::Cache;
use crate::env::known::PATH;
use crate::github::RepoRef;
use crate::programs::java;
use crate::programs::java::JAVA_HOME;
use crate::programs::Java;



const PACKAGE_PREFIX: &str = "graalvm-ce";
const PACKAGE_PREFIX: &str = "graalvm-community";

pub const CE_BUILDS_REPOSITORY: RepoRef = RepoRef { owner: "graalvm", name: "graalvm-ce-builds" };

Expand Down Expand Up @@ -41,7 +40,6 @@ pub struct GraalVM {
/// Used to query GitHub about releases.
pub client: Octocrab,
pub graal_version: Version,
pub java_version: java::LanguageVersion,
pub os: OS,
pub arch: Arch,
}
Expand All @@ -54,17 +52,9 @@ impl Goodie for GraalVM {

fn is_active(&self) -> BoxFuture<'static, Result<bool>> {
let expected_graal_version = self.graal_version.clone();
let expected_java_language_version = self.java_version;
async move {
let found_version = find_graal_version().await?;
ensure!(found_version == expected_graal_version, "GraalVM version mismatch. Expected {expected_graal_version}, found {found_version}.");

let found_java_version = Java.check_language_version().await?;
ensure!(
found_java_version == expected_java_language_version,
"Java language version mismatch. Expected {expected_java_language_version}, found {found_java_version}."
);

Result::Ok(true)
}
.boxed()
Expand Down Expand Up @@ -98,26 +88,24 @@ impl GraalVM {
}

pub fn platform_string(&self) -> String {
let Self { graal_version: _graal_version, java_version, arch, os, client: _client } = &self;
let Self { graal_version: _graal_version, arch, os, client: _client } = &self;
let os_name = match *os {
OS::Linux => "linux",
OS::Windows => "windows",
OS::MacOS => "darwin",
other_os => unimplemented!("System `{}` is not supported!", other_os),
};
let arch_name = match *arch {
Arch::X86_64 => "amd64",
// No Graal packages for Apple Silicon.
Arch::AArch64 if TARGET_OS == OS::MacOS => "amd64",
Arch::X86_64 => "x64",
Arch::AArch64 => "aarch64",
Akirathan marked this conversation as resolved.
Show resolved Hide resolved
other_arch => unimplemented!("Architecture `{}` is not supported!", other_arch),
};
let java_version = format!("java{}", java_version.0);
format!("{PACKAGE_PREFIX}-{java_version}-{os_name}-{arch_name}")
let java_version = format!("jdk-{}", _graal_version);
format!("{PACKAGE_PREFIX}-{java_version}_{os_name}-{arch_name}")
}

pub fn root_directory_name(&self) -> PathBuf {
PathBuf::from(format!("{}-{}-{}", PACKAGE_PREFIX, self.java_version, self.graal_version))
PathBuf::from(format!("{}-{}", PACKAGE_PREFIX, self.graal_version))
}
}

Expand All @@ -137,6 +125,7 @@ pub fn locate_graal() -> Result<PathBuf> {

#[cfg(test)]
mod tests {
use semver::{BuildMetadata, Prerelease};
use super::*;
use crate::cache;
use crate::log::setup_logging;
Expand All @@ -147,12 +136,11 @@ mod tests {
#[ignore]
async fn test_is_enabled() -> Result {
setup_logging()?;
let graal_version = Version::parse("22.3.1").unwrap();
let java_version = java::LanguageVersion(17);
let graal_version = Version::parse("17.0.7").unwrap();
let os = TARGET_OS;
let arch = Arch::X86_64;
let client = Octocrab::default();
let graalvm = GraalVM { graal_version, java_version, os, arch, client };
let graalvm = GraalVM { graal_version, os, arch, client };

graalvm.install_if_missing(&cache::Cache::new_default().await?).await?;

Expand All @@ -171,9 +159,30 @@ Java(TM) SE Runtime Environment Oracle GraalVM 17.0.7+8.1 (build 17.0.7+8-LTS-jv
Java HotSpot(TM) 64-Bit Server VM Oracle GraalVM 17.0.7+8.1 (build 17.0.7+8-LTS-jvmci-23.0-b12, mixed mode, sharing)";

let found_graal = graal_version_from_version_string(version_string).unwrap();
assert_eq!(found_graal, Version::new(23, 0, 0));
let expected_graal_version = Version {
major: 17,
minor: 0,
patch: 7,
pre: Prerelease::EMPTY,
build: BuildMetadata::new("8.1").unwrap()
};
assert_eq!(found_graal, expected_graal_version);

let found_java = Java.parse_version(version_string).unwrap();
assert_eq!(found_java, Version::new(17, 0, 7));
}

#[test]
fn recognize_oneline_version() {
let version_line = "Java(TM) SE Runtime Environment Oracle GraalVM 17.0.7+8.1 (build 17.0.7+8-LTS-jvmci-23.0-b12)";
Akirathan marked this conversation as resolved.
Show resolved Hide resolved
let graal_version = Version::find_in_text(version_line).unwrap();
let expected_graal_version = Version {
major: 17,
minor: 0,
patch: 7,
pre: Prerelease::EMPTY,
build: BuildMetadata::new("8.1").unwrap()
};
assert_eq!(graal_version, expected_graal_version);
}
}
Loading