Overview
Info |
---|
Note: The decision to switch from GNU Make to CMake is highly controversial. Many people are wildly in favor and a large number are strong opposed. This is a change that must be brought before the PMC for a vote before any action is taken. |
- There is an idea to add CMake build system.. that would probably at some point replace current GNU Make.
- There are strong supporters of GNU and C Make in the community, but also people with neutral position unless new solution is proven better in practice.
- Current approach is to create Proof-of-Concept CMake build configuration right next to existing GNU Make infrastructure, so process is non-invasive and can provide desired metrics that will prove new solution better or worse.
- Because this RFC will have huge impact on the project, a list of detailed Pros and Cons with measurable metrics needs to be created in order to provide good analysis that will feed the approval by voting process. The list of pros and cons and impact is presented below on this page.
- Special rules apply to code change votes. We don't often do votes on code changes. But such votes are critical in order to serve the community with fairness.
We need to get away from statements of fears and marketing statements to understand the clear, real world impacts.
- Related PR:
CMake vs GNU Make IMPACT
- Introduces additional build dependency (with frequent updates) to the project.
- Self-compatibility and enforced-changes risks with frequent updates while GNU Make is already rock solid stable.
- Two alternate overlapping build systems:
- Heavy initial burden of work.
- Doubled effort in maintaining two parallel build systems.
- High risk of Inconsistencies and self-incompatibilities in transition period.
- CI and Build automation tools must be re-written from scratch everywhere:
- NuttX project internals.
- users.
- customers.
- companies.
- documentation.
CMake vs GNU Make PROS (in favor)
- Better Integration with modern Continuous Integration automation and build systems:
- Better CI maintenance with cmake.
- CI admin needs to use "hacks" to operate GitHub CI with GNU Make.
- cmake is better aligned with GitHub CI framework.
- Improved PR processing:
- Reliable automated testing of each provided PR on GitHub when using cmake.
- Improved Build Efficiency:
- Build times better with CMake than GNU Make.
- TODO: We need a proof for that, some sort of comparison table + chart with real world data.
- Build times better with CMake than GNU Make.
- Allows building various configurations in sub-directory of a single source tree.
- shorter fetch related time.
- leverages parallelism for several builds at the same time.
- Better CI maintenance with cmake.
- Clean code:
- Everything is way more readable then the current Make files.
Easier on-boarding.
- new users may be more familiar with CMake.
- easier initial configuration process.
Less build-related bugs.
- TODO: explanation needed.
Less boiler-plate code.
- TODO: explanation needed.
- Better efficiency:
- people often refer that CMake build is faster than GNU Make:
- TODO: Provide real world in-NuttX measurements comparison.
- CMake can generate build configuration files for various build mechanisms (i.e. GNU Make, ninja, etc).
- people often refer that CMake build is faster than GNU Make:
- Great Integration with modern IDE:
- TODO: details required here.
- Good well proven portability.
- Can act initially as separate build system aside and with no conflict to current GNU Make.
- "Modern".
- TODO: details required here.
CMake vs GNU Make CONS (against)
- CMake is less flexible than GNU Make.
- GNU Make is small and efficient (i.e. builds firmware in ~20 seconds). "If it is not broken, don't fix".
- Introduces additional build dependency to the project.
- Self-compatibility and enforced-changes risks with frequent updates while GNU Make is already rock solid stable.
- Two alternate overlapping build systems:
- Heavy initial burden of work.
- Doubled effort in maintaining two parallel build systems.
- High risk of Inconsistencies and self-incompatibilities in transition period.
- Additional work:
- CI and Build automation tools must be re-written from scratch everywhere:
- project itself.
- users.
- customers.
- companies.
- documentation.
- CI and Build automation tools must be re-written from scratch everywhere:
References
- https://cmake.org/overview/
- https://www.gnu.org/software/make/
- Trilinos CMake Evaluation (https://www.sandia.gov/app/uploads/sites/143/2021/10/daniel-dunlavy-2008-SAND2008-7593.pdf).
A Build System for Benchmarking and Comparison of Competing System Implementations, Anthony J. Bentley, University of New Mexico (https://digitalrepository.unm.edu/ece_etds/298/).
- https://earthly.dev/blog/cmake-vs-make-diff/
- https://www.g2.com/compare/cmake-vs-gnu-make
- https://www.incredibuild.com/blog/cmake-vs-make