Skip to content

Conversation

@BernardXiong
Copy link
Member

拉取/合并请求描述:(PR description)

[

为什么提交这份PR (why to submit this PR)

tools下的构建脚本显得比较乱,需要进行整理调整;

你的解决方案是什么 (what is your solution)

使用AI工具根据需求情况,结构划分情况进行重构。

请提供验证的bsp和config (provide the config and bsp)

  • BSP: stm32f412-st-nucleo.
  • .config:
  • action:

]

当前拉取/合并请求的状态 Intent for your PR

必须选择一项 Choose one (Mandatory):

  • 本拉取/合并请求是一个草稿版本 This PR is for a code-review and is intended to get feedback
  • 本拉取/合并请求是一个成熟版本 This PR is mature, and ready to be integrated into the repo

代码质量 Code Quality:

我在这个拉取/合并请求中已经考虑了 As part of this pull request, I've considered the following:

  • 已经仔细查看过代码改动的对比 Already check the difference between PR and old code
  • 代码风格正确,包括缩进空格,命名及其他风格 Style guide is adhered to, including spacing, naming and other styles
  • 没有垃圾代码,代码尽量精简,不包含#if 0代码,不包含已经被注释了的代码 All redundant code is removed and cleaned up
  • 所有变更均有原因及合理的,并且不会影响到其他软件组件代码或BSP All modifications are justified and not affect other components or BSP
  • 对难懂代码均提供对应的注释 I've commented appropriately where code is tricky
  • 代码是高质量的 Code in this PR is of high quality
  • 已经使用formatting 等源码格式化工具确保格式符合RT-Thread代码规范 This PR complies with RT-Thread code specification
  • 如果是新增bsp, 已经添加ci检查到.github/workflows/bsp_buildings.yml 详细请参考链接BSP自查

@github-actions github-actions bot added the tools label Jun 23, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the SCons scripts and target generators for RT-Thread by cleaning up build tool scripts, updating copyright dates, and reorganizing module dependencies. Key changes include removing the legacy implementations in tools/xmake.lua and win32spawn.py, refactoring the SCons preprocessor patch into an independent class, and updating import paths in many target generator scripts.

Reviewed Changes

Copilot reviewed 29 out of 38 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tools/xmake.lua Entire file removed to clean up unused build script functionality.
tools/win32spawn.py Replaces the old thread‐based spawn approach with a subprocess call.
tools/targets/* Updates to import paths and minor refactoring in target scripts.
tools/package.py Adds robustness in handling package.json and minor improvements.
tools/building.py Refactors SCons preprocessor patch integration using the new helper.

Comment on lines +57 to +59
print('Exception: ' + os.strerror(e.errno))
if (os.strerror(e.errno) == "No such file or directory"):
print ("\nPlease check Toolchains PATH setting.\n")
Copy link

Copilot AI Jun 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When catching exceptions from subprocess.Popen, e may not always have an 'errno' attribute. It is safer to use str(e) or check for the attribute before calling os.strerror(e.errno).

Suggested change
print('Exception: ' + os.strerror(e.errno))
if (os.strerror(e.errno) == "No such file or directory"):
print ("\nPlease check Toolchains PATH setting.\n")
if hasattr(e, 'errno'):
print('Exception: ' + os.strerror(e.errno))
if os.strerror(e.errno) == "No such file or directory":
print("\nPlease check Toolchains PATH setting.\n")
else:
print('Exception: ' + str(e))

Copilot uses AI. Check for mistakes.
Comment on lines +286 to +292
for item in group['LIBPATH']:
full_path = os.path.join(item, group['name'] + '.lib')
if os.path.isfile(full_path): # has this library
if group_tree != None:
MDK4AddLibToGroup(ProjectFiles, group_tree, group['name'], lib_path, project_path)
MDK4AddLibToGroup(ProjectFiles, group_tree, group['name'], full_path, project_path)
else:
group_tree = MDK4AddGroupForFN(ProjectFiles, groups, group['name'], lib_path, project_path)
group_tree = MDK4AddGroupForFN(ProjectFiles, groups, group['name'], full_path, project_path)
Copy link

Copilot AI Jun 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change in the library lookup loop now iterates over 'LIBPATH' and constructs the library name using the group's name. Verify that this change reflects the intended logic, as previously the iteration was over 'LIBS'.

Copilot uses AI. Check for mistakes.
@Rbb666 Rbb666 merged commit 5a2352e into RT-Thread:master Jun 25, 2025
61 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants