Bug 15851

Summary: Investigate and reduce significant build time increase
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Randy MacLeod <randy.macleod>
Component: deploymentAssignee: Ross Burton <ross.burton>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium+ CC: raj.khem, ross.burton, sundeep.kokkonda, sundeep.kokkonda
Version: 5.3   
Target Milestone: 5.3 M3   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Don't know
Bug Depends on:    
Bug Blocks: 15852    

Description Randy MacLeod 2025-05-06 17:19:01 UTC
Looking at the build time trend in:

https://valkyrie.yocto.io/pub/non-release/20250506-54/testresults/buildperf-alma8/perf-alma8-vk_master_20250506090028_601b05a298.html

for test1: Build core-image-sato
you can see that we have had two increases recently:

1. Commit 78042 - likley mesa: build time went from ~41 to ~61 minutes
   Log: https://git.yoctoproject.org/poky/log/?id=122e9a49614b2ddedaae1d90c06004a7a4c43998

2. Commit 78237 - likely clang: build time went from ~61 to ~76 minutes
   https://git.yoctoproject.org/poky/log/?id=601b05a298c0847e96b8f5f71e50d057e2833382

While these increases were expected, we'd like to look into how we can
eliminate some of the work done or otherwise optimize the build to lower the build time.
Comment 1 Randy MacLeod 2025-05-06 17:20:32 UTC
Add Ross, Khem, Sundeep.

Sundeep wasn't in the meeting discussion so FYI, 
Khem has some ideas about changing the defaults for clang:target.
Comment 3 Ross Burton 2025-05-19 14:16:28 UTC
I'll note that we appear to be building mesa-native with llvmpipe, and I'm not sure if that's desired.
Comment 4 Ross Burton 2025-05-23 15:28:24 UTC
We currently have a mostly monolithic clang recipe that builds llvm/clang/clang-tools/lldb/libclc in one shot, which is neat but incredibly time consuming.

We do already build compiler-rt, libcxx, and openmp separately.  I think we should extend this further.

As a concrete data point, disabling lldb in clang removed over 100MB from the sysroot and two minutes of build time on my Altra build machine.  Adding a disabled-by-default PACKAGECONFIG to clang for lldb would be prohibitively costly as if a user wants it they'd need to rebuild all of clang again.

libclc and lldb should be the easiest to pull out into separate recipes, although I do note that clang can be configured to use a system llvm, so we should be able to tease apart llvm and clang too, which will help setups which need llvm but not clang (for example, rust).
Comment 6 Randy MacLeod 2025-07-03 14:53:39 UTC
Hopefully Ross finds time to work on splitting up llvm/clang to reduce build time.
Comment 8 Ross Burton 2025-11-06 14:35:41 UTC
My next plan involves seeing if we can use libglvnd-native and host drivers instead of mesa-native. But closing as the urgency is done.