beehive-lab / TornadoVM

TornadoVM: A practical and efficient heterogeneous programming framework for managed languages
https://www.tornadovm.org
Apache License 2.0
1.16k stars 109 forks source link

Installation script using `--javaHome` fails #391

Closed spamegg1 closed 2 months ago

spamegg1 commented 2 months ago

Describe the bug

Using SDKMAN to manage JDKs, following the advice given in --listJDKs

If you want to select another version of OpenJDK, you can use --javaHome <pathToJavaHome> and install as follows:
      $ ./bin/tornadovm-installer --backend <BACKEND> --javaHome <pathToJavaHome>

installation fails to start, with a TypeError.

How To Reproduce

$ git clone https://github.com/beehive-lab/TornadoVM/
$ cd TornadoVM
$ ./bin/tornadovm-installer --backend opencl --javaHome /home/spam/.sdkman/candidates/java/current/                 
Traceback (most recent call last):
  File "/home/spam/Public/TornadoVM/./bin/tornadovm-installer", line 436, in <module>
    installer.install(args)
  File "/home/spam/Public/TornadoVM/./bin/tornadovm-installer", line 318, in install
    if (args.javaHome != None and "graal" in args.javaHome) or ("graal" in args.jdk):
TypeError: argument of type 'NoneType' is not iterable

Expected behavior

Installation should work fine.

Computing system setup (please complete the following information):

Additional context

Add any other context about the problem here.


jjfumero commented 2 months ago

Thank you for the report. I can reproduce it.

In the mean while, while we fix this, you can try the following:

./bin/tornadovm-installer --backend opencl --jdk jdk21
spamegg1 commented 2 months ago

Thanks for the super fast response! :heart: I tried your suggestion and it built successfully.

jjfumero commented 2 months ago

You can apply also this path. I will open a PR in a bit:

git diff
diff --git a/bin/tornadovm-installer b/bin/tornadovm-installer
index 4e16bdad2..e27677590 100755
--- a/bin/tornadovm-installer
+++ b/bin/tornadovm-installer
@@ -315,7 +315,7 @@ class TornadoInstaller:

         makeJDK = "jdk21"
         polyglotOption = ""
-        if (args.javaHome != None and "graal" in args.javaHome) or ("graal" in args.jdk):
+        if (args.javaHome != None and "graal" in args.javaHome) or (args.jdk != None and "graal" in args.jdk):
             makeJDK = "graal-jdk-21"
             polyglotOption = self.composePolyglotOption(args)
stratika commented 2 months ago

The PR with the fix is now merged. Please pull master or develop and try it. If you have any further issue, feel free to reopen the issue. I will close it.