Skip to content

Commit 04e31e4

Browse files
woessansalond
authored andcommitted
[GR-47038] JVM standalone for Node.js.
PullRequest: js/2888
2 parents fc73a2c + 5b2dc55 commit 04e31e4

File tree

8 files changed

+174
-52
lines changed

8 files changed

+174
-52
lines changed

ci.jsonnet

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ local graalNodeJs = import 'graal-nodejs/ci.jsonnet';
4747
['git', '-C', self.graalvmtests, 'checkout', '75b6a9e16ebbfd8b9b0a24e4be7c4378e3281204'],
4848
] else [],
4949
using_artifact:: false,
50+
build_standalones:: false,
5051
setup+: self.graalvm.setup,
5152
run+: []
5253
+ self.export_envvars
@@ -111,16 +112,19 @@ local graalNodeJs = import 'graal-nodejs/ci.jsonnet';
111112
local arch = build.arch;
112113
local os_arch = os + '_' + arch;
113114
local artifactName = artifact_name_from_build(build);
115+
local mx_base_cmd = ["mx", "-p", build.cd];
114116
self.jobtemplate + common[jdk] + common[os_arch] + {
115117
graalvm:: build.graalvm,
116118
suiteimports:: build.suiteimports,
117119
nativeimages:: build.nativeimages,
118120
name: "build-" + artifactName,
119121
run+: [
120-
["mx", "-p", "graal-nodejs", "sversions"],
121-
["mx", "-p", "graal-nodejs", "graalvm-show"],
122-
["mx", "-p", "graal-nodejs", "build"],
123-
],
122+
mx_base_cmd + ["sversions"],
123+
mx_base_cmd + ["graalvm-show"],
124+
mx_base_cmd + ["build"],
125+
] + (if build.build_standalones then [
126+
mx_base_cmd + ["build", "--dependencies", "GRAALVM_STANDALONES"],
127+
] else []),
124128
publishArtifacts+: [
125129
{
126130
name: artifactName,
@@ -131,7 +135,9 @@ local graalNodeJs = import 'graal-nodejs/ci.jsonnet';
131135
"*/*/mxbuild/jdk*",
132136
"*/mxbuild",
133137
"*/graal-nodejs/out", # js/graal-nodejs/out
134-
],
138+
] + (if build.build_standalones then [
139+
"graal/sdk/mxbuild/" + os + '-' + arch + "/*STANDALONE*",
140+
] else []),
135141
},
136142
],
137143
timelimit: if std.objectHasAll(self, 'os') && (self.os == 'windows' || (self.os == 'darwin' && self.arch == 'amd64')) then '1:00:00' else '40:00',

graal-js/ci.jsonnet

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ local ci = import '../ci.jsonnet';
44
{
55
local graalJs = ci.jobtemplate + {
66
cd:: 'graal-js',
7-
suite_prefix:: 'js',
7+
suite_prefix:: 'js', # for build job names
88
// increase default timelimit on windows and darwin-amd64
99
timelimit: if 'os' in self && (self.os == 'windows' || (self.os == 'darwin' && self.arch == 'amd64')) then '1:15:00' else '45:00',
1010
},
@@ -37,14 +37,22 @@ local ci = import '../ci.jsonnet';
3737
},
3838

