@@ -561,10 +561,12 @@ public List<String> getBuilderJavaArgs() {
561
561
*/
562
562
public List <Path > getBuilderModulePath () {
563
563
List <Path > result = new ArrayList <>();
564
- // Non-jlinked JDKs need truffle and graal-sdk on the module path since they
565
- // don't have those modules as part of the JDK.
564
+ // Non-jlinked JDKs need truffle and word, collections, nativeimage on the
565
+ // module path since they don't have those modules as part of the JDK. Note
566
+ // that graal-sdk is now obsolete after the split in GR-43819 (#7171)
566
567
if (libJvmciDir != null ) {
567
- result .addAll (getJars (libJvmciDir , "graal-sdk" , "enterprise-graal" ));
568
+ result .addAll (getJars (libJvmciDir , "enterprise-graal" ));
569
+ result .addAll (getJars (libJvmciDir , "word" , "collections" , "nativeimage" ));
568
570
}
569
571
if (modulePathBuild ) {
570
572
result .addAll (createTruffleBuilderModulePath ());
@@ -574,19 +576,37 @@ public List<Path> getBuilderModulePath() {
574
576
}
575
577
576
578
private List <Path > createTruffleBuilderModulePath () {
577
- List <Path > jars = getJars (rootDir .resolve (Paths .get ("lib" , "truffle" )), "truffle-api" , "truffle-runtime" , "truffle-enterprise" );
579
+ Path libTruffleDir = rootDir .resolve (Paths .get ("lib" , "truffle" ));
580
+ List <Path > jars = getJars (libTruffleDir , "truffle-api" , "truffle-runtime" , "truffle-enterprise" );
578
581
if (!jars .isEmpty ()) {
579
582
/*
580
583
* If Truffle is installed as part of the JDK we always add the builder modules of
581
584
* Truffle to the builder module path. This is legacy support and should in the
582
585
* future no longer be needed.
583
586
*/
584
- jars .addAll (getJars (rootDir . resolve ( Paths . get ( "lib" , "truffle" )) , "truffle-compiler" ));
587
+ jars .addAll (getJars (libTruffleDir , "truffle-compiler" ));
585
588
Path builderPath = rootDir .resolve (Paths .get ("lib" , "truffle" , "builder" ));
586
589
if (Files .exists (builderPath )) {
587
- jars .addAll (getJars (builderPath , "truffle-runtime-svm" , "truffle-enterprise-svm" ));
590
+ List <Path > truffleRuntimeSVMJars = getJars (builderPath , "truffle-runtime-svm" , "truffle-enterprise-svm" );
591
+ jars .addAll (truffleRuntimeSVMJars );
592
+ if (libJvmciDir != null && !truffleRuntimeSVMJars .isEmpty ()) {
593
+ // truffle-runtime-svm depends on polyglot, which is not part of non-jlinked
594
+ // JDKs
595
+ jars .addAll (getJars (libJvmciDir , "polyglot" ));
596
+ }
597
+ }
598
+ if (libJvmciDir != null ) {
599
+ // truffle-runtime depends on polyglot, which is not part of non-jlinked JDKs
600
+ jars .addAll (getJars (libTruffleDir , "jniutils" ));
588
601
}
589
602
}
603
+ /*
604
+ * Non-Jlinked JDKs don't have truffle-compiler as part of the JDK, however the native
605
+ * image builder still needs it
606
+ */
607
+ if (libJvmciDir != null ) {
608
+ jars .addAll (getJars (libTruffleDir , "truffle-compiler" ));
609
+ }
590
610
591
611
return jars ;
592
612
}
0 commit comments