Skip to content

[GR-63589] Adopt the new unchained standalones for GraalWasm. #11146

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

Merged
merged 1 commit into from
May 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions wasm/THIRD_PARTY_LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
GraalWasm has no third-party dependencies.
7 changes: 7 additions & 0 deletions wasm/mx.wasm/mx_wasm.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@
from mx_gate import Task, add_gate_runner
from mx_unittest import unittest

# re-export custom mx project classes, so they can be used from suite.py
from mx_sdk_vm_ng import StandaloneLicenses, ThinLauncherProject, LanguageLibraryProject, DynamicPOMDistribution, DeliverableStandaloneArchive # pylint: disable=unused-import

_suite = mx.suite("wasm")

emcc_dir = mx.get_env("EMCC_DIR", None)
Expand Down Expand Up @@ -84,6 +87,10 @@ def get_jdk(forBuild=False):
else:
return mx.get_jdk()

# Called from suite.py
def graalwasm_standalone_deps():
return mx_truffle.resolve_truffle_dist_names()

#
# Gate runners.
#
Expand Down
125 changes: 124 additions & 1 deletion wasm/mx.wasm/suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,40 @@
"workingSets": "WebAssembly",
"javaCompliance" : "17+",
"defaultBuild": False,
}
},

"graalwasm_licenses": {
"class": "StandaloneLicenses",
"community_license_file": "LICENSE",
"community_3rd_party_license_file": "THIRD_PARTY_LICENSE.txt",
},

"graalwasm_thin_launcher": {
"class": "ThinLauncherProject",
"mainClass": "org.graalvm.wasm.launcher.WasmLauncher",
"jar_distributions": ["wasm:WASM_LAUNCHER"],
"relative_home_paths": {
"wasm": "..",
},
"relative_jre_path": "../jvm",
"relative_module_path": "../modules",
"relative_extracted_lib_paths": {
"truffle.attach.library": "../jvmlibs/<lib:truffleattach>",
},
"liblang_relpath": "../lib/<lib:wasmvm>",
},

"libwasmvm": {
"class": "LanguageLibraryProject",
"dependencies": [
"GRAALWASM_STANDALONE_DEPENDENCIES",
],
"build_args": [
# From mx.wasm/native-image.properties
# Configure launcher
"-Dorg.graalvm.launcher.class=org.graalvm.wasm.launcher.WasmLauncher",
],
},
},

"externalProjects": {
Expand Down Expand Up @@ -388,5 +421,95 @@
},
"maven": False,
},

"GRAALWASM_STANDALONE_DEPENDENCIES": {
"description": "GraalWasm standalone dependencies",
"class": "DynamicPOMDistribution",
"distDependencies": [
"wasm:WASM_LAUNCHER",
"wasm:WASM",
"sdk:TOOLS_FOR_STANDALONE",
],
"dynamicDistDependencies": "graalwasm_standalone_deps",
"maven": False,
},

"GRAALWASM_STANDALONE_COMMON": {
"description": "Common layout for Native and JVM standalones",
"type": "dir",
"platformDependent": True,
"platforms": "local",
"layout": {
"./": [
"extracted-dependency:WASM_GRAALVM_SUPPORT",
"dependency:graalwasm_licenses/*",
],
"bin/<exe:wasm>": "dependency:graalwasm_thin_launcher",
"release": "dependency:sdk:STANDALONE_JAVA_HOME/release",
},
},

"GRAALWASM_NATIVE_STANDALONE": {
"description": "GraalWasm Native standalone",
"type": "dir",
"platformDependent": True,
"platforms": "local",
"layout": {
"./": [
"dependency:GRAALWASM_STANDALONE_COMMON/*",
],
"lib/": "dependency:libwasmvm",
},
},

"GRAALWASM_JVM_STANDALONE": {
"description": "GraalWasm JVM standalone",
"type": "dir",
"platformDependent": True,
"platforms": "local",
"layout": {
"./": [
"dependency:GRAALWASM_STANDALONE_COMMON/*",
],
"jvm/": {
"source_type": "dependency",
"dependency": "sdk:STANDALONE_JAVA_HOME",
"path": "*",
"exclude": [
# Native Image-related
"bin/native-image*",
"lib/static",
"lib/svm",
"lib/<lib:native-image-agent>",
"lib/<lib:native-image-diagnostics-agent>",
# Unnecessary and big
"lib/src.zip",
"jmods",
],
},
"jvmlibs/": [
"extracted-dependency:truffle:TRUFFLE_ATTACH_GRAALVM_SUPPORT",
],
"modules/": [
"classpath-dependencies:GRAALWASM_STANDALONE_DEPENDENCIES",
],
},
},

"GRAALWASM_NATIVE_STANDALONE_RELEASE_ARCHIVE": {
"class": "DeliverableStandaloneArchive",
"platformDependent": True,
"standalone_dist": "GRAALWASM_NATIVE_STANDALONE",
"community_archive_name": "graalwasm-community",
"enterprise_archive_name": "graalwasm",
},

"GRAALWASM_JVM_STANDALONE_RELEASE_ARCHIVE": {
"class": "DeliverableStandaloneArchive",
"platformDependent": True,
"standalone_dist": "GRAALWASM_JVM_STANDALONE",
"community_archive_name": "graalwasm-community-jvm",
"enterprise_archive_name": "graalwasm-jvm",
},
}
}
Loading