Skip to content

Commit 42d6e95

Browse files
woessimanemamri
authored andcommitted
Prefer GraalVMJDKConfig over GraalJVMCIJDKConfig as the latter may not have been built.
1 parent 4a1ef40 commit 42d6e95

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

graal-js/mx.graal-js/mx_graal_js.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,15 @@
5050

5151
def get_jdk(forBuild=False):
5252
# Graal.nodejs requires a JDK at build time, to be passed as argument to `./configure`.
53+
# GraalVMJDKConfig (`tag='graalvm'`) is not available until all the components are built.
5354
# GraalJVMCIJDKConfig (`tag='jvmci'`) is not available until all required jars are built.
54-
if not forBuild and mx.suite('compiler', fatalIfMissing=False):
55-
return mx.get_jdk(tag='jvmci')
56-
else:
57-
return mx.get_jdk()
55+
if not forBuild:
56+
jdk = mx.get_jdk(tag='graalvm')
57+
if exists(jdk.home):
58+
return jdk
59+
elif mx.suite('compiler', fatalIfMissing=False):
60+
return mx.get_jdk(tag='jvmci')
61+
return mx.get_jdk()
5862

5963
class GraalJsDefaultTags:
6064
default = 'default'

0 commit comments

Comments
 (0)