From 76b5595f5187b10a955cf2a9a8b8d1bea942b70c Mon Sep 17 00:00:00 2001 From: KorsarOfficial Date: Wed, 18 Mar 2026 06:30:12 +0400 Subject: [PATCH] perf: perf/fakeid-scoping --- build/ymake.core.conf | 15 +++++++++++++++ build/ymake_conf.py | 4 ++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/build/ymake.core.conf b/build/ymake.core.conf index 012c1bc1d0..81713a948f 100644 --- a/build/ymake.core.conf +++ b/build/ymake.core.conf @@ -10,6 +10,21 @@ FAKEID=438319516716 SANDBOX_FAKEID=${FAKEID}.7600000 CPP_FAKEID=2025-10-26 +# Per-directory CPP_FAKEID scoping: changing one group's FAKEID only invalidates that group + dependents. +# To invalidate all C++ code globally, change CPP_FAKEID above (all groups default to it). +# To invalidate only one directory group, override its specific variable below. +# Groups: contrib (3343 nodes), devtools (322), library (307), util (52), other (29) +CPP_FAKEID_CONTRIB=${CPP_FAKEID} +CPP_FAKEID_DEVTOOLS=${CPP_FAKEID} +CPP_FAKEID_LIBRARY=${CPP_FAKEID} +CPP_FAKEID_UTIL=${CPP_FAKEID} +CPP_FAKEID_OTHER=${CPP_FAKEID} +# CPP_FAKEID_SCOPED resolves per-module to the appropriate directory group's FAKEID. +# Default is OTHER; module definitions should SET this based on MODDIR prefix. +# TODO: Requires MODDIR prefix extraction (conf language only supports == in when blocks, +# not prefix/glob matching). Options: (a) add _MODDIR_ROOT variable in ymake C++, +# (b) emit per-directory SET() calls in module macros, (c) add startswith() to fieldcalc. +CPP_FAKEID_SCOPED=${CPP_FAKEID_OTHER} GO_FAKEID=2025-11-05 ANDROID_FAKEID=2023-05-17 CLANG_TIDY_FAKEID=2023-06-06 diff --git a/build/ymake_conf.py b/build/ymake_conf.py index b695bc2fe0..ca1e728327 100755 --- a/build/ymake_conf.py +++ b/build/ymake_conf.py @@ -1550,7 +1550,7 @@ def __init__(self, tc, build): ] self.cxx_warnings = [] - self.c_defines = ['${hide:CPP_FAKEID}'] + self.c_defines = ['${hide:CPP_FAKEID_SCOPED}'] if self.target.is_android: self.c_defines.append('${hide:ANDROID_FAKEID}') @@ -2044,7 +2044,7 @@ def print_compiler(self): ] defines = [ - '${hide:CPP_FAKEID}', + '${hide:CPP_FAKEID_SCOPED}', # FIXME: This is quick fix to let catboost build from MSVS IDE # This place is questionable overall, see YMAKE-437 '/DARCADIA_ROOT=${ARCADIA_ROOT}',