mirror of
https://github.com/Xahau/xahaud.git
synced 2026-10-03 18:38:00 +00:00
* ci: add -Dcoverage_tool=gcov|llvm option, wire native llvm-cov in matrix
introduces native llvm source-based coverage as an alternative to the
existing gcov + gcovr pipeline. driven by a new -Dcoverage_tool cache
variable (default 'gcov' for backwards compat; 'llvm' enables
-fprofile-instr-generate / -fcoverage-mapping + llvm-profdata + llvm-cov).
cmake:
- RippledSettings.cmake: add coverage_tool with validation
- RippledInterface.cmake: split coverage compile/link flags by tool
- RippledCov.cmake: dispatch to the new helper when tool=llvm
- CodeCoverageLLVM.cmake (new): setup_target_for_coverage_llvm() driving
profraw -> profdata -> export with format-aware output (lcov/json/txt/html)
ci:
- new clang-20 llvm-cov coverage matrix row (apt.llvm.org bootstrap for
clang >= 19 since 24.04 default repos cap at clang-18)
- conditional install of llvm-N vs gcovr based on coverage_tool
- artifact + codecov upload generalised to coverage.lcov | coverage.xml
- coverage cmake-args switched to *_FLAGS_DEBUG so the build action's
stdlib flag isn't clobbered
temp (revert before merging to dev):
- matrix narrowed to just the llvm-cov row on non-main refs so we can
iterate without burning runners
- 'coverage-llm' added to push trigger for direct-push CI runs
* ci: drop coverage-llm from push triggers, PR trigger covers it
* ci: actually narrow matrix to just the llvm-cov row
prior guard checked base_ref against ['dev','candidate','release'] which
excluded the very PR we're iterating on. drop the guard - this branch
is for iteration only and must be reverted before merging anyway.
* ci(deps): apply Wno-missing-template-arg-list workaround to Linux clang
grpc 1.50.1 hits -Werror=missing-template-arg-list-after-template-kw on
clang-19+. macOS clang already had this workaround in the conan profile;
mirror it to the Linux branch, gated on compiler==clang.
* ci(temp): disable all workflows except Nix GA on this branch
renames every non-nix workflow to .yml.disabled so they stop firing on
PR pushes while we iterate on the llvm-cov coverage row. MUST be
reverted before merging to dev.
* fix(cov): use absolute binary path in llvm-cov run command
bare 'rippled' wasn't on PATH and the build dir isn't '.', so the
profile-collection step failed with 'No such file or directory'.
splice the resolved absolute path back into Cov_EXECUTABLE before
the run command consumes it.
* ci(deps): replace hardcoded grpc workaround with matrix-driven conan_deps_cxxflags
new dependencies action input `conan_deps_cxxflags` (json list, default
'[]') drives `tools.build:cxxflags` in the conan profile. clearly named
to indicate the flags only apply to conan dependency builds, not the
rippled build itself.
removes the per-os/per-compiler hardcoded workaround (linux clang
conditional + unconditional macOS block) that used to set the same flag
in two places kept-in-sync by hand.
call sites:
- xahau-ga-nix.yml: clang-20 coverage row gets the
-Wno-missing-template-arg-list-after-template-kw workaround for grpc 1.50.1
- xahau-ga-macos.yml.disabled: same flag plumbed through (preserves
prior behaviour when re-enabled)
drop the workaround entries when grpc is bumped past the fix.
* fix(cov): tighten coverage_tool=llvm validation + macOS tool discovery
two bugs caught in review:
- RippledSettings.cmake: the clang-only guard for coverage_tool=llvm ran
before coverage_test could auto-enable coverage. so
'-Dcoverage_tool=llvm -Dcoverage_test=Foo' on a gcc build slipped past
the guard and produced an instrumentation/tool mismatch. move the
guard after the auto-enable block.
- CodeCoverageLLVM.cmake: _find_llvm_cov_tools unconditionally
preferred xcrun's tools on APPLE, which on a homebrew clang-N build
would pair the user's clang with xcode's llvm-cov - exactly the
version mismatch the helper is trying to avoid. gate the xcrun branch
on CMAKE_CXX_COMPILER_ID == AppleClang.
* chore(cov): drop dead BASE_DIRECTORY arg + revert .disabled file edit
- CodeCoverageLLVM.cmake: BASE_DIRECTORY was parsed but never used
(no analog to gcovr's -r in the llvm-cov commands we emit). dead arg.
- xahau-ga-macos.yml.disabled: revert the conan_deps_cxxflags addition.
the file is disabled so the edit was bit-rotting in unreachable code.
whoever revives the macOS workflow can wire up the field then.
* Revert "chore(cov): drop ... .disabled file edit" (partial)
restore the conan_deps_cxxflags addition to xahau-ga-macos.yml.disabled.
prior commit framed it as dead code, but the .disabled rename is itself
a TEMP measure being reverted before merge - the field is needed for the
macOS workflow to keep building grpc 1.50.1 once it's re-enabled, since
the unconditional workaround was removed from the dependencies action.
* fix(ci): restore conan_deps_cxxflags on macOS workflow
reverts part of f8a30c528d - removing this line dropped the apple-clang
grpc workaround that the dependencies action used to apply
unconditionally before the matrix-driven refactor. the .disabled rename
is itself a TEMP measure being reverted before merge, so the field needs
to be in place when the macOS workflow comes back.
* ci: restore matrix-row comments explaining clang-20 + grpc workaround
* ci: dedupe conan_deps_cxxflags in macOS workflow row
prior turn-of-events created two identical conan_deps_cxxflags entries
in the same matrix row from overlapping restore commits. keep one.
* ci: undisable workflows, drop gcc-13 coverage row, keep clang-20 llvm-cov as sole codecov reporter
- restore the 8 .yml.disabled workflows back to .yml
- drop the gcc-13 gcov coverage matrix row; native clang-20 llvm-cov is
now the only codecov reporter
- update minimal_matrix indices to match
- remove the TEMP narrowing block that filtered to just the llvm-cov row
- log line says '7 configs (build x6 + clang-20 llvm-cov coverage)' to
reflect the new shape
* fix(ci): scope conan_deps_cxxflags per Conan package pattern
prior shape (bare json list -> 'tools.build:cxxflags=[...]') leaked into
the consumer/rippled build via the conan-generated toolchain
(CMAKE_CXX_FLAGS_INIT). on macOS, where the build action doesn't
override CMAKE_CXX_FLAGS, this would silently apply the workaround flag
to rippled itself.
reshape the input to a json object keyed by Conan package pattern:
{"grpc/*":["-Wno-..."]}
action emits package-pattern scoped lines:
grpc/*:tools.build:cxxflags=["-Wno-..."]
flags only apply while building the matching dependency. consumer
toolchain stays clean. python validator rejects the consumer pattern
('&') and malformed shapes.
* ci: bump apt retries to 5 to handle ppa.launchpadcontent.net flakes
* ci: relax patch coverage for PeerImp
111 lines
4.2 KiB
CMake
111 lines
4.2 KiB
CMake
#[===================================================================[
|
|
rippled compile options/settings via an interface library
|
|
#]===================================================================]
|
|
|
|
add_library (opts INTERFACE)
|
|
add_library (Ripple::opts ALIAS opts)
|
|
target_compile_definitions (opts
|
|
INTERFACE
|
|
BOOST_ASIO_DISABLE_HANDLER_TYPE_REQUIREMENTS
|
|
BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT
|
|
BOOST_CONTAINER_FWD_BAD_DEQUE
|
|
HAS_UNCAUGHT_EXCEPTIONS=1
|
|
$<$<BOOL:${boost_show_deprecated}>:
|
|
BOOST_ASIO_NO_DEPRECATED
|
|
BOOST_FILESYSTEM_NO_DEPRECATED
|
|
>
|
|
$<$<NOT:$<BOOL:${boost_show_deprecated}>>:
|
|
BOOST_COROUTINES_NO_DEPRECATION_WARNING
|
|
BOOST_BEAST_ALLOW_DEPRECATED
|
|
BOOST_FILESYSTEM_DEPRECATED
|
|
>
|
|
$<$<BOOL:${beast_no_unit_test_inline}>:BEAST_NO_UNIT_TEST_INLINE=1>
|
|
$<$<BOOL:${beast_disable_autolink}>:BEAST_DONT_AUTOLINK_TO_WIN32_LIBRARIES=1>
|
|
$<$<BOOL:${single_io_service_thread}>:RIPPLE_SINGLE_IO_SERVICE_THREAD=1>
|
|
$<$<BOOL:${voidstar}>:ENABLE_VOIDSTAR>)
|
|
target_compile_options (opts
|
|
INTERFACE
|
|
$<$<AND:$<BOOL:${is_gcc}>,$<COMPILE_LANGUAGE:CXX>>:-Wsuggest-override>
|
|
$<$<BOOL:${is_gcc}>:-Wno-maybe-uninitialized>
|
|
$<$<BOOL:${perf}>:-fno-omit-frame-pointer>
|
|
$<$<AND:$<BOOL:${is_gcc}>,$<BOOL:${coverage}>,$<STREQUAL:${coverage_tool},gcov>>:-g --coverage -fprofile-abs-path>
|
|
$<$<AND:$<BOOL:${is_clang}>,$<BOOL:${coverage}>,$<STREQUAL:${coverage_tool},gcov>>:-g --coverage>
|
|
$<$<AND:$<BOOL:${is_clang}>,$<BOOL:${coverage}>,$<STREQUAL:${coverage_tool},llvm>>:-g -fprofile-instr-generate -fcoverage-mapping>
|
|
$<$<BOOL:${profile}>:-pg>
|
|
$<$<AND:$<BOOL:${is_gcc}>,$<BOOL:${profile}>>:-p>)
|
|
|
|
target_link_libraries (opts
|
|
INTERFACE
|
|
$<$<AND:$<BOOL:${is_gcc}>,$<BOOL:${coverage}>,$<STREQUAL:${coverage_tool},gcov>>:-g --coverage -fprofile-abs-path>
|
|
$<$<AND:$<BOOL:${is_clang}>,$<BOOL:${coverage}>,$<STREQUAL:${coverage_tool},gcov>>:-g --coverage>
|
|
$<$<AND:$<BOOL:${is_clang}>,$<BOOL:${coverage}>,$<STREQUAL:${coverage_tool},llvm>>:-g -fprofile-instr-generate -fcoverage-mapping>
|
|
$<$<BOOL:${profile}>:-pg>
|
|
$<$<AND:$<BOOL:${is_gcc}>,$<BOOL:${profile}>>:-p>)
|
|
|
|
if (jemalloc)
|
|
if (static)
|
|
set(JEMALLOC_USE_STATIC ON CACHE BOOL "" FORCE)
|
|
endif ()
|
|
find_package (jemalloc REQUIRED)
|
|
target_compile_definitions (opts INTERFACE PROFILE_JEMALLOC)
|
|
target_include_directories (opts SYSTEM INTERFACE ${JEMALLOC_INCLUDE_DIRS})
|
|
target_link_libraries (opts INTERFACE ${JEMALLOC_LIBRARIES})
|
|
get_filename_component (JEMALLOC_LIB_PATH ${JEMALLOC_LIBRARIES} DIRECTORY)
|
|
## TODO see if we can use the BUILD_RPATH target property (is it transitive?)
|
|
set (CMAKE_BUILD_RPATH ${CMAKE_BUILD_RPATH} ${JEMALLOC_LIB_PATH})
|
|
endif ()
|
|
|
|
if (san)
|
|
target_compile_options (opts
|
|
INTERFACE
|
|
# sanitizers recommend minimum of -O1 for reasonable performance
|
|
$<$<CONFIG:Debug>:-O1>
|
|
${SAN_FLAG}
|
|
-fno-omit-frame-pointer)
|
|
target_compile_definitions (opts
|
|
INTERFACE
|
|
$<$<STREQUAL:${san},address>:SANITIZER=ASAN>
|
|
$<$<STREQUAL:${san},thread>:SANITIZER=TSAN>
|
|
$<$<STREQUAL:${san},memory>:SANITIZER=MSAN>
|
|
$<$<STREQUAL:${san},undefined>:SANITIZER=UBSAN>)
|
|
target_link_libraries (opts INTERFACE ${SAN_FLAG} ${SAN_LIB})
|
|
endif ()
|
|
|
|
#[===================================================================[
|
|
rippled transitive library deps via an interface library
|
|
#]===================================================================]
|
|
|
|
add_library (ripple_syslibs INTERFACE)
|
|
add_library (Ripple::syslibs ALIAS ripple_syslibs)
|
|
target_link_libraries (ripple_syslibs
|
|
INTERFACE
|
|
$<$<BOOL:${MSVC}>:
|
|
legacy_stdio_definitions.lib
|
|
Shlwapi
|
|
kernel32
|
|
user32
|
|
gdi32
|
|
winspool
|
|
comdlg32
|
|
advapi32
|
|
shell32
|
|
ole32
|
|
oleaut32
|
|
uuid
|
|
odbc32
|
|
odbccp32
|
|
crypt32
|
|
>
|
|
$<$<NOT:$<BOOL:${MSVC}>>:dl>
|
|
$<$<NOT:$<OR:$<BOOL:${MSVC}>,$<BOOL:${APPLE}>>>:rt>)
|
|
|
|
if (NOT MSVC)
|
|
set (THREADS_PREFER_PTHREAD_FLAG ON)
|
|
find_package (Threads)
|
|
target_link_libraries (ripple_syslibs INTERFACE Threads::Threads)
|
|
endif ()
|
|
|
|
add_library (ripple_libs INTERFACE)
|
|
add_library (Ripple::libs ALIAS ripple_libs)
|
|
target_link_libraries (ripple_libs INTERFACE Ripple::syslibs)
|