Skip to content

Commit 0e3bf9d

Browse files
committed
fix: resolve ESBMC binary path from $PATH and print config file on load
Allow setting verifier.esbmc.path to just "esbmc" by resolving it via shutil.which() before pydantic's FilePath validation. Also print which config file is being loaded during startup.
1 parent 06ee80a commit 0e3bf9d

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

esbmc_ai/config.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import logging
99
import os
1010
from pathlib import Path
11+
import shutil
1112

1213
from pydantic_settings import (
1314
BaseSettings,
@@ -292,6 +293,10 @@ class ESBMCConfig(BaseModel):
292293
def on_set_path(cls, value: FilePath | None) -> Path | None:
293294
if value is None:
294295
return None
296+
# Try resolving the command from $PATH (e.g. "esbmc" without a full path).
297+
which_path: str | None = shutil.which(str(value))
298+
if which_path:
299+
return Path(which_path)
295300
return Path(value).expanduser()
296301

297302
params: list[str] = Field(
@@ -616,6 +621,7 @@ def settings_customise_sources(
616621
if config_file_path:
617622
config_file = Path(config_file_path).expanduser()
618623
if config_file.exists():
624+
print(f"Loading config file: {config_file}")
619625
sources.append(TomlConfigSettingsSource(settings_cls, config_file))
620626

621627
# Add environment-based sources

0 commit comments

Comments
 (0)