-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
build: set CMake as default build system #20188
base: master
Are you sure you want to change the base?
Conversation
@tchaikov I think we need a larger documentation surgery for this. The section you are currently modifying is under heading
I'd like to see documentation that advertises the following command (with each part unpacked and explained):
Currently, none of the above-mentioned three documents ( In fact, if I grep the entire scylla tree for A new developer should be able to read a single
We have lots of stale build documentation scattered all over the place, and little up-to-date documentation. I'd rather see all of the old build docs being deleted, and a single new document explaining { dbuild, native build } x { with cmake, without cmake }. |
@lersek hi László, thank you for the detailed suggestion. before making the CMake-based building system the formal one, we need to provide a more informative document to cover, for instance the
please note, i am for this proposal:
but i wanted to start with something simple and updated. and then expand it to a more comprehensive document. |
Sounds good. We can drop that documentation when CMake has altogether obsoleted the old
This sounds good as well. And I do agree that, if your current pull request is the "first step of the first step", then it's fine (i.e., it should be OK to first clean up the obviously stale statements on CMake, even if we don't just yet have the complete CMake write-up in place). I guess I was concerned that this small docs update was going to be the only one, for CMake's sake. :)
I agree that this document covers running tests. However, it does not cover building individual tests (nor do the other three documents I referenced before); I believe. From our previous discussions, there is for example a difference between rebuilding a single test binary:
I think we should capture this somewhere; it can save a lot of time, for getting a single test binary to pass.
Sounds great. Thanks! |
f84c8d3
to
b72b448
Compare
@tchaikov do you want me to review this version? (with it being a draft) |
no, not until i make cmake the default. by then, the document will reflect the status quo. now it is a bit ahead of time. and thank you for asking. |
OK, ping me anytime. I agree it's better if the code settles first (and cmake becomes the default). |
b72b448
to
ad4f30a
Compare
@lersek ping. the change migrating our CI to CMake has been merged. |
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.
I guess the only "change" I'm requesting is to document the CMAKE_CXX_COMPILER_LAUNCHER
env var; the rest is just asking for confirmation/information. Thanks!
ad4f30a
to
be14ac4
Compare
v2:
|
🟢 CI State: SUCCESS✅ - Build Build Details:
|
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.
Awesome, thanks!
@@ -753,7 +753,7 @@ def find_ninja(): | |||
help='List all available build artifacts, that can be passed to --with') | |||
arg_parser.add_argument('--date-stamp', dest='date_stamp', type=str, | |||
help='Set datestamp for SCYLLA-VERSION-GEN') | |||
arg_parser.add_argument('--use-cmake', action=argparse.BooleanOptionalAction, default=False, help='Whether to use CMake as the build system') | |||
arg_parser.add_argument('--use-cmake', action=argparse.BooleanOptionalAction, default=True, help='Whether to use CMake as the build system') |
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.
We need proof that cmake passes the same compile options as the traditional system.
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.
I compared the compilation databases generated by CMake and configure.py after applying these changes:
- build: include subdirectory rules in compilation database merge #21312
- build: enable CMAKE_CXX_EXTENSIONS explicitly #21311
- build: Remove GCC ARM warning workaround (originally added in 193d1942) #21308
Using this comparison script, I analyzed the differences between the two build systems. The full comparison results show some variations in compile options.
I've audited all discrepancies and can confirm that:
- None of the differences impact build functionality
- The variations mostly represent cleanup opportunities in the CMake configuration
Please review and let me know if you have any questions or concerns about these differences.
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.
I looked at the diff and the only significant difference is this:
=== wasmtime_bindings.cc:
-{'W': set(), 'I': {'build/gen'}, 'f': set(), 'D': set()}
+{'W': {'error=unused-result'}, 'I': {'build/Dev/seastar/gen/include', 'seastar/include'}, 'f': {'stack-clash-protection'}, 'D': {'SEASTAR_SCHEDULING_GROUPS_COUNT=16', 'SEASTAR_LOGGER_TYPE_STDOUT', 'SEASTAR_API_LEVEL=7', 'SEASTAR_SSTRING', 'SEASTAR_TYPE_ERASE_MORE', 'WITH_GZFILEOP', 'SEASTAR_LOGGER_COMPILE_TIME_FMT', 'FMT_SHARED'}}
=== inc.cc:
-{'W': set(), 'I': {'build/gen'}, 'f': set(), 'D': set()}
+{'W': {'error=unused-result'}, 'I': {'build/Dev/seastar/gen/include', 'seastar/include'}, 'f': {'stack-clash-protection'}, 'D': {'SEASTAR_SCHEDULING_GROUPS_COUNT=16', 'SEASTAR_LOGGER_TYPE_STDOUT', 'SEASTAR_API_LEVEL=7', 'SEASTAR_SSTRING', 'SEASTAR_TYPE_ERASE_MORE', 'WITH_GZFILEOP', 'SEASTAR_LOGGER_COMPILE_TIME_FMT', 'FMT_SHARED'}}
Can you explain this?
BTW which is -
and which is +
?
This 'I': {'build/gen'},
is present everywhere, why is that?
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.
@denesb Hi Botond, replied inline.
I looked at the diff and the only significant difference is this:
=== wasmtime_bindings.cc: -{'W': set(), 'I': {'build/gen'}, 'f': set(), 'D': set()} +{'W': {'error=unused-result'}, 'I': {'build/Dev/seastar/gen/include', 'seastar/include'}, 'f': {'stack-clash-protection'}, 'D': {'SEASTAR_SCHEDULING_GROUPS_COUNT=16', 'SEASTAR_LOGGER_TYPE_STDOUT', 'SEASTAR_API_LEVEL=7', 'SEASTAR_SSTRING', 'SEASTAR_TYPE_ERASE_MORE', 'WITH_GZFILEOP', 'SEASTAR_LOGGER_COMPILE_TIME_FMT', 'FMT_SHARED'}} === inc.cc: -{'W': set(), 'I': {'build/gen'}, 'f': set(), 'D': set()} +{'W': {'error=unused-result'}, 'I': {'build/Dev/seastar/gen/include', 'seastar/include'}, 'f': {'stack-clash-protection'}, 'D': {'SEASTAR_SCHEDULING_GROUPS_COUNT=16', 'SEASTAR_LOGGER_TYPE_STDOUT', 'SEASTAR_API_LEVEL=7', 'SEASTAR_SSTRING', 'SEASTAR_TYPE_ERASE_MORE', 'WITH_GZFILEOP', 'SEASTAR_LOGGER_COMPILE_TIME_FMT', 'FMT_SHARED'}}Can you explain this?
sure. these two files are both rust's C++ bindings generated using cxxbridge.
i guess you noticed that seastar flags only exist in the line starting with +
. rust binding does not use Seastar headers or link against Seastar libraries, so there is no need to build with Seastar cflags. this is also why i claimed
The variations mostly represent cleanup opportunities in the CMake configuration
in previous comment in this thread.
BTW which is
-
and which is+
?
i wanted to mimic the format of diff
when comparing two building command databases. the two building command databases are generated using configure.py
and CMake repectively, and the command is
../compare-compile-commands.py -ppppp {cmake-,}compile_commands.json
so the lines started with -
is the command line options only found in the rules generated by CMake, and the lines started with +
are those only found in the rules generated by configure.py
. as you noticed, configure.py
tends to pass more cflags when building object files even when they are not used at all.
This
'I': {'build/gen'},
is present everywhere, why is that?
actually, both of them have build/gen
. but i am too lazy to normalize them.
- the one from CMake looks like
-I/home/kefu/dev/scylladb/master -I/home/kefu/dev/scylladb/master/build/gen
- the one from
configure.py
looks like-iquote. -iquote build/dev/gen
.
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.
Ok, it indeed looks like the generated build rules are identical where it counts. I'll queue this. 🤞
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.
This is breaking gating, I assume because we need this change together with some change in scylla-pkg
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.
@scylladb/scylla-maint can you please dequeue this patch? it's breaking gating
@scylladb/scylla-maint hello maintainers, could you help review this change? |
Switch the default build system from native Ninja generation to CMake. This is a major step in our CMake migration initiative that: - Enables CMake builds by default via `--use-cmake` flag - Prepares for future removal of configure.py's native build.ninja generation - Streamlines our build system to use CMake exclusively - Updates the document on build system We can still use `--no-use-cmake` flag to use the legacy build system. Note: The native Ninja generation in configure.py will be removed after a grace period to ensure smooth transition. Refs #2717 --- this change should only impact the developer's workflow, no impact to production, so no need to backport. Closes #20188 * github.com:scylladb/scylladb: {HACKING,README}.md: update the CMake related remarks build: set CMake as default build system
Dequeued since it broke promotion. @tchaikov the proof it doesn't change flags should be in the cover letter, not hidden in a comment. |
be14ac4
to
c941ae4
Compare
🟢 CI State: SUCCESS✅ - Build Build Details:
|
v3:
|
@denesb hi Botond, could you help re-review this change? i've switched the CI pipelines to CMake in https://github.com/scylladb/scylla-pkg/commit/4df8b8b54f9e8599f367ccbb4917ff881c6452a6 . |
@tchaikov let's wait until the build system changes are merged from enterprise. These are so large they would invalidate the comparison results. |
okay. let's put this change on hold then. |
Switch the default build system from native Ninja generation to CMake. This is a major step in our CMake migration initiative that: - Enables CMake builds by default via `--use-cmake` flag - Prepares for future removal of configure.py's native build.ninja generation - Streamlines our build system to use CMake exclusively We can still use `--no-use-cmake` flag to use the legacy build system. The compilation databases generated by CMake and configure.py were compared. And the differences between them were analyzed, I can confirm that - None of the differences impact build functionality - The variations mostly represent cleanup opportunities in the CMake configuration Note: The native Ninja generation in configure.py will be removed after a grace period to ensure smooth transition. Refs scylladb#2717 Signed-off-by: Kefu Chai <[email protected]>
c941ae4
to
60f96b1
Compare
the rules generated with CMake script is feature-wise on par with the one generated directly with `configure.py`, so the existing document is now stale. in this change, we update the document to reflect the current status of CMake support. Fixes scylladb#22212 Signed-off-by: Kefu Chai <[email protected]>
60f96b1
to
3a844e7
Compare
v4:
|
@avikivity and @denesb, i
could you take another look? |
🔴 CI State: FAILURE✅ - Build Build Details:
|
Switch the default build system from native Ninja generation to CMake.
This is a major step in our CMake migration initiative that:
--use-cmake
flagWe can still use
--no-use-cmake
flag to use the legacy build system.Note: The native Ninja generation in configure.py will be removed after a grace period to ensure smooth transition.
I compared the compilation databases generated by CMake and
configure.py
using this comparison script, I analyzed the differences between the two build systems. The full comparison results show some variations in compile options.I've audited all discrepancies and can confirm that:
Refs #2717
this change should only impact the developer's workflow, no impact to production, so no need to backport.