From 888a0adf2a447f9c7bd6dbf1527269ead778c156 Mon Sep 17 00:00:00 2001 From: Daniel Dietsch Date: Wed, 6 Nov 2024 19:58:52 +0100 Subject: [PATCH] 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 219a735d9..e1e75f799 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(f"Checking if {dir_name} contains a launcher jar") + 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)