diff --git a/Fuser/compose_end_to_end.py b/Fuser/compose_end_to_end.py index 347cf5f..3331090 100644 --- a/Fuser/compose_end_to_end.py +++ b/Fuser/compose_end_to_end.py @@ -84,6 +84,7 @@ def _load_kernels_from_summary(summary_path: Path) -> list[KernelItem]: if not isinstance(data, list): raise SystemExit("kernels summary must be a JSON array (from dispatch step)") items: list[KernelItem] = [] + summary_dir = summary_path.parent for it in data: if not isinstance(it, dict): continue @@ -95,6 +96,9 @@ def _load_kernels_from_summary(summary_path: Path) -> list[KernelItem]: if not sid or not kpath_str: continue kpath = Path(kpath_str) + # If path is relative, resolve it relative to summary.json location + if not kpath.is_absolute(): + kpath = summary_dir / kpath if not kpath.is_file(): continue code = _read_text(kpath) diff --git a/Fuser/paths.py b/Fuser/paths.py index 90065c8..8c82897 100644 --- a/Fuser/paths.py +++ b/Fuser/paths.py @@ -25,14 +25,14 @@ def ensure_abs_regular_file(p: str | Path) -> Path: if not path.is_absolute(): raise PathSafetyError(f"problem path must be absolute: {path}") try: - st = path.lstat() + # Resolve symlinks to get the real path + resolved_path = path.resolve() + st = resolved_path.stat() except FileNotFoundError: raise PathSafetyError(f"problem path does not exist: {path}") - if stat.S_ISLNK(st.st_mode): - raise PathSafetyError(f"problem path must not be a symlink: {path}") if not stat.S_ISREG(st.st_mode): raise PathSafetyError(f"problem path must be a regular file: {path}") - return path + return resolved_path def make_run_dirs(base: Path, run_id: str) -> dict[str, Path]: