From c2c890940e91c6b4c8c0a709dd8dd36872ee60cf Mon Sep 17 00:00:00 2001 From: Nikola Radakovic Date: Thu, 20 Aug 2026 16:12:42 +0200 Subject: [PATCH 1/2] Feature reorder Reorder feature list --- templates/linux/cc_toolchain_config.bzl.template | 8 ++++---- templates/qnx/cc_toolchain_config.bzl.template | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/templates/linux/cc_toolchain_config.bzl.template b/templates/linux/cc_toolchain_config.bzl.template index 3a8fbdb..1675dee 100644 --- a/templates/linux/cc_toolchain_config.bzl.template +++ b/templates/linux/cc_toolchain_config.bzl.template @@ -1024,6 +1024,10 @@ def _impl(ctx): random_seed_feature, include_paths_feature, preprocessor_defines_feature, + minimal_warnings_feature, + strict_warnings_feature, + all_wall_warnings_feature, + warnings_as_errors_feature, user_compile_flags_feature, compiler_input_flags_feature, compiler_output_flags_feature, @@ -1047,10 +1051,6 @@ def _impl(ctx): fully_static_link_feature, sysroot_link_flags_feature, pthread_feature, - minimal_warnings_feature, - strict_warnings_feature, - all_wall_warnings_feature, - warnings_as_errors_feature, extra_compile_flags_feature, extra_c_compile_flags_feature, extra_cxx_compile_flags_feature, diff --git a/templates/qnx/cc_toolchain_config.bzl.template b/templates/qnx/cc_toolchain_config.bzl.template index 861378b..200c493 100644 --- a/templates/qnx/cc_toolchain_config.bzl.template +++ b/templates/qnx/cc_toolchain_config.bzl.template @@ -809,6 +809,10 @@ def _impl(ctx): random_seed_feature, include_paths_feature, preprocessor_defines_feature, + minimal_warnings_feature, + strict_warnings_feature, + all_wall_warnings_feature, + warnings_as_errors_feature, user_compile_flags_feature, compiler_input_flags_feature, compiler_output_flags_feature, @@ -822,10 +826,6 @@ def _impl(ctx): shared_flag_feature, output_execpath_flags_feature, libraries_to_link_feature, - minimal_warnings_feature, - strict_warnings_feature, - all_wall_warnings_feature, - warnings_as_errors_feature, extra_compile_flags_feature, extra_link_flags_feature, opt_feature, From 0bc2b8a8fda021eb5d6e40f40fc2282f9a8f4141 Mon Sep 17 00:00:00 2001 From: Nikola Radakovic Date: Thu, 20 Aug 2026 17:49:41 +0200 Subject: [PATCH 2/2] Add fix for QNX coverage Add fix for QNX coverage --- .github/workflows/qnx.yml | 8 ++++++++ .github/workflows/x86_64-linux.yml | 6 ++++++ templates/qnx/cc_toolchain_config.bzl.template | 3 +-- tests/feature_verification/BUILD | 4 +++- 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/.github/workflows/qnx.yml b/.github/workflows/qnx.yml index 391f596..a740555 100644 --- a/.github/workflows/qnx.yml +++ b/.github/workflows/qnx.yml @@ -95,6 +95,14 @@ jobs: --test_output=errors \ --credential_helper=*.qnx.com="${QNX_CREDENTIAL_HELPER}" ${{ matrix.extra-bazel-test-flags }} -- \ ${{ matrix.bazel-test-target }} + - name: Coverage smoke test with QNX toolchain + run: | + set -euo pipefail + + bazel coverage --config ${{ matrix.bazel-config }} \ + --combined_report=lcov \ + --credential_helper=*.qnx.com="${QNX_CREDENTIAL_HELPER}" -- \ + //feature_verification:coverage_test - name: Dump test logs on failure if: failure() run: | diff --git a/.github/workflows/x86_64-linux.yml b/.github/workflows/x86_64-linux.yml index cd88c00..c5f86b1 100644 --- a/.github/workflows/x86_64-linux.yml +++ b/.github/workflows/x86_64-linux.yml @@ -51,6 +51,9 @@ jobs: - name: Bazel Test (force_pic) run: | bazel test --lockfile_mode=error --config=x86_64-linux --force_pic -- //feature_verification/opt_in_features:force_pic_flags_test + - name: Bazel Coverage + run: | + bazel coverage --lockfile_mode=error --config=x86_64-linux --combined_report=lcov -- //feature_verification:coverage_test generic-x86_64-linux-gcc15: runs-on: ubuntu-latest defaults: @@ -78,3 +81,6 @@ jobs: - name: Bazel Test (force_pic) run: | bazel test --lockfile_mode=error --config=x86_64-linux-gcc15 --force_pic -- //feature_verification/opt_in_features:force_pic_flags_test + - name: Bazel Coverage + run: | + bazel coverage --lockfile_mode=error --config=x86_64-linux-gcc15 --combined_report=lcov -- //feature_verification:coverage_test diff --git a/templates/qnx/cc_toolchain_config.bzl.template b/templates/qnx/cc_toolchain_config.bzl.template index 200c493..4f0059c 100644 --- a/templates/qnx/cc_toolchain_config.bzl.template +++ b/templates/qnx/cc_toolchain_config.bzl.template @@ -794,7 +794,6 @@ def _impl(ctx): flag_groups = [flag_group(flags = ["-lgcov"])], ), ], - requires = [feature_set(features = ["coverage"])], ) # The order of the features is relevant, they are applied in this specific order. @@ -826,6 +825,7 @@ def _impl(ctx): shared_flag_feature, output_execpath_flags_feature, libraries_to_link_feature, + coverage_feature, extra_compile_flags_feature, extra_link_flags_feature, opt_feature, @@ -835,7 +835,6 @@ def _impl(ctx): supports_pic_feature, pic_feature, runtime_library_search_directories_feature, - coverage_feature, gcc_coverage_map_format_feature, ] diff --git a/tests/feature_verification/BUILD b/tests/feature_verification/BUILD index 3abc023..90f2a43 100644 --- a/tests/feature_verification/BUILD +++ b/tests/feature_verification/BUILD @@ -144,7 +144,9 @@ cc_test( ) # Test for: coverage, gcc_coverage_map_format, dependency_file features -# Verifies that code coverage instrumentation is applied +# Verifies that code coverage instrumentation is applied. Also used by both +# Linux and QNX CI as the `bazel coverage` smoke test (build/link/execute/gcov +# end-to-end). cc_test( name = "coverage_test", srcs = ["coverage_test.cpp"],