rt-thread icon indicating copy to clipboard operation
rt-thread copied to clipboard

[script] add install.sh for rt-thread

Open supperthomas opened this issue 1 year ago • 8 comments

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

[

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

添加一建安装 安装install.sh

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

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

  • BSP:
  • .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

supperthomas avatar Aug 27 '24 00:08 supperthomas

是否放到tools目录下更合适?

BernardXiong avatar Aug 27 '24 01:08 BernardXiong

是否放到tools目录下更合适?

这个放根目录下比较明显一些, 很多仓库都有类似的比如esp-idf 惯例一些吧

supperthomas avatar Aug 27 '24 01:08 supperthomas

如果觉得不合适也可以放tools

supperthomas avatar Aug 27 '24 02:08 supperthomas

如果觉得不合适也可以放tools

放tools下,感觉更适合些。例如后续把rt-thread导入到某IDE中,看到根目录下有份install.sh,是不是好奇就去执行下?

BernardXiong avatar Aug 27 '24 02:08 BernardXiong

如果觉得不合适也可以放tools

放tools下,感觉更适合些。例如后续把rt-thread导入到某IDE中,看到根目录下有份install.sh,是不是好奇就去执行下?

已改

supperthomas avatar Aug 27 '24 09:08 supperthomas

这个应该是安装env的吧,叫install不能一眼看出它的意图,叫env-install?

heyuanjie87 avatar Aug 27 '24 10:08 heyuanjie87

其实我一直觉得 install_ubuntu.sh,install_windows.ps1等安装环境的脚本应该放在tools目录,而不是放在env仓库,因为随着rtt的升级,install_xxx肯定会变化,如果全部放在了env仓库,那么env修改,那么会影响所有版本,很难做到历史兼容。

env更应该做的是独立的工具链,管理rtt项目等,也就是具备独立rtt版本的工具。

ComerLater avatar Aug 27 '24 10:08 ComerLater

这个应该是安装env的吧,叫install不能一眼看出它的意图,叫env-install?

env里面还有scons install 算所有环境的总和吧。算把所有环境一次性配好。主要方便新手

supperthomas avatar Aug 27 '24 11:08 supperthomas

其实我一直觉得 install_ubuntu.sh,install_windows.ps1等安装环境的脚本应该放在tools目录,而不是放在env仓库,因为随着rtt的升级,install_xxx肯定会变化,如果全部放在了env仓库,那么env修改,那么会影响所有版本,很难做到历史兼容。

env更应该做的是独立的工具链,管理rtt项目等,也就是具备独立rtt版本的工具。

安装的脚本确实推荐放rt-thread这边,或者有份单独的也可以,比较少的,clone env,然后又去安装env

BernardXiong avatar Aug 28 '24 14:08 BernardXiong

install_on_fedora() { install_on_centos() { install_on_arch() {

列了这些,是否这些都需要补齐后再进行合并?如果是测试,也许在linux下用docker的模式测试会比较方便?

BernardXiong avatar Aug 28 '24 14:08 BernardXiong

install_on_fedora() { install_on_centos() { install_on_arch() {

列了这些,是否这些都需要补齐后再进行合并?如果是测试,也许在linux下用docker的模式测试会比较方便?

其他都是根据env提供的脚本来安装的,env下面还没有,我先删了吧

supperthomas avatar Aug 28 '24 17:08 supperthomas

@supperthomas 如果就绪请自行合并

mysterywolf avatar Aug 28 '24 22:08 mysterywolf

install.sh中有几个比较关键的问题,我罗列一下:

  1. macOS在 uname中的结果是 Darwin, 不是 macOS image

如果不进行修改,会引发报错

image

所以需要进行额外修改

  1. 文件中存在了大量的针对大陆用户 gitee 链接的错误引用 ex:
# 根据检测结果决定是否使用--gitee参数
    if [ "$use_gitee" = true ]; then
        wget https://raw.githubusercontent.com/RT-Thread/env/master/install_macos.sh <---- 此处应为 https://gitee.com/RT-Thread-Mirror/env/raw/master/install_macos.sh 
        chmod 777 install_macos.sh
        echo "Installing on China gitee..."
        ./install_macos.sh --gitee
    else
        wget https://raw.githubusercontent.com/RT-Thread/env/master/install_macos.sh
        chmod 777 install_macos.sh
        echo "Installing on no China..."
        ./install_macos.sh
    fi
    rm ./install_macos.sh

@supperthomas @BernardXiong 还请大家尽快修复相关问题

ThearchyHelios avatar Aug 08 '25 04:08 ThearchyHelios

install.sh中有几个比较关键的问题,我罗列一下:

  1. macOS在 uname中的结果是 Darwin, 不是 macOS
image 如果不进行修改,会引发报错 image 所以需要进行额外修改
  1. 文件中存在了大量的针对大陆用户 gitee 链接的错误引用 ex:
# 根据检测结果决定是否使用--gitee参数
    if [ "$use_gitee" = true ]; then
        wget https://raw.githubusercontent.com/RT-Thread/env/master/install_macos.sh <---- 此处应为 https://gitee.com/RT-Thread-Mirror/env/raw/master/install_macos.sh 
        chmod 777 install_macos.sh
        echo "Installing on China gitee..."
        ./install_macos.sh --gitee
    else
        wget https://raw.githubusercontent.com/RT-Thread/env/master/install_macos.sh
        chmod 777 install_macos.sh
        echo "Installing on no China..."
        ./install_macos.sh
    fi
    rm ./install_macos.sh

@supperthomas @BernardXiong 还请大家尽快修复相关问题

欢迎提交一个PR,目前我们手上都没有macos的机器,对macos也不熟悉,测起来也不方便,如果有问题,请帮忙提个PR,谢谢。

supperthomas avatar Aug 08 '25 07:08 supperthomas

install.sh中有几个比较关键的问题,我罗列一下:

  1. macOS在 uname中的结果是 Darwin, 不是 macOS
image 如果不进行修改,会引发报错 image 所以需要进行额外修改
  1. 文件中存在了大量的针对大陆用户 gitee 链接的错误引用 ex:
# 根据检测结果决定是否使用--gitee参数
    if [ "$use_gitee" = true ]; then
        wget https://raw.githubusercontent.com/RT-Thread/env/master/install_macos.sh <---- 此处应为 https://gitee.com/RT-Thread-Mirror/env/raw/master/install_macos.sh 
        chmod 777 install_macos.sh
        echo "Installing on China gitee..."
        ./install_macos.sh --gitee
    else
        wget https://raw.githubusercontent.com/RT-Thread/env/master/install_macos.sh
        chmod 777 install_macos.sh
        echo "Installing on no China..."
        ./install_macos.sh
    fi
    rm ./install_macos.sh

@supperthomas @BernardXiong 还请大家尽快修复相关问题

欢迎提交一个PR,目前我们手上都没有macos的机器,对macos也不熟悉,测起来也不方便,如果有问题,请帮忙提个PR,谢谢。

#10593 已递交PR

ThearchyHelios avatar Aug 09 '25 04:08 ThearchyHelios