[llvm] [lit] Add stream-injectable run() core to builtin diff (PR #204869)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 22 19:28:20 PDT 2026
================
----------------
prasoon054 wrote:
The `try / except` block here isn't a fallback, it's a workaround for two different the script gets loaded:
- In-process: The script is loaded via `lit.builtin_commands.diff`, so the module must be imported as `lit.util`.
- Standalone script (current way): The script runs with `PYTHONPATH` set directly to `lit/`, meaning it must be imported flat as `util`.
Since neither import works for both environments, the conditional block is required even for our function call.
This is purely transitional. Once the legacy path is removed in the next PR, this will collapse into a clean `import lit.util`. I'll add a comment in the code to clarify this.
https://github.com/llvm/llvm-project/pull/204869
More information about the llvm-commits
mailing list