Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Fuser/compose_end_to_end.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions Fuser/paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]:
Expand Down