diff --git a/.github/workflows/system-tests.yml b/.github/workflows/system-tests.yml index a1e36568..d51ca7fd 100644 --- a/.github/workflows/system-tests.yml +++ b/.github/workflows/system-tests.yml @@ -1,7 +1,7 @@ name: System Tests on: - # pull_request: + pull_request: push: branches: [main] workflow_dispatch: @@ -50,8 +50,9 @@ jobs: library: cpp_httpd binaries_artifact: system_tests_binaries desired_execution_time: 300 # 5 minutes - scenarios_groups: tracer-release - excluded_scenarios: APM_TRACING_E2E_OTEL,APM_TRACING_E2E_SINGLE_SPAN # require AWS and datadog credentials + scenarios: DEFAULT + # the whole tracer-release group only on main, pull requests run DEFAULT + scenarios_groups: ${{ github.ref == 'refs/heads/main' && 'tracer-release' || '' }} parametric_job_count: 8 skip_empty_scenarios: false push_to_test_optimization: ${{ github.actor != 'dependabot[bot]' }} diff --git a/mod_datadog/CMakeLists.txt b/mod_datadog/CMakeLists.txt index 7703647d..ff8752f2 100644 --- a/mod_datadog/CMakeLists.txt +++ b/mod_datadog/CMakeLists.txt @@ -24,6 +24,7 @@ add_library( src/common_conf.cpp src/tracing/conf.cpp src/tracing/hooks.cpp + src/libm_compat.cpp ) set_property(TARGET mod_datadog PROPERTY POSITION_INDEPENDENT_CODE ON) diff --git a/mod_datadog/src/libm_compat.cpp b/mod_datadog/src/libm_compat.cpp new file mode 100644 index 00000000..9dcba173 --- /dev/null +++ b/mod_datadog/src/libm_compat.cpp @@ -0,0 +1,35 @@ +// The module is built against musl, where libm is part of libc, and its libc +// dependency is removed (patch_away_libc): the host process provides libc. On +// glibc hosts, Apache doesn't load libm, so libm functions used by dependencies +// must be defined here, like ceil/ceilf in +// deps/nginx-datadog/build_env/glibc_compat.c. + +#if defined(__linux__) && !defined(__GLIBC__) + +// used by dd-trace-cpp (OpenTelemetry tracestate sampling) +extern "C" double round(double x) { + double result; +#if defined(__x86_64__) + // truncate, then round half away from zero. x - result is exact: same sign + // and |result| <= |x|. + // NOLINTNEXTLINE(hicpp-no-assembler) + __asm__("roundsd $0x0B, %[x], %[result]" + : [result] "=x"(result) + : [x] "x"(x)); + const double fraction = x - result; + if (fraction >= 0.5) { + result += 1.0; + } else if (fraction <= -0.5) { + result -= 1.0; + } +#elif defined(__aarch64__) + // round to nearest, ties away from zero + // NOLINTNEXTLINE(hicpp-no-assembler) + __asm__("frinta %d0, %d1\n" : "=w"(result) : "w"(x)); +#else +#error "round is not implemented for this architecture" +#endif + return result; +} + +#endif