Skip to content

Print directory change notifications around tool execution#511

Merged
olofk merged 2 commits intoolofk:mainfrom
per-rtl:build/print_dirchange
Mar 30, 2026
Merged

Print directory change notifications around tool execution#511
olofk merged 2 commits intoolofk:mainfrom
per-rtl:build/print_dirchange

Conversation

@per-rtl
Copy link
Copy Markdown
Contributor

@per-rtl per-rtl commented Mar 27, 2026

Summary

  • Print Entering directory '...' and Leaving directory '...' around tool invocations in _run_tool()
  • Enables editors (Emacs, etc.) to resolve file paths in tool output when running from a build directory

Motivation

When edalize runs a tool (e.g. slang for linting), it sets cwd=self.work_root, so the tool reports file paths relative to the build directory. Editors that parse compiler output (like Emacs compilation-mode) cannot resolve these paths back to the source files.

GNU Make solved this with Entering directory / Leaving directory messages. This patch adds the same convention to edalize so that editor integrations work out of the box.

Test plan

  • Run any edalize-backed tool (e.g. fusesoc run --target=slanglint ...)
  • Verify Entering directory and Leaving directory appear in output
  • Verify editor can resolve relative file paths in tool output to correct source locations

@per-rtl per-rtl marked this pull request as ready for review March 27, 2026 20:59
@olofk
Copy link
Copy Markdown
Owner

olofk commented Mar 30, 2026

Looks good. Wondering if you want to enable the same for the Flow API backends too in edalize/tools/edatool.py

@olofk olofk merged commit b0e45b3 into olofk:main Mar 30, 2026
7 checks passed
@per-rtl
Copy link
Copy Markdown
Contributor Author

per-rtl commented Apr 1, 2026

Looks good. Wondering if you want to enable the same for the Flow API backends too in edalize/tools/edatool.py

Seems like we should, will look into it.

olofk pushed a commit that referenced this pull request Apr 1, 2026
Extends the Entering directory / Leaving directory notifications from Print directory change notifications around tool execution #511 to the Flow API's _run_tool() in edalize/flows/edaflow.py
Adds unit tests covering both legacy and Flow API _run_tool() directory notifications
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants