-
Notifications
You must be signed in to change notification settings - Fork 66
[legacy] build: Add CI_BUILD_MODE to reduce disk usage
#578
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
Add CI_BUILD_MODE option to reduce peak disk usage during builds. When enabled (-DCI_BUILD_MODE=ON): - Packages are built sequentially instead of in parallel - Each package's build and source directories are removed after installation - Disk usage is logged after each step (space reclaimed + build tree size) Trade-offs: - Slower builds due to serialization (but -j<ncpus> still parallelizes within each package) - Incremental rebuilds after failure require full rebuild of removed packages Recommended for CI environments or systems with limited storage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds a CI_BUILD_MODE option to reduce peak disk usage during FairSoft builds by serializing package builds and cleaning up build/source directories after each package installation. The feature is designed for CI environments or systems with limited storage, trading build speed for significantly reduced disk space requirements.
Key Changes:
- Sequential package builds instead of parallel builds (with per-package parallelization via -j still active)
- Automatic cleanup of build/source directories after each package installation
- Disk usage reporting showing space reclaimed and total build tree size after each package
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
cmake/reclaim-diskspace.cmake |
New script that measures directory sizes using du, removes package build/source directories, and logs space reclaimed. Gracefully handles non-Unix systems and missing directories. |
cmake/legacy.cmake |
Implements CI_BUILD_MODE functionality: adds reclaim_diskspace step to all packages, serializes non-optional package builds, and displays CI_BUILD_MODE status in configuration summary. |
FairSoftConfig.cmake |
Adds comprehensive documentation for the CI_BUILD_MODE option, explaining its purpose, behavior, trade-offs, and recommended use cases. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Review by Claude: PR Review:
|
|
if everything compiles in the first iteration the changes works as expected. The changes nicely cleanup the directories. If something went wrong and one needs to restart or if one want to compile the code in different steps (here done only for testing) the scheme doesn't work Also the parallel compilation of packages doesn't work any longer. In my tests all packages were installed sequentially whereas the parallel compilation within a package still works as expected. Both shortcomings, in my opinion, doesn't speak against integration of the PR. The new setting is a special case for which one can probably accept the mentioned problems. |
Yes, those trade-offs are reflected in the name |
| # | ||
| # CI Build Mode (default OFF) | ||
| # | ||
| # Enable this to reduce peak disk usage during builds. When enabled: | ||
| # - Packages are built sequentially (one at a time) instead of in parallel | ||
| # - Each package's build and source directories are removed after installation | ||
| # - Disk usage is logged (space reclaimed + total build tree size) | ||
| # | ||
| # The -j<ncpus> argument still parallelizes compilation within each package build. | ||
| # Trade-offs: | ||
| # - Builds take longer due to package serialization | ||
| # - Incremental rebuilds after failure are longer (removed packages must fully rebuild) | ||
| # Recommended for CI environments or systems with limited storage. | ||
| # | ||
| # set(CI_BUILD_MODE OFF CACHE BOOL "Serialize builds and remove package dirs after install" FORCE) | ||
| # set(CI_BUILD_MODE ON CACHE BOOL "Serialize builds and remove package dirs after install" FORCE) | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fuhlig1 also documented here
|
hm, ok, I see your point, rebuild is actually broken even. must have happened as I added also deletion of the source dirs later on. |
Add
CI_BUILD_MODEoption to reduce peak disk usage during builds, addressing #576.When enabled (
-DCI_BUILD_MODE=ON):Trade-offs:
-j<ncpus>still parallelizes within each package)Recommended for CI environments or systems with limited storage.
Full example build log: