From 4fb23c9f4aacd18e585adc492a84642e359ebd84 Mon Sep 17 00:00:00 2001 From: "randomizedcoder dave.seddon.ca@gmail.com" Date: Sat, 31 Oct 2026 09:15:17 -0700 Subject: [PATCH] Fix strip.py handling of #else after #ifndef __UNIT_TEST__ strip.py treated "#else /* __UNIT_TEST__ */" as the start of code to keep, which is right after "#ifdef __UNIT_TEST__" but wrong after "#ifndef __UNIT_TEST__". As a result, "make net-next" kept both definitions of homa_tx_pool_mem_nid in homa_tx_pool.c, so the stripped files failed to compile ("redefinition of 'homa_tx_pool_mem_nid'"). Make #else switch between keeping and dropping lines instead. No other stripped file changes. Co-Authored-By: Claude Opus 5.5 --- util/strip.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/util/strip.py b/util/strip.py index ecd74032..a92417ae 100755 --- a/util/strip.py +++ b/util/strip.py @@ -323,13 +323,14 @@ def scan(file: str) -> list[str]: delete_empty_line = True continue - # Strip '#ifdef __UNIT_TEST__' blocks (keep #else clauses) + # Strip '#ifdef __UNIT_TEST__' blocks and the '#else' clauses of + # '#ifndef __UNIT_TEST__' blocks. if in_unit: if line.startswith('#endif /* __UNIT_TEST__ */'): in_unit = None continue if line.startswith('#else /* __UNIT_TEST__ */'): - in_unit = 'else' + in_unit = 'if' if in_unit == 'else' else 'else' continue if in_unit == 'if': continue