Repository navigation
Fix strip.py handling of #else after #ifndef __UNIT_TEST__ - #25
Closed
randomizedcoder wants to merge 1 commit into
Closed
randomizedcoder wants to merge 1 commit into
randomizedcoder wants to merge 1 commit into
Conversation
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 <noreply@anthropic.com>
Owner
Author
|
Duplicate of upstream PlatformLab#134, which makes the same fix; closing in favour of it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
make net-nextwrites stripped files that don't compile in a kernel tree:util/strip.pytreats#else /* __UNIT_TEST__ */as "start keeping lines". That is right after#ifdef __UNIT_TEST__, but after#ifndef __UNIT_TEST__(onlyhoma_tx_pool_mem_niduses that form with an#else) it keeps both branches, the real function and the unit-test stub.Fix:
#elseswitches between keeping and dropping lines.Checked:
strip.pyoutput for everyhoma*.[ch], before and after: the only difference is the stub's three lines inhoma_tx_pool.c.sk_memcgfix (the other in-tree build break), the stripped files build in a 7.3 tree asnet/homa(defconfig +HOMA=m,W=1; gcc + sparse, clang, i386) with no warnings, and the stub's checkpatch "open brace" error goes away.No test, since it's a script fix.
🤖 Generated with Claude Code