Skip to content

Commit f9fd168

Browse files
committed
nix-eval-warnings: handle lazy-trees source locations
Nix 2.34 with lazy trees prints stack-trace source locations as «flakeref»/rel/path.nix:line:col instead of a plain store path, so extract_source() matched nothing and warnings lost their source, breaking the package's own test suite in CI (build #395). Match the guillemet form and return the flake-relative path. Also annotate re.findall's result to fix a pre-existing mypy no-any-return error.
1 parent 9e78932 commit f9fd168

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • pkgs/nix-eval-warnings/src/nix_eval_warnings

pkgs/nix-eval-warnings/src/nix_eval_warnings/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def extract_error_message(error_text: str) -> str:
8989
Looks for the main error message after the stack trace.
9090
"""
9191
# Look for "error: <message>" pattern - get the last one (most specific)
92-
matches = re.findall(r"error:\s*(.+?)(?:\n|$)", error_text)
92+
matches: list[str] = re.findall(r"error:\s*(.+?)(?:\n|$)", error_text)
9393
for match in reversed(matches):
9494
msg = match.strip()
9595
# Skip generic messages like "aborting" or stack trace fragments

0 commit comments

Comments
 (0)