From 9b89d6d6439de04432b5ab2d93155ed13b394447 Mon Sep 17 00:00:00 2001 From: "maul.esel" Date: Wed, 6 Nov 2024 18:14:57 +0100 Subject: [PATCH 1/3] Ultimate: add new expected launcher JAR --- benchexec/tools/ultimate.py | 1 + 1 file changed, 1 insertion(+) diff --git a/benchexec/tools/ultimate.py b/benchexec/tools/ultimate.py index 236699a99..219a735d9 100644 --- a/benchexec/tools/ultimate.py +++ b/benchexec/tools/ultimate.py @@ -30,6 +30,7 @@ _LAUNCHER_JARS = [ "plugins/org.eclipse.equinox.launcher_1.5.800.v20200727-1323.jar", "plugins/org.eclipse.equinox.launcher_1.3.100.v20150511-1540.jar", + "plugins/org.eclipse.equinox.launcher_1.6.800.v20240513-1750.jar", ] From a4f6c4dcf2d6e4f087eefde3ac46e5aa96a4dc6e Mon Sep 17 00:00:00 2001 From: "maul.esel" Date: Wed, 6 Nov 2024 18:21:46 +0100 Subject: [PATCH 2/3] Ultimate: fix search for available java The previous search failed to use the java version on the PATH, as glob.glob("java") always returned the empty list. The new version coincides more closely with the implementation in the Ultimate.py wrapper script, and thus should ensure that the same java version is used from the tool info module and by Ultimate itself. Also not explicitly that the two implementations should match. --- benchexec/tools/ultimate.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/benchexec/tools/ultimate.py b/benchexec/tools/ultimate.py index 219a735d9..8cad56f69 100644 --- a/benchexec/tools/ultimate.py +++ b/benchexec/tools/ultimate.py @@ -467,6 +467,8 @@ def get_value_from_output(self, output, identifier): return None def get_java_installations(self): + # The code in this method is (and should remain) consistent with the method `get_java` in + # . candidates = [ "java", "/usr/bin/java", @@ -475,11 +477,16 @@ def get_java_installations(self): "/usr/lib/jvm/java-*-openjdk-amd64/bin/java", ] - candidates = [c for entry in candidates for c in glob.glob(entry)] + candidates_extended = [] + for c in candidates: + if "*" in c: + candidates_extended += glob.glob(c) + else: + candidates_extended += [c] pattern = r'"(\d+\.\d+).*"' rtr = {} - for c in candidates: + for c in candidates_extended: candidate = shutil.which(c) if not candidate: continue From e292b96916e25f9c7cc6a02ae06be2f096b5bd3e Mon Sep 17 00:00:00 2001 From: Daniel Dietsch Date: Wed, 6 Nov 2024 19:58:52 +0100 Subject: [PATCH 3/3] do not look for Ultimate binary to verify Ultimate dir, look for one of the launchers --- benchexec/tools/ultimate.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/benchexec/tools/ultimate.py b/benchexec/tools/ultimate.py index 8cad56f69..c78d8e908 100644 --- a/benchexec/tools/ultimate.py +++ b/benchexec/tools/ultimate.py @@ -10,6 +10,7 @@ import glob import logging import os +from pathlib import Path import re import shlex import shutil @@ -72,15 +73,13 @@ def project_url(self): def executable(self, tool_locator): exe = tool_locator.find_executable("Ultimate.py") - dir_name = os.path.dirname(exe) - logging.debug("Looking in %s for Ultimate and plugins/", dir_name) - for _, dir_names, file_names in os.walk(dir_name): - if "Ultimate" in file_names and "plugins" in dir_names: - return exe - break + dir_name = Path(os.path.dirname(exe)) + logging.debug("Checking if %s contains a launcher jar", dir_name) + if any([(dir_name / rel_launcher).exists() for rel_launcher in _LAUNCHER_JARS]): + return exe msg = ( f"ERROR: Did find a Ultimate.py in {os.path.dirname(exe)} " - f"but no 'Ultimate' or no 'plugins' directory besides it" + f"but no launcher .jar besides it" ) raise ToolNotFoundException(msg)