3939
local nativeImageSmokeTest = checkoutJsBenchmarks + {
40-
suiteimports+:: ['substratevm'],
41-
nativeimages+:: ['lib:jsvm'],
40+
suiteimports+:: ['vm', 'substratevm'],
41+
nativeimages+:: ['lib:jsvm', 'lib:jvmcicompiler'],
4242
extraimagebuilderarguments+:: ['-H:+ReportExceptionStackTraces'],
4343
run+: [
4444
['mx', 'build'],
45+
['mx', 'build', '--dependencies', 'GRAALVM_STANDALONES'],
4546
['set-export', 'GRAALVM_HOME', ['mx', '--quiet', 'graalvm-home']],
4647
['${GRAALVM_HOME}/bin/js', '--native', '-e', "print('hello:' + Array.from(new Array(10), (x,i) => i*i ).join('|'))"],
4748
['${GRAALVM_HOME}/bin/js', '--native', '../../js-benchmarks/harness.js', '--', '../../js-benchmarks/octane-richards.js', '--show-warmup'],
49+
# standalone smoke tests
50+
['set-export', 'STANDALONE_HOME', ['mx', '--quiet', 'standalone-home', 'js', '--type=native']],
51+
['${STANDALONE_HOME}/bin/js', '--native', '-e', "print('hello:' + Array.from(new Array(10), (x,i) => i*i ).join('|'))"],
52+
['${STANDALONE_HOME}/bin/js', '--native', '../../js-benchmarks/harness.js', '--', '../../js-benchmarks/octane-richards.js', '--show-warmup'],
53+
['set-export', 'STANDALONE_HOME', ['mx', '--quiet', 'standalone-home', 'js', '--type=jvm']],
54+
['${STANDALONE_HOME}/bin/js', '--jvm', '-e', "print('hello:' + Array.from(new Array(10), (x,i) => i*i ).join('|'))"],
55+
['${STANDALONE_HOME}/bin/js', '--jvm', '../../js-benchmarks/harness.js', '--', '../../js-benchmarks/octane-richards.js', '--show-warmup'],
4856
],
4957
timelimit: '30:00',
5058
},

