[llvm] [mlgo-utils] Hoist entry script out to the correct directory (PR #146981)

Vincent Lee via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 3 18:59:37 PDT 2025


thevinster wrote:

> Have you tested that the binaries still work like this when installed through the pip package? That's the primary way I've been using them.

I didn't realize these could also be installed through pip. From the looks of it, there's a top level wrapper that I can see that essentially just imports the main file and then executes it. This is the model that lit has well, with the exception that the source tree doesn't contain that wrapper in llvm that pip has created. 

> Why exactly does this need to be changed though? I don't know if the external definitions have ever been tested, and the internal (to Google) rules for these binaries are a bit different because you can't import a python project with a hyphen in it (like `llvm-project`), but it works just fine after symlinking all the files to a different directory in the same structure.

The purpose of moving is not related to the script itself but more related to the structure of those files. The context here is that there's another build system (buck) which has very similar internal mechanics to bazel (both operate on Starlark). We're trying to experiment by converting bazel rules to buck rules so we can also be able to build llvm and friends with buck. It would be great if we can rely on the bazel definitions as is to build the same target. Unfortunately, with buck, we'd have to execute the binary as if it was invoked by the interpreter directly (which you can see in the summary).

This PR would allow us to converge on one implementation that bazel and buck could use. If this is breaking some other mechanism, we can always do other internal hacks to get it working. I figured I'd try to see if we can have harmony first between the build systems first before resorting to other solutions. 

https://github.com/llvm/llvm-project/pull/146981


More information about the llvm-commits mailing list