labath added a comment.

In D83840#2154263 <https://reviews.llvm.org/D83840#2154263>, @shafik wrote:

> @labath why do we need two copies of `use_lldb_suite.py`?


This script is responsible for setting up an appropriate python import path. 
Before we can import any code in lldb/third_party/Python/module or 
lldb/packages/Python, we need to add those paths to `sys.path`. And we cannot 
completely put this code into a central place because then we wouldn't know how 
to import that.

So, the way get around that is by placing this file into the same folder as the 
script that needs it. Then, the script can load this file using a relative 
import, and afterwards, it can import anything it wants. And since we have 
scripts needing this functionality in multiple places, we have multiple copies 
of the script.

At least that's the current state of the art. It's possible that there are 
better solutions, but we just don't know about them.

I wouldn't say this is a major problem. These files don't get a lot of traffic 
-- this is pretty much the second change since they were added five years ago, 
and the only reason we ran into this is because it caused problems in our weird 
internal distributed build setup. But removing the duplication would certainly 
be nice...


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D83840/new/

https://reviews.llvm.org/D83840



_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to