Eliminate ~226 redundant source compilations; use ccache and nproc for local builds#2501
Closed
Eliminate ~226 redundant source compilations; use ccache and nproc for local builds#2501
Conversation
…g info - ci.yml: Use robojackets/robocup-software:humble (pre-built deps) instead of osrf/ros:humble-desktop-full + ubuntu-setup on every run - ci.yml: Add ccache with actions/cache for persistent build caching - ci.yml: Add cmake optimization flags (ccache launcher, -g1 debug info) - ci.yml: Shallow clone (fetch-depth: 1) for build-and-test - docker_ci.yml: Trigger CI image rebuild on dependency file changes - Dockerfile.ci: Add ccache configuration and git safe.directory - makefile: Auto-detect and use ccache in all colcon build targets Co-authored-by: sanatd33 <53443682+sanatd33@users.noreply.github.com>
Co-authored-by: sanatd33 <53443682+sanatd33@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Optimize build times for faster execution under two minutes
Optimize build times: pre-built CI image, ccache, reduced debug info
Feb 23, 2026
…les against libraries Fix source file duplication across 7 packages where executables recompiled all library sources instead of linking against the already-built library: - rj_strategy: 27 files × 5 executables = 135 extra compilations eliminated - rj_ui: 18 files × 2 executables = 36 extra compilations eliminated - rj_planning: 27 files × 1 executable = 27 extra compilations eliminated - rj_vision_filter: 18 files × 1 executable = 18 extra compilations eliminated - rj_referee: 3 files × 2 executables = 6 extra compilations eliminated - rj_control: 2 files × 1 executable = 2 extra compilations eliminated - rj_radio: 1 file × 1 executable = 1 extra compilation eliminated Also use nproc for local build parallelism instead of hardcoded 4. Co-authored-by: sanatd33 <53443682+sanatd33@users.noreply.github.com>
Copilot
AI
changed the title
Optimize build times: pre-built CI image, ccache, reduced debug info
Eliminate ~226 redundant source compilations; use ccache and nproc for local builds
Feb 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Build times were unnecessarily long because executables recompiled all library source files instead of linking against the already-built shared library. Across 7 packages, this caused ~226 extra
.cppcompilations per clean build on top of ~194 unique source files.Source duplication fixes — executables now
target_link_librariesagainst their package library:rj_strategy: 27 src × 5 executables = 135 compilations eliminatedrj_ui: 18 src × 2 executables = 36 eliminatedrj_planning: 27 src × 1 executable = 27 eliminatedrj_vision_filter: 18 src × 1 executable = 18 eliminatedrj_referee: 3 src × 2 executables = 6 eliminatedrj_control: 2 src × 1 executable = 2 eliminatedrj_radio: extractedrj_radio_baseshared lib forradio.cpp= 1 eliminatedBefore:
After:
CI workflow (
ci.yml) — from previous commits on this branch:robojackets/robocup-software:humbleimage (skipsubuntu-setup)actions/cache-backed ccache with-g1debug symbolsfetch-depth: 1)Makefile:
--cmake-argsfor compiler launchernprocfor local parallel workers instead of hardcoded4docker_ci.ymlnow rebuilds image onutil/ubuntu-setup,ubuntu-packages.txt,requirements3.txtchangesAssociated Issue
Build times from scratch are too long, especially in resource-constrained Docker containers.
Steps to test
make clean && make all— verify clean build completes with fewer total compilations./install/lib/rj_strategy/kicker_picker_node --help)ccache -sbefore and after build to confirm cache hits on rebuildExpected result: Clean build compiles ~194 source files instead of ~420. Rebuild with ccache is near-instant.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.