Key optimizations:
- Use git fetch --depth 1 instead of --depth 2 for faster Chromium source download
- Add parallel jobs to gclient sync with -j $(nproc) and --shallow flag
- Enable LLD linker (use_lld=true) for faster linking
- Enable ThinLTO for optimized builds with reduced build time
- Disable generate_linker_map to speed up linking phase
- Add parallel jobs to autoninja with -j $(nproc)
- Skip depot_tools clone if already cached
- Add GitHub Actions caching for depot_tools and Chromium dependencies
- Disable unnecessary features (nacl, goma, backup_ref_ptr, pointer_compression)
These changes significantly reduce build time and prevent builds from getting stuck
during git operations and compilation phases.
Added a disk cleanup step before the build that removes unnecessary
software and packages to free up 30-50 GB of disk space. This includes:
- .NET installations
- Pre-installed Android SDK (build script installs what's needed)
- Haskell/GHC
- Docker images
- CodeQL tools
- Various large packages (MongoDB, MySQL, PHP, Azure CLI, etc.)
This should resolve disk space failures during Chromium builds.