Skip to content

[Bug] scons --target=iar --dist异常报错 #9996

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
meng-plus opened this issue Feb 16, 2025 · 0 comments
Closed

[Bug] scons --target=iar --dist异常报错 #9996

meng-plus opened this issue Feb 16, 2025 · 0 comments

Comments

@meng-plus
Copy link
Contributor

meng-plus commented Feb 16, 2025

RT-Thread Version

master

Hardware Type/Architectures

stm32f205

Develop Toolchain

IAR

Describe the bug

在使用scons --target=iar --dist导出iar工程时,出发如下报错

$ scons --target=iar --dist
scons: Reading SConscript files ...
rtconfig 10-->-->1
rtconfig 15-->--><frozen importlib._bootstrap>:241
rtconfig 10-->-->1
rtconfig 15-->--><frozen importlib._bootstrap>:241
rtconfig 52==>STM32F2xx_HAL
980 STM32F2xx_HAL
894 STM32F2xx_HAL
rtconfig 10-->-->1
rtconfig 15-->--><frozen importlib._bootstrap>:241
rtconfig 10-->-->1
rtconfig 15-->--><frozen importlib._bootstrap>:241
IAR Version: 0.0
IAR project has generated successfully!
901 None
984 None
make distribution....
=> stm32f205
=> start dist handle
=> copy stm32 bsp library
rtconfig 10-->-->2
E:\github\rt-thread\bsp\stm32\stm32f205
None
E:\github\rt-thread\bsp\stm32\libraries
TypeError: join() argument must be str, bytes, or os.PathLike object, not 'NoneType':
  File "E:\github\rt-thread\bsp\stm32\stm32f205\SConstruct", line 59:
    DoBuilding(TARGET, objs)
  File "E:\github\rt-thread\tools\building.py", line 873:
    EndBuilding(target, program)
  File "E:\github\rt-thread\tools\building.py", line 990:
    MkDist(program, BSP_ROOT, Rtt_Root, Env, project_name, project_path)
  File "E:\github\rt-thread\tools\mkdist.py", line 190:
    dist_handle(BSP_ROOT, dist_dir)
  File "E:\github\rt-thread\bsp\stm32\stm32f205\rtconfig.py", line 189:
    dist_do_building(BSP_ROOT, dist_dir)
  File "E:\github\rt-thread\bsp\stm32\tools\sdk_dist.py", line 22:
    bsp_copy_files(os.path.join(library_path, rtconfig.BSP_LIBRARY_TYPE),
  File "<frozen ntpath>", line 147:

  File "<frozen genericpath>", line 152:

多出来的 日志为我跟踪rtconfig.BSP_LIBRARY_TYPE所需,根据排查发现在 building.py EndBuilding函数中发现调用 GenTargetProject(program)中出发异常,进一步发现时iar.py模块中进行了重新加载配置信息导致rtconfig.BSP_LIBRARY_TYPE配置丢失,这里的是否可以注释掉utils.ReloadModule(rtconfig),我在测试过程中,注释掉后未见功能异常

rt-thread/tools/iar.py

Lines 180 to 201 in 5b33206

def IARPath():
import rtconfig
# backup environ
old_environ = os.environ
os.environ['RTT_CC'] = 'iar'
utils.ReloadModule(rtconfig)
# get iar path
path = rtconfig.EXEC_PATH
# restore environ
os.environ = old_environ
utils.ReloadModule(rtconfig)
return path
def IARVersion():
import subprocess
import re
path = IARPath()

Other additional context

No response

meng-plus added a commit to meng-plus/rt-thread that referenced this issue Feb 16, 2025
@meng-plus meng-plus mentioned this issue Feb 16, 2025
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants