-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
[tools/env]统一tools中env相关的接口,优化env部分路径拼接 #9185
Conversation
需要同时合并RT-Thread/pkgs-test#34,pkgs-test相关的ci才能全部通过 |
tools/env_helper.py
Outdated
"* If your system is linux, you can use command below to install git.\n" | ||
"* $ sudo yum install git\n" | ||
"* $ sudo apt-get install git\n" | ||
"* If your system is windows, you should download git software(msysGit).\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
通过install_windows.ps 脚本是可以安装git的呀,为什么需要手动安装git?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
还是说这个提示是假设install脚本不存在的情况下给用户提供一个全流程的提示?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个是历史遗留的,就以前在tools/menukconfig.py中有一个touch_env()函数,也可以用来安装env,但是会跟install_ubuntu.sh安装的env,在生成最后的env.sh上有区别。
这个touch_env()函数在部分ci以及pkgs-test中有调用,因此保留了下来。
另外,在scons --menuconfig的时候会自动判断kconfiglib和pkgs是否安装,如果没有这会调用touch_env()安装env
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
把touch_env干掉吧,保留我们的install脚本安装方式即可。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
是的 安装env应该使用统一的脚本,不应该各种开花,维护太难了
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
目前env仓库还有touch_env.sh和touch_env.ps1两个文件,其实我一直想把他们合并了,直接用python写一个,这样出口只有一个了
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
touch_env是用于安装env,这部分功能还是需要有的,这样可以自动触发安装。
tools/env_helper.py
Outdated
# Change Logs: | ||
# Date Author Notes | ||
# 2024-04-20 Bernard the first version | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个文件叫env_utility.py怎么样?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
env_utility.py 我觉得这个名字更好一些
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
嗯嗯,文件名env_utility.py更好,rtenv.py估计后续会留给env那个仓库,这个文件主要是为了对接env的,避免tools和env重复或者不一致
拉取/合并请求描述:(PR description)
[
为什么提交这份PR (why to submit this PR)
目前tools中env相关的操作接口分散到各个py脚本(menukconfig.py、env.py、install_env.py、building.py等),且部分函数重复实现,甚至部分实现还不统一,影响env的统一行为。
该修改便于后续rtt统一对接env。
你的解决方案是什么 (what is your solution)
将menukconfig.py、env.py、install_env.py的功能统一到env_helper.py上,其他需要用到env接口/路径的,通过import env_helper进行调用。优化了对kconfiglib是否安装提示,优化了pkgs_dir环境变量是否存在的提示。
请提供验证的bsp和config (provide the config and bsp)
]
当前拉取/合并请求的状态 Intent for your PR
必须选择一项 Choose one (Mandatory):
代码质量 Code Quality:
我在这个拉取/合并请求中已经考虑了 As part of this pull request, I've considered the following:
#if 0
代码,不包含已经被注释了的代码 All redundant code is removed and cleaned up