graal-js/mx.graal-js/suite.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -481,8 +481,10 @@
481481
"subDir" : "src",
482482
"dependencies" : ["com.oracle.truffle.js.shell"],
483483
"mainClass" : "com.oracle.truffle.js.shell.JSLauncher",
484-
"distDependencies" : ["sdk:LAUNCHER_COMMON"],
485-
"exclude" : ["sdk:JLINE3"],
484+
"distDependencies" : [
485+
"sdk:LAUNCHER_COMMON",
486+
"sdk:JLINE3",
487+
],
486488
"description" : "Graal JavaScript Launcher",
487489
"maven" : {
488490
"artifactId" : "js-launcher",

graal-nodejs/ci.jsonnet

Lines changed: 18 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ local ci = import '../ci.jsonnet';
44
{
55
local graalNodeJs = ci.jobtemplate + {
66
cd:: 'graal-nodejs',
7-
suite_prefix:: 'nodejs',
7+
suite_prefix:: 'nodejs', # for build job names
88
// increase default timelimit on windows and darwin-amd64
99
timelimit: if 'os' in self && (self.os == 'windows' || (self.os == 'darwin' && self.arch == 'amd64')) then '1:15:00' else '45:00',
1010
},
@@ -16,8 +16,9 @@ local ci = import '../ci.jsonnet';
1616
// too slow on windows and darwin-amd64
1717
local enabled = 'os' in self && !(self.os == 'windows' || (self.os == 'darwin' && self.arch == 'amd64')),
1818
artifact:: if enabled then 'nodejs' else '',
19-
suiteimports+:: if enabled then ['vm', 'substratevm', 'tools'] else [],
19+
suiteimports+:: if enabled then ['vm', 'substratevm', 'tools'] else ['vm'],
2020
nativeimages+:: if enabled then ['lib:graal-nodejs', 'lib:jvmcicompiler'] else [], // 'js'
21+
build_standalones:: true,
2122
},
2223

2324
local gateTags(tags) = common.gateTags + {
@@ -29,9 +30,8 @@ local ci = import '../ci.jsonnet';
2930
local build = {
3031
run+: [
3132
['[', '${ARTIFACT_NAME}', ']', '||', 'mx', 'build', '--force-javac'], // build only if no artifact is being used
32-
] + (if 'os' in self && self.os == 'darwin' then [
33-
# Ensure correct LC_RPATH
34-
['install_name_tool', '-add_rpath', '${JAVA_HOME}/lib', 'out/Release/node', '||', 'true'],
33+
] + (if 'build_standalones' in self && self.build_standalones then [
34+
['[', '${ARTIFACT_NAME}', ']', '||', 'mx', 'build', '--force-javac', '--dependencies', 'GRAALVM_STANDALONES'],
3535
] else []),
3636
},
3737

@@ -42,21 +42,20 @@ local ci = import '../ci.jsonnet';
4242
}
4343
},
4444

45-
local gateSubstrateVmSmokeTest = {
46-
run+: [
47-
['mx', '--env', 'svm', 'build'],
48-
['set-export', 'GRAALVM_HOME', ['mx', '--quiet', '--env', 'svm', 'graalvm-home']],
49-
['${GRAALVM_HOME}/bin/node', '-e', "console.log('Hello, World!')"],
50-
['${GRAALVM_HOME}/bin/npm', '--version'],
51-
],
52-
},
53-
54-
local gateVmSmokeTest = build + {
45+
local gateVmSmokeTest = {
5546
run+: [
5647
['set-export', 'GRAALVM_HOME', ['mx', '--quiet', 'graalvm-home']],
5748
['${GRAALVM_HOME}/bin/node', '-e', "console.log('Hello, World!')"],
5849
['${GRAALVM_HOME}/bin/npm', '--version'],
59-
],
50+
# standalone smoke tests
51+
['set-export', 'STANDALONE_HOME', ['mx', '--quiet', 'standalone-home', 'nodejs', '--type=jvm']],
52+
['${STANDALONE_HOME}/bin/node', '-e', "console.log('Hello, World!')"],
53+
['${STANDALONE_HOME}/bin/npm', '--version'],
54+
] + (if std.find('substratevm', super.suiteimports) != [] then [
55+
['set-export', 'STANDALONE_HOME', ['mx', '--quiet', 'standalone-home', 'nodejs', '--type=native']],
56+
['${STANDALONE_HOME}/bin/node', '-e', "console.log('Hello, World!')"],
57+
['${STANDALONE_HOME}/bin/npm', '--version'],
58+
] else []),
6059
},
6160

6261
local gateCoverage = {
@@ -136,18 +135,11 @@ local ci = import '../ci.jsonnet';
136135
promoteToTarget(common.gate, [common.jdk21 + common.linux_amd64, common.jdk21 + common.linux_aarch64, common.jdk21 + common.darwin_aarch64, common.jdk21 + common.windows_amd64]) +
137136
promoteToTarget(common.postMerge, [common.jdk21 + common.darwin_amd64]),
138137

139-
graalNodeJs + gateSubstrateVmSmokeTest + {name: 'substratevm-ce'} +
140-
excludePlatforms([ci.mainGatePlatform]) +
138+
graalNodeJs + vm_env + build + gateVmSmokeTest + ce + {name: 'graalvm-ce'} +
139+
promoteToTarget(common.gate, [ci.mainGatePlatform]) +
141140
promoteToTarget(common.gate, [common.jdk21 + common.darwin_aarch64, common.jdk21 + common.windows_amd64]) +
142141
promoteToTarget(common.postMerge, [common.jdk21 + common.darwin_amd64]),
143-
graalNodeJs + gateSubstrateVmSmokeTest + {name: 'substratevm-ee'} +
144-
excludePlatforms([ci.mainGatePlatform]),
145-
# We run either gateSubstrateVmSmokeTest or gateVmSmokeTest, but not both.
146-
graalNodeJs + vm_env + gateVmSmokeTest + ce + {name: 'graalvm-ce'} +
147-
includePlatforms([ci.mainGatePlatform]) +
148-
promoteToTarget(common.gate, [ci.mainGatePlatform]),
149-
graalNodeJs + vm_env + gateVmSmokeTest + ee + {name: 'graalvm-ee'} +
150-
includePlatforms([ci.mainGatePlatform]) +
142+
graalNodeJs + vm_env + build + gateVmSmokeTest + ee + {name: 'graalvm-ee'} +
151143
promoteToTarget(common.gate, [ci.mainGatePlatform]),
152144

153145
graalNodeJs + vm_env + build + auxEngineCache + ee + {name: 'aux-engine-cache'} + gateOnMain +

0 commit comments

Comments
 (0)