-
Notifications
You must be signed in to change notification settings - Fork 273
[RFC] Build system support in CBMC version 6 #7835
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
Comments
I support this. One thing that hasn't been mentioned (unless I've missed it) as a potential advantage of the CMake-only approach going forward is the potential for the CMake build system to be restructured in a way that makes CBMC easier to integrate with the build system of another application. I don't think that's a use-case we support right now, not out of the box at least, but that's something we could look into if we're released from the burden of needing to maintain some symmetry between the two different build systems. |
The dual build system was a technical "fix" to a social issue. One vocal developer insisted they could not use their favourite IDE without CMake. The solution to this was to add CMake files for those that wanted them. Some developers prefer CMake, some prefer Make. Having one build system would be technically simpler but would result in upsetting some people. This is not a purely technical issue. |
|
I am going to close out this issue as out-of-scope for the version 6 release. Feel free to re-open if you wish to push this forward yourself. |
We are currently in the planning stages of deciding what major changes should be made for the major CBMC release version 6. The overall issue for release version 6 changes is here - #7743 I am raising this issue to express some of the points in favour and against build systems changes and to collect further feedback.
We currently have two parallel build systems - a set of handwritten
makefile
s and acmake
based build system. There is a significant maintenance burden from keeping both build systems working. This applies to both individuals working within Diffblue and to new contributors. There is a fairly regular pattern of forgetting one build system or the other when authoring PRs. Not to mention the number of effectively duplicate CI jobs which are required in order to check both builds.In my opinion there are a number of tangible benefits to solely using a
cmake
based build system rather than using handwrittenmakefile
s -CMakeLists.txt
files define properties of the project such as "which are the source files?" and "what are the dependencies?" whereas themakefile
s define "what are the build commands which need to be executed in order to build?". For IDEs this distinction turns out to be important. It facilitates an IDE to open up the project as a project, rather than just a collection of files in a directory hierarchy.cpack
to produce the installation packages which are posted on the release pages. This includes both the windows installer and the.deb
packages for Ubuntu.cpack
is based on top ofcmake
. So withoutcmake
an entirely different packaging system would have to have been written.module_dependences.txt
files. However it is still really easy to accidentally introduce cyclic module dependencies or problems with transitive dependencies. Withcmake
we could more easily define separate include directories for these modules along with the module dependencies. This enables sane logic to do with if module A depends on module B, then it can include the header files of module B and we need to link the object files of module B along with the link dependencies of module B.cmake
actually generates build files for other build systems. This doesn't just mean that downstream consumers of cbmc could generatemakefiles
for compatibility reasons but it also opens up the use of other build systems. These include variations ofmake
such asnmake
,ninja
for potentially faster builds and Visual Studio project files for VS compatibility. Recent versions of Visual Studio ship withcmake
; socmake
itself is not an additional dependency to manually install when working with this platform.cmake
build system is setup to build cbmc in a separate build directory. Themakefiles
build within thesrc
hierarchy alongside the source files themselves. This cleaning a separate source directory is far more straight forward, as we don't need to maintainclean
targets in the build system in order for cleaning to work correctly.Drawbacks of removing the
makefiles
-make
build system would need to learn the equivalent commands to build usingcmake
instead of justmake
.Makefile
s would need to be updated for compatibility with newer versions ofcbmc
. Potentially by usingcmake
to generateMakefile
s and then depending on the generated files.This potential change was also discussed as comments on this PR - #5558
I think the conclusions of the previous discussions were that there would need to be a migration guide and that it was the kind of change which is better to undertake as part of a major release alongside other potentially breaking changes. There was also some consideration of support for building cbmc with alternate SAT solvers. At the time the PR was raised building with some of the alternate SAT solvers was only supported for the make build. My understanding is that building with these alternates is now well supported in the
cmake
build.The text was updated successfully, but these errors were encountered: