Skip to content

Commit 0bb4c35

Browse files
committed
[GR-63589] Adopt the new unchained standalones for GraalWasm.
PullRequest: graal/20564
2 parents c2b7858 + 969cb0c commit 0bb4c35

File tree

3 files changed

+132
-1
lines changed

3 files changed

+132
-1
lines changed

wasm/THIRD_PARTY_LICENSE.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
GraalWasm has no third-party dependencies.

wasm/mx.wasm/mx_wasm.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@
5656
from mx_gate import Task, add_gate_runner
5757
from mx_unittest import unittest
5858

59+
# re-export custom mx project classes, so they can be used from suite.py
60+
from mx_sdk_vm_ng import StandaloneLicenses, ThinLauncherProject, LanguageLibraryProject, DynamicPOMDistribution, DeliverableStandaloneArchive # pylint: disable=unused-import
61+
5962
_suite = mx.suite("wasm")
6063

6164
emcc_dir = mx.get_env("EMCC_DIR", None)
@@ -84,6 +87,10 @@ def get_jdk(forBuild=False):
8487
else:
8588
return mx.get_jdk()
8689

90+
# Called from suite.py
91+
def graalwasm_standalone_deps():
92+
return mx_truffle.resolve_truffle_dist_names()
93+
8794
#
8895
# Gate runners.
8996
#

wasm/mx.wasm/suite.py

Lines changed: 124 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,40 @@
214214
"workingSets": "WebAssembly",
215215
"javaCompliance" : "17+",
216216
"defaultBuild": False,
217-
}
217+
},
218+
219+
"graalwasm_licenses": {
220+
"class": "StandaloneLicenses",
221+
"community_license_file": "LICENSE",
222+
"community_3rd_party_license_file": "THIRD_PARTY_LICENSE.txt",
223+
},
224+
225+
"graalwasm_thin_launcher": {
226+
"class": "ThinLauncherProject",
227+
"mainClass": "org.graalvm.wasm.launcher.WasmLauncher",
228+
"jar_distributions": ["wasm:WASM_LAUNCHER"],
229+
"relative_home_paths": {
230+
"wasm": "..",
231+
},
232+
"relative_jre_path": "../jvm",
233+
"relative_module_path": "../modules",
234+
"relative_extracted_lib_paths": {
235+
"truffle.attach.library": "../jvmlibs/<lib:truffleattach>",
236+
},
237+
"liblang_relpath": "../lib/<lib:wasmvm>",
238+
},
239+
240+
"libwasmvm": {
241+
"class": "LanguageLibraryProject",
242+
"dependencies": [
243+
"GRAALWASM_STANDALONE_DEPENDENCIES",
244+
],
245+
"build_args": [
246+
# From mx.wasm/native-image.properties
247+
# Configure launcher
248+
"-Dorg.graalvm.launcher.class=org.graalvm.wasm.launcher.WasmLauncher",
249+
],
250+
},
218251
},
219252

220253
"externalProjects": {
@@ -388,5 +421,95 @@
388421
},
389422
"maven": False,
390423
},
424+
425+
"GRAALWASM_STANDALONE_DEPENDENCIES": {
426+
"description": "GraalWasm standalone dependencies",
427+
"class": "DynamicPOMDistribution",
428+
"distDependencies": [
429+
"wasm:WASM_LAUNCHER",
430+
"wasm:WASM",
431+
"sdk:TOOLS_FOR_STANDALONE",
432+
],
433+
"dynamicDistDependencies": "graalwasm_standalone_deps",
434+
"maven": False,
435+
},
436+
437+
"GRAALWASM_STANDALONE_COMMON": {
438+
"description": "Common layout for Native and JVM standalones",
439+
"type": "dir",
440+
"platformDependent": True,
441+
"platforms": "local",
442+
"layout": {
443+
"./": [
444+
"extracted-dependency:WASM_GRAALVM_SUPPORT",
445+
"dependency:graalwasm_licenses/*",
446+
],
447+
"bin/<exe:wasm>": "dependency:graalwasm_thin_launcher",
448+
"release": "dependency:sdk:STANDALONE_JAVA_HOME/release",
449+
},
450+
},
451+
452+
"GRAALWASM_NATIVE_STANDALONE": {
453+
"description": "GraalWasm Native standalone",
454+
"type": "dir",
455+
"platformDependent": True,
456+
"platforms": "local",
457+
"layout": {
458+
"./": [
459+
"dependency:GRAALWASM_STANDALONE_COMMON/*",
460+
],
461+
"lib/": "dependency:libwasmvm",
462+
},
463+
},
464+
465+
"GRAALWASM_JVM_STANDALONE": {
466+
"description": "GraalWasm JVM standalone",
467+
"type": "dir",
468+
"platformDependent": True,
469+
"platforms": "local",
470+
"layout": {
471+
"./": [
472+
"dependency:GRAALWASM_STANDALONE_COMMON/*",
473+
],
474+
"jvm/": {
475+
"source_type": "dependency",
476+
"dependency": "sdk:STANDALONE_JAVA_HOME",
477+
"path": "*",
478+
"exclude": [
479+
# Native Image-related
480+
"bin/native-image*",
481+
"lib/static",
482+
"lib/svm",
483+
"lib/<lib:native-image-agent>",
484+
"lib/<lib:native-image-diagnostics-agent>",
485+
# Unnecessary and big
486+
"lib/src.zip",
487+
"jmods",
488+
],
489+
},
490+
"jvmlibs/": [
491+
"extracted-dependency:truffle:TRUFFLE_ATTACH_GRAALVM_SUPPORT",
492+
],
493+
"modules/": [
494+
"classpath-dependencies:GRAALWASM_STANDALONE_DEPENDENCIES",
495+
],
496+
},
497+
},
498+
499+
"GRAALWASM_NATIVE_STANDALONE_RELEASE_ARCHIVE": {
500+
"class": "DeliverableStandaloneArchive",
501+
"platformDependent": True,
502+
"standalone_dist": "GRAALWASM_NATIVE_STANDALONE",
503+
"community_archive_name": "graalwasm-community",
504+
"enterprise_archive_name": "graalwasm",
505+
},
506+
507+
"GRAALWASM_JVM_STANDALONE_RELEASE_ARCHIVE": {
508+
"class": "DeliverableStandaloneArchive",
509+
"platformDependent": True,
510+
"standalone_dist": "GRAALWASM_JVM_STANDALONE",
511+
"community_archive_name": "graalwasm-community-jvm",
512+
"enterprise_archive_name": "graalwasm-jvm",
513+
},
391514
}
392515
}

0 commit comments

Comments
 (0)