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 24 commits
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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ node_modules/
!.idea
.idea/*
!.idea/runConfigurations/
.vscode/
!.vscode
.vscode/*
.metals/
*.swp
.projections.json
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -852,6 +852,7 @@
- [Add method call info for infix operators][7090]
- [`executionComplete` response is sent on successful execution only][7143]
- [Send info about function values][7168]
- [Update to GraalVM 23.0.0][7176]

[3227]: https://github.com/enso-org/enso/pull/3227
[3248]: https://github.com/enso-org/enso/pull/3248
Expand Down Expand Up @@ -976,6 +977,7 @@
[7090]: https://github.com/enso-org/enso/pull/7090
[7143]: https://github.com/enso-org/enso/pull/7143
[7168]: https://github.com/enso-org/enso/pull/7168
[7176]: https://github.com/enso-org/enso/pull/7176

# Enso 2.0.0-alpha.18 (2021-10-12)

Expand Down
106 changes: 64 additions & 42 deletions build.sbt

Large diffs are not rendered by default.

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
6 changes: 0 additions & 6 deletions build/build/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ extern crate core;
use crate::prelude::*;

use anyhow::Context;
use ide_ci::programs::java;
use regex::Regex;


Expand Down Expand Up @@ -106,11 +105,6 @@ pub fn get_graal_version(build_sbt_contents: &str) -> Result<Version> {
get_string_assignment_value(build_sbt_contents, "graalVersion")?.parse2()
}

/// Get version of Enso from the `build.sbt` file contents.
pub fn get_java_major_version(build_sbt_contents: &str) -> Result<java::LanguageVersion> {
get_string_assignment_value(build_sbt_contents, "javaVersion")?.parse2()
}

#[cfg(test)]
mod tests {
use super::*;
Expand Down
83 changes: 56 additions & 27 deletions build/ci_utils/src/cache/goodie/graalvm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ 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_URL: &str = "graalvm-community";
const PACKAGE_PREFIX_UNZIPPED: &str = "graalvm-community-openjdk";

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

Expand All @@ -24,7 +24,7 @@ crate::define_env_var! {
}

pub fn graal_version_from_version_string(version_string: &str) -> Result<Version> {
let line = version_string.lines().find(|line| line.contains("GraalVM")).context(
let line = version_string.lines().find(|line| line.contains("GraalVM CE")).context(
"There is a Java environment available but it is not recognizable as GraalVM one.",
)?;
Version::find_in_text(line)
Expand All @@ -41,7 +41,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 +53,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 All @@ -88,36 +79,39 @@ impl GraalVM {
pub fn url(&self) -> BoxFuture<'static, Result<Url>> {
let platform_string = self.platform_string();
let graal_version = self.graal_version.clone();
let graal_version_tag = format!("{}.{}.{}", graal_version.major, graal_version.minor, graal_version.patch);
let client = self.client.clone();
async move {
let repo = CE_BUILDS_REPOSITORY.handle(&client);
let release = repo.find_release_by_text(&graal_version.to_string()).await?;
let release = repo.find_release_by_text(&graal_version_tag).await?;
crate::github::find_asset_url_by_text(&release, &platform_string).cloned()
}
.boxed()
}

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",
Arch::X86_64 => "x64",
// No Graal packages for Apple Silicon.
Arch::AArch64 if TARGET_OS == OS::MacOS => "amd64",
Arch::AArch64 if TARGET_OS == OS::MacOS => "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.major, _graal_version.minor, _graal_version.patch);
format!("{PACKAGE_PREFIX_URL}-{java_version}_{os_name}-{arch_name}")
}

pub fn root_directory_name(&self) -> PathBuf {
PathBuf::from(format!("{}-{}-{}", PACKAGE_PREFIX, self.java_version, self.graal_version))
assert!(!self.graal_version.build.is_empty());
let jdk_version = format!("{}.{}.{}+{}", self.graal_version.major, self.graal_version.minor, self.graal_version.patch, self.graal_version.build);
PathBuf::from(format!("{}-{}", PACKAGE_PREFIX_UNZIPPED, jdk_version))
}
}

Expand All @@ -137,6 +131,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 +142,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+7.1").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 @@ -166,14 +160,49 @@ mod tests {
/// Check that we correctly recognize both the GraalVM version and the Java version.
#[test]
fn version_recognize() {
let version_string = r"openjdk version 17.0.6 2023-01-17
OpenJDK Runtime Environment GraalVM CE 22.3.1 (build 17.0.6+10-jvmci-22.3-b13)
OpenJDK 64-Bit Server VM GraalVM CE 22.3.1 (build 17.0.6+10-jvmci-22.3-b13, mixed mode, sharing)";
let version_string = "openjdk version \"17.0.7\" 2023-04-18
Akirathan marked this conversation as resolved.
Show resolved Hide resolved
Akirathan marked this conversation as resolved.
Show resolved Hide resolved
OpenJDK Runtime Environment GraalVM CE 17.0.7+7.1 (build 17.0.7+7-jvmci-23.0-b12)
OpenJDK 64-Bit Server VM GraalVM CE 17.0.7+7.1 (build 17.0.7+7-jvmci-23.0-b12, mixed mode, sharing)";

let found_graal = graal_version_from_version_string(version_string).unwrap();
assert_eq!(found_graal, Version::new(22, 3, 1));
let expected_graal_version = Version {
major: 17,
minor: 0,
patch: 7,
pre: Prerelease::EMPTY,
build: BuildMetadata::new("7.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, 6));
assert_eq!(found_java, Version::new(17, 0, 7));
}

#[test]
fn recognize_oneline_version() {
let version_line = "OpenJDK Runtime Environment GraalVM CE 17.0.7+7.1 (build 17.0.7+7-jvmci-23.0-b12)";
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("7.1").unwrap()
};
assert_eq!(graal_version, expected_graal_version);
}

#[test]
fn version_to_string() {
let version_with_build_metadata = Version {
major: 17,
minor: 0,
patch: 7,
pre: Prerelease::EMPTY,
build: BuildMetadata::new("7.1").unwrap()
};
let version_str = format!("{}.{}.{}+{}", version_with_build_metadata.major, version_with_build_metadata.minor,
version_with_build_metadata.patch, version_with_build_metadata.build);
assert_eq!(version_str, "17.0.7+7.1");
}
}
8 changes: 4 additions & 4 deletions build/ci_utils/src/programs/graal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ use serde::Deserializer;
use serde::Serializer;



/// GraalVM Updater, `gu`, is a command-line tool for installing and managing optional GraalVM
/// language runtimes and utilities.
#[derive(Clone, Copy, Debug, Default)]
Expand Down Expand Up @@ -111,16 +110,17 @@ pub enum ComponentId {
NodeJs,
/// Graal.Python
Python,
/// FastR
#[strum(serialize = "R")]
R,
Comment on lines -114 to -116
Copy link
Member Author

@Akirathan Akirathan Jul 6, 2023

Choose a reason for hiding this comment

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

I have removed FastR for now, as I am unable to install it or to list it with gu available. I asked at Truffle tools slack. Until that is resolved, we will have to skip all the R polyglot tests. Tracked in #7226.

/// TruffleRuby
Ruby,
#[strum(serialize = "visualvm")]
/// VisualVM
VisualVm,
/// GraalWasm
Wasm,
#[strum(serialize = "icu4j")]
Icu4J,
Regex,
Jipher,
#[strum(disabled)]
Unrecognized(String),
}
Expand Down
2 changes: 1 addition & 1 deletion build/ci_utils/src/programs/java.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,6 @@ impl std::str::FromStr for LanguageVersion {

impl Display for LanguageVersion {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
write!(f, "java{}", self.0)
write!(f, "jdk{}", self.0)
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.enso.interpreter.epb.node;

import com.oracle.truffle.api.dsl.Cached.Shared;
import com.oracle.truffle.api.dsl.Fallback;
import com.oracle.truffle.api.dsl.GenerateUncached;
import com.oracle.truffle.api.dsl.ReportPolymorphism;
Expand Down Expand Up @@ -79,7 +80,7 @@ boolean doWrappedBoolean(
Object b,
GuardedTruffleContext origin,
GuardedTruffleContext target,
@CachedLibrary(limit = "5") InteropLibrary bools) {
@Shared("interop") @CachedLibrary(limit = "5") InteropLibrary bools) {
try {
return bools.asBoolean(b);
} catch (UnsupportedMessageException e) {
Expand All @@ -92,7 +93,7 @@ long doWrappedLong(
Object l,
GuardedTruffleContext origin,
GuardedTruffleContext target,
@CachedLibrary(limit = "5") InteropLibrary numbers) {
@Shared("interop") @CachedLibrary(limit = "5") InteropLibrary numbers) {
Akirathan marked this conversation as resolved.
Show resolved Hide resolved
try {
return numbers.asLong(l);
} catch (UnsupportedMessageException e) {
Expand All @@ -106,7 +107,7 @@ long doWrappedLong(
Object d,
GuardedTruffleContext origin,
GuardedTruffleContext target,
@CachedLibrary(limit = "5") InteropLibrary numbers) {
@Shared("interop") @CachedLibrary(limit = "5") InteropLibrary numbers) {
try {
return numbers.asDouble(d);
} catch (UnsupportedMessageException e) {
Expand Down
Loading