|
33 | 33 | _SVCOMP17_VERSIONS = {"f7c3ed31"} |
34 | 34 | _SVCOMP17_FORBIDDEN_FLAGS = {"--full-output", "--architecture"} |
35 | 35 | _ULTIMATE_VERSION_REGEX = re.compile(r"^Version is (.*)$", re.MULTILINE) |
36 | | -# .jar files that are used as launcher arguments with most recent .jar first |
37 | | -_LAUNCHER_JARS = [ |
38 | | - "plugins/org.eclipse.equinox.launcher_1.5.800.v20200727-1323.jar", |
39 | | - "plugins/org.eclipse.equinox.launcher_1.3.100.v20150511-1540.jar", |
40 | | - "plugins/org.eclipse.equinox.launcher_1.6.800.v20240513-1750.jar", |
41 | | -] |
| 36 | +_JAR_LAUNCHER_PATTERN = r"plugins/org.eclipse.equinox.launcher_*.jar" |
42 | 37 |
|
43 | 38 |
|
44 | 39 | class UltimateTool(benchexec.tools.template.BaseTool2): |
@@ -81,7 +76,7 @@ def executable(self, tool_locator): |
81 | 76 | exe = tool_locator.find_executable("Ultimate.py") |
82 | 77 | dir_name = Path(os.path.dirname(exe)) |
83 | 78 | logging.debug("Checking if %s contains a launcher jar", dir_name) |
84 | | - if any((dir_name / rel_launcher).exists() for rel_launcher in _LAUNCHER_JARS): |
| 79 | + if any(dir_name.glob(_JAR_LAUNCHER_PATTERN)): |
85 | 80 | return exe |
86 | 81 | msg = ( |
87 | 82 | f"ERROR: Did find a Ultimate.py in {os.path.dirname(exe)} " |
@@ -169,11 +164,12 @@ def _query_ultimate_version(self, cmd, api): |
169 | 164 | @functools.lru_cache |
170 | 165 | def _get_current_launcher_jar(self, executable): |
171 | 166 | ultimate_dir = os.path.dirname(executable) |
172 | | - for jar in _LAUNCHER_JARS: |
173 | | - launcher_jar = os.path.join(ultimate_dir, jar) |
174 | | - if os.path.isfile(launcher_jar): |
175 | | - return launcher_jar |
176 | | - raise FileNotFoundError(f"No suitable launcher jar found in {ultimate_dir}") |
| 167 | + launcher_candidates = glob.glob(_JAR_LAUNCHER_PATTERN, root_dir=ultimate_dir) |
| 168 | + if not launcher_candidates: |
| 169 | + raise FileNotFoundError(f"No suitable launcher jar found in {ultimate_dir}") |
| 170 | + if len(launcher_candidates) > 1: |
| 171 | + raise FileNotFoundError(f"Multiple launcher jars found in {ultimate_dir}") |
| 172 | + return os.path.join(ultimate_dir, launcher_candidates[0]) |
177 | 173 |
|
178 | 174 | @functools.lru_cache |
179 | 175 | def version(self, executable): |
|
0 commit comments