-
Notifications
You must be signed in to change notification settings - Fork 1.7k
build: ci: enable Ninja/MSVC and use it in CI #10343
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: master
Are you sure you want to change the base?
Conversation
Use CMAKE_SHARED_LINKER_FLAGS for MSVC to trigger creation of PDBs for dynamic libraries (i.e. fluent-bit.dll) instead of specifying target_link_options as those are inherited by the out_lib and hello_world examples causing intermittent build failures when attempting to overwrite fluent-bit.dll.pdb. Set the suffix of the import lib for fluent-bit.exe to .exe.lib so that it does not conflict with the static library's import lib. Signed-off-by: Erik Cederberg <[email protected]>
Enabling /DEBUG implicitly disables /OPT:REF and /OPT:ICF which leads to larger binaries (~25 % for x64 builds). Re-enable /OPT:REF for all builds and /OPT:ICF for 64-bit builds. Signed-off-by: Erik Cederberg <[email protected]>
Change MSVC builds to use Ninja instead of NMake Makefiles in order to speed up the build process. Signed-off-by: Erik Cederberg <[email protected]>
Change caching to cache installed packages and run vcpkg upgrade to match the previous behavior where packages were re-built each time. Signed-off-by: Erik Cederberg <[email protected]>
I tried to use Ninja locally on my Windows development box but cmake in that environment does complain that that installed cmake does not support Ninja as a build tool. I'm just curious which version or flavor of cmake could generate rules for Ninja? |
I used used CMake from MSVC 2022's C++ CMake tools for Windows, which identifies itself as
That's fair, I would say it reduces total time for the Windows builds even if configuration time may be longer, an example: with (n.b. with openssl cache miss, with a hit it would be even less) vs without these changes. These are just two examples but they align well with my measurements. That said, I understand that you may not necessarily wish to change NMake to Ninja in CI and will of course drop that commit if you wish. |
Got it. It's reasonable. Migrating from NMake to Ninja could be a future task. So, could you drop that commit and focus on the GHA caching and tweaking options for MSVC? Those of commit are still quite useful for us. And the dropped commit should be sent as another PR if you have a more cycles. |
fluent-bit.exe
, and modifying how debug data output is configured forfluent-bit.dll
./DEBUG
to match Microsoft's recommendations.All in all this reduces MSVC CI build times with ~50% if there is a cache hit for the vcpkg packages ~25 % otherwise and the size of
fluent-bit.exe
is reduced with about 20 %.Enter
[N/A]
in the box, if an item is not applicable to your change.Testing
Before we can approve your change; please submit the following in a comment:
If this is a change to packaging of containers or native binaries then please confirm it works for all targets.
ok-package-test
label to test for all targets (requires maintainer to do).Documentation
Backporting
Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.