[components][lwp] Remove terminal/ from global CPPPATH - #11776
Conversation
The terminal subsystem's own headers (terminal.h, tty_config.h, ...) are resolved by the compiler's quoted-include directory lookup for sources inside components/lwp/terminal; nothing else depends on the path. Stop polluting the global CPPPATH with this internal directory, following the convention discussed in RT-Thread#10980.
|
👋 感谢您对 RT-Thread 的贡献!Thank you for your contribution to RT-Thread! 为确保代码符合 RT-Thread 的编码规范,请在你的仓库中执行以下步骤运行代码格式化工作流(如果格式化CI运行失败)。 🛠 操作步骤 | Steps
完成后,提交将自动更新至 如有问题欢迎联系我们,再次感谢您的贡献!💐 |
📌 Code Review Assignment🏷️ Tag: componentsReviewers: @Maihuanyi Changed Files (Click to expand)
🏷️ Tag: components_lwpReviewers: @xu18838022837 Changed Files (Click to expand)
📊 Current Review Status (Last Updated: 2026-09-01 17:43 CST)
📝 Review Instructions
|
Related issue: #10980
Summary
This is a minimal demonstration of the CPPPATH convention discussed in #10980: a component no longer leaks its internal directory into the global include path.
components/lwp/SConscriptadded./terminal/to the globalCPPPATH. A repo-wide check shows every unqualified include of the terminal subsystem's own headers (terminal.h,tty_config.h,bsd_porting.h, ...) comes from sources insidecomponents/lwp/terminal/itself, where the compiler's quoted-include directory lookup already resolves them. External consumers (e.g.lwp.c,lwp_jobctrl.c) use<terminal/terminal.h>, which resolves via the component's existingCPPPATH = [cwd]entry. So the global injection is unnecessary and only pollutes the global include path.Other candidate entries were checked and intentionally left alone because they are load-bearing:
CPPPATH = [cwd]andarch/<arch>/<cpu>: required bylwp_arch.hconsumers inside and outside the componentvdsopaths: required bycomponents/libc/compilers/common/ctime.c(<vdso_kernel.h>)Verification
.c/.h/.Sundercomponents/lwp(plus external consumers): 167 include directives, resolution identical with and without./terminal/in the include pathCC @Huoyanlifusu — this is the code-side counterpart of the SCons documentation work you mentioned in the issue; hope it serves as a small example.