From c50bfb995bb834c239e27d39d00949f6a7d5fc7a Mon Sep 17 00:00:00 2001 From: Yaniv Michael Kaul Date: Fri, 17 Apr 2026 11:45:15 +0300 Subject: [PATCH] pch: fix template and direct-include fallout in non-PCH users Adjust follow-on fallout from the broader PCH changes: - remove the redundant scheduling_group std::equal_to specialization from lang/wasm_instance_cache.cc - exclude small test link sets from PCH use in configure.py - add direct includes at files that no longer get needed declarations transitively --- configure.py | 19 +++++++++++++++++++ lang/wasm_instance_cache.cc | 11 ----------- service/raft/discovery.hh | 1 + service/raft/group0_fwd.hh | 4 ++++ stdafx.hh | 1 + test/boost/commitlog_cleanup_test.cc | 1 + test/boost/per_partition_rate_limit_test.cc | 1 + test/boost/schema_change_test.cc | 2 ++ test/boost/tablets_test.cc | 1 + test/perf/perf_generic_server.cc | 2 ++ test/vector_search/rescoring_test.cc | 1 + 11 files changed, 33 insertions(+), 11 deletions(-) diff --git a/configure.py b/configure.py index 8f23fb688b..51cf9d0ef9 100755 --- a/configure.py +++ b/configure.py @@ -2769,6 +2769,25 @@ def write_build_file(f, f.write('build {}: rust_source {}\n'.format(cc, src)) obj = cc.replace('.cc', '.o') compiles[obj] = cc + # Sources shared between scylla (compiled with PCH) and small tests + # (with custom deps and partial link sets) must not use the PCH, + # because -fpch-instantiate-templates injects symbol references that + # the small test link sets cannot satisfy. + small_test_srcs = set() + for test_binary, test_deps in deps.items(): + if not test_binary.startswith('test/'): + continue + # Only exclude PCH for tests with truly small/partial link sets. + # Tests that include scylla_core or similar large dep sets link + # against enough objects to satisfy PCH-injected symbol refs. + if len(test_deps) > 50: + continue + for src in test_deps: + if src.endswith('.cc'): + small_test_srcs.add(src) + for src in small_test_srcs: + obj = '$builddir/' + mode + '/' + src.replace('.cc', '.o') + compiles_with_pch.discard(obj) for obj in compiles: src = compiles[obj] seastar_dep = f'$builddir/{mode}/seastar/libseastar.{seastar_lib_ext}' diff --git a/lang/wasm_instance_cache.cc b/lang/wasm_instance_cache.cc index dfde50c5a8..a90719a27d 100644 --- a/lang/wasm_instance_cache.cc +++ b/lang/wasm_instance_cache.cc @@ -284,14 +284,3 @@ future<> instance_cache::stop() { } } - -namespace std { - -template <> -struct equal_to { - bool operator()(seastar::scheduling_group& sg1, seastar::scheduling_group& sg2) const noexcept { - return sg1 == sg2; - } -}; - -} diff --git a/service/raft/discovery.hh b/service/raft/discovery.hh index fb343ebd74..09132e3b78 100644 --- a/service/raft/discovery.hh +++ b/service/raft/discovery.hh @@ -6,6 +6,7 @@ * SPDX-License-Identifier: LicenseRef-ScyllaDB-Source-Available-1.1 */ #pragma once +#include #include "service/raft/group0_fwd.hh" namespace service { diff --git a/service/raft/group0_fwd.hh b/service/raft/group0_fwd.hh index 2203c903cc..5c656c4701 100644 --- a/service/raft/group0_fwd.hh +++ b/service/raft/group0_fwd.hh @@ -9,6 +9,10 @@ #pragma once #include +#include +#include +#include +#include #include "raft/raft_fwd.hh" #include "gms/inet_address.hh" diff --git a/stdafx.hh b/stdafx.hh index dbd5f66436..f706b365ad 100644 --- a/stdafx.hh +++ b/stdafx.hh @@ -421,6 +421,7 @@ #include "locator/types.hh" #include "mutation/mutation_fragment.hh" #include "mutation/mutation_partition.hh" +#include "replica/database.hh" #include "schema/schema.hh" #include "schema/schema_builder.hh" #include "schema/schema_fwd.hh" diff --git a/test/boost/commitlog_cleanup_test.cc b/test/boost/commitlog_cleanup_test.cc index 9cb0906463..ef75cb6fff 100644 --- a/test/boost/commitlog_cleanup_test.cc +++ b/test/boost/commitlog_cleanup_test.cc @@ -11,6 +11,7 @@ #undef SEASTAR_TESTING_MAIN #include #include "test/lib/cql_test_env.hh" +#include "transport/messages/result_message.hh" #include "db/commitlog/commitlog_replayer.hh" #include "db/commitlog/commitlog.hh" #include "db/config.hh" diff --git a/test/boost/per_partition_rate_limit_test.cc b/test/boost/per_partition_rate_limit_test.cc index 6371371b61..0103a3633b 100644 --- a/test/boost/per_partition_rate_limit_test.cc +++ b/test/boost/per_partition_rate_limit_test.cc @@ -9,6 +9,7 @@ #include "mutation/mutation.hh" #include "service/storage_proxy.hh" +#include "cql3/selection/selection.hh" BOOST_AUTO_TEST_SUITE(per_partition_rate_limit_test) diff --git a/test/boost/schema_change_test.cc b/test/boost/schema_change_test.cc index ca6d739076..89df32fc06 100644 --- a/test/boost/schema_change_test.cc +++ b/test/boost/schema_change_test.cc @@ -18,6 +18,8 @@ #include "test/lib/cql_test_env.hh" #include "test/lib/cql_assertions.hh" +#include "transport/messages/result_message.hh" +#include "cql3/result_set.hh" #include "service/migration_manager.hh" #include "service/storage_proxy.hh" #include "schema/schema_builder.hh" diff --git a/test/boost/tablets_test.cc b/test/boost/tablets_test.cc index c7f264dcbf..b79a96f98c 100644 --- a/test/boost/tablets_test.cc +++ b/test/boost/tablets_test.cc @@ -18,6 +18,7 @@ #include "test/lib/random_utils.hh" #include "service/topology_mutation.hh" #include "service/storage_service.hh" +#include "gms/gossiper.hh" #include #include #include diff --git a/test/perf/perf_generic_server.cc b/test/perf/perf_generic_server.cc index 270805adc6..ce84c6e4a2 100644 --- a/test/perf/perf_generic_server.cc +++ b/test/perf/perf_generic_server.cc @@ -11,6 +11,8 @@ #include #include #include +#include +#include #include #include #include diff --git a/test/vector_search/rescoring_test.cc b/test/vector_search/rescoring_test.cc index c84983165e..0ba3af7547 100644 --- a/test/vector_search/rescoring_test.cc +++ b/test/vector_search/rescoring_test.cc @@ -14,6 +14,7 @@ #include "vector_search/vector_store_client.hh" #include "vs_mock_server.hh" #include "test/lib/cql_test_env.hh" +#include "transport/messages/result_message.hh" #include "utils/rjson.hh" #include #include