Skip to content

Commit 760a709

Browse files
committed
Only build GraalJDK for unittests if the compiler suite is imported.
1 parent 75c869d commit 760a709

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

sulong/mx.sulong/mx_sulong_gate.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -158,12 +158,13 @@ def _unittest(title, test_suite, tags=None, testClasses=None, unittestArgs=None,
158158
else:
159159
slowStandalone = standaloneMode == "jvm"
160160

161-
with Task('Build GraalJDK', tasks, tags=['standalone']) as t:
162-
# building GraalJDK to work around a bug in the mx support code of the compiler suite
163-
# `mx unittest` doesn't work if this is not built, and we want to avoid doing a full `mx build` in the standalone jobs
164-
if t:
165-
import mx_compiler
166-
mx.command_function('build')(['--dependencies', mx_compiler._graaljdk_dist(edition='ce').name])
161+
if mx.suite('compiler', fatalIfMissing=False):
162+
with Task('Build GraalJDK', tasks, tags=['standalone']) as t:
163+
# building GraalJDK to work around a bug in the mx support code of the compiler suite
164+
# `mx unittest` doesn't work if compiler is imported and this is not built, and we want to avoid doing a full `mx build` in the standalone jobs
165+
if t:
166+
import mx_compiler
167+
mx.command_function('build')(['--dependencies', mx_compiler._graaljdk_dist(edition='ce').name])
167168

168169
if standaloneMode == "native":
169170
with Task('Build Native LLVM Standalone', tasks, tags=['standalone']) as t:

0 commit comments

Comments
 (0)