[llvm] [LLVM] Remove explicit dependency on builtins build (PR #159854)
    Joseph Huber via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Wed Sep 24 11:37:52 PDT 2025
    
    
  
jhuber6 wrote:
> I tried change locally and looked at the generated Ninja file but I don't see any dependency edge between `builtins-*` and `runtimes-*` targets; while `runtimes/all` depends on both `builtins-*` and `runtimes-*` targets, there's no guarantee that former will be built before the latter, so I'm not convinced this change is correct and it may be working purely by luck.
> 
Yeah, I'm going to assume that things in the `all` target are built in some 'undetermined' order, which is probably just the order they were added. But, it doesn't seem to mandate this anywhere so we can't technically depend on it.
> I think the correct solution would be to avoid relying on [`DEPENDS` in `ExternalProject_Add`](https://github.com/llvm/llvm-project/blob/f95aacaf0465925e508d019b47efcb635428d049/llvm/cmake/modules/LLVMExternalProjectUtils.cmake#L382) which adds a dependency to all steps and instead use [`ExternalProject_Add_StepDependencies`](https://cmake.org/cmake/help/latest/module/ExternalProject.html#command:externalproject_add_stepdependencies) to add fine-grained dependencies between targets that need them, but that's going to need some refactoring in [`LLVMExternalProjectUtils.cmake`](https://github.com/llvm/llvm-project/blob/f95aacaf0465925e508d019b47efcb635428d049/llvm/cmake/modules/LLVMExternalProjectUtils.cmake).
The problem is that the dependency edge is always considered stale. I suppose this method would let us correctly inform the step of dependencies without the build always functionality? I could try looking at it, because I'm eager to fix this since it has probably cost me literal days of unnecessary rebuild time as a trivial change that should take 2 seconds instead takes 90 seconds.
https://github.com/llvm/llvm-project/pull/159854
    
    
More information about the llvm-commits
mailing list