Skip to content

[components][lwp] Remove terminal/ from global CPPPATH - #11776

Merged
Rbb666 merged 1 commit into
RT-Thread:masterfrom
TTLLDD:fix/cpppath-cleanup
Sep 3, 2026
Merged

[components][lwp] Remove terminal/ from global CPPPATH#11776
Rbb666 merged 1 commit into
RT-Thread:masterfrom
TTLLDD:fix/cpppath-cleanup

Conversation

@TTLLDD

@TTLLDD TTLLDD commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

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/SConscript added ./terminal/ to the global CPPPATH. 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 inside components/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 existing CPPPATH = [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] and arch/<arch>/<cpu>: required by lwp_arch.h consumers inside and outside the component
  • vdso paths: required by components/libc/compilers/common/ctime.c (<vdso_kernel.h>)

Verification

  • Static include-resolution check across all .c/.h/.S under components/lwp (plus external consumers): 167 include directives, resolution identical with and without ./terminal/ in the include path
  • SCons dry-run on a RT-Thread Smart enabled BSP: all SConscript files execute correctly (actual cross-compilation requires the riscv toolchain, which CI covers)

CC @Huoyanlifusu — this is the code-side counterpart of the SCons documentation work you mentioned in the issue; hope it serves as a small example.

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.
@TTLLDD
TTLLDD requested a review from BernardXiong as a code owner September 1, 2026 09:43
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown

👋 感谢您对 RT-Thread 的贡献!Thank you for your contribution to RT-Thread!

为确保代码符合 RT-Thread 的编码规范,请在你的仓库中执行以下步骤运行代码格式化工作流(如果格式化CI运行失败)。
To ensure your code complies with RT-Thread's coding style, please run the code formatting workflow by following the steps below (If the formatting of CI fails to run).


🛠 操作步骤 | Steps

  1. 前往 Actions 页面 | Go to the Actions page
    点击进入工作流 → | Click to open workflow →

  2. 点击 Run workflow | Click Run workflow

  • Use workflow from 保持默认分支(通常为 master
    Keep the default branch (usually master) in Use workflow from
  • branch 输入框填写 PR 分支 fix/cpppath-cleanup
    Enter PR branch fix/cpppath-cleanup in the branch field
  • 设置需排除的文件/目录(目录请以"/"结尾)
    Set files/directories to exclude (directories should end with "/")
  1. 等待工作流完成 | Wait for the workflow to complete
    格式化后的代码将作为独立提交推送至你的分支。
    The formatting changes will be pushed to your branch as a separate commit.

完成后,提交将自动更新至 fix/cpppath-cleanup 分支,关联的 Pull Request 也会同步更新。
Once completed, commits will be pushed to the fix/cpppath-cleanup branch automatically, and the related Pull Request will be updated.

如有问题欢迎联系我们,再次感谢您的贡献!💐
If you have any questions, feel free to reach out. Thanks again for your contribution!

@github-actions github-actions Bot added RT-Smart RT-Thread Smart related PR or issues component: lwp Component labels Sep 1, 2026
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown

📌 Code Review Assignment

🏷️ Tag: components

Reviewers: @Maihuanyi

Changed Files (Click to expand)
  • components/lwp/SConscript

🏷️ Tag: components_lwp

Reviewers: @xu18838022837

Changed Files (Click to expand)
  • components/lwp/SConscript

📊 Current Review Status (Last Updated: 2026-09-01 17:43 CST)


📝 Review Instructions

  1. 维护者可以通过单击此处来刷新审查状态: 🔄 刷新状态
    Maintainers can refresh the review status by clicking here: 🔄 Refresh Status

  2. 确认审核通过后评论 LGTM/lgtm
    Comment LGTM/lgtm after confirming approval

  3. PR合并前需至少一位维护者确认
    PR must be confirmed by at least one maintainer before merging

ℹ️ 刷新CI状态操作需要具备仓库写入权限。
ℹ️ Refresh CI status operation requires repository Write permission.

@CLAassistant

CLAassistant commented Sep 1, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@Rbb666 Rbb666 added the 5.3.0 label Sep 3, 2026
@Rbb666
Rbb666 merged commit 54e5164 into RT-Thread:master Sep 3, 2026
108 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

5.3.0 component: lwp Component RT-Smart RT-Thread Smart related PR or issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants