Skip to content

Commit d709561

Browse files
committed
统一tools中env相关的接口到env_helper.py文件,并同步调整ci
1 parent 4e8b829 commit d709561

12 files changed

+491
-675
lines changed

.github/workflows/bsp_buildings.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -369,9 +369,9 @@ jobs:
369369
chmod 777 install_ubuntu.sh
370370
./install_ubuntu.sh
371371
git config --global http.postBuffer 524288000
372-
python -c "import tools.menukconfig; tools.menukconfig.touch_env()"
373372
echo "RTT_ROOT=${{ github.workspace }}" >> $GITHUB_ENV
374373
echo "RTT_CC=gcc" >> $GITHUB_ENV
374+
echo "export PATH=~/.env/tools/scripts:$PATH" > ~/.env/env.sh
375375
376376
- name: Install Arm ToolChains
377377
if: ${{ matrix.legs.RTT_TOOL_CHAIN == 'sourcery-arm' && success() }}

.github/workflows/compile_bsp_with_drivers.yml

+2-3
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ jobs:
5252
git config --global http.postBuffer 524288000
5353
git remote -v
5454
git fetch origin
55-
python -c "import tools.menukconfig; tools.menukconfig.touch_env()"
5655
5756
- name: Install Arm ToolChains
5857
if: ${{ success() }}
@@ -67,5 +66,5 @@ jobs:
6766
if: ${{ success() }}
6867
shell: bash
6968
run: |
70-
source ~/.env/env.sh
71-
#python tools/ci/compile_bsp_with_drivers.py
69+
# source ~/.env/env.sh
70+
# python tools/ci/compile_bsp_with_drivers.py

.github/workflows/manual_dist.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ jobs:
6666
chmod 777 install_ubuntu.sh
6767
./install_ubuntu.sh
6868
git config --global http.postBuffer 524288000
69-
python -c "import tools.menukconfig; tools.menukconfig.touch_env()"
7069
echo "RTT_ROOT=${{ github.workspace }}" >> $GITHUB_ENV
7170
echo "RTT_CC=gcc" >> $GITHUB_ENV
7271
@@ -145,7 +144,7 @@ jobs:
145144
RTT_BSP: ${{ github.event.inputs.bsp_options }}
146145
RTT_TOOL_CHAIN: ${{ github.event.inputs.bsp_tool_chain}}
147146
run: |
148-
source ~/.env/env.sh
147+
# source ~/.env/env.sh
149148
echo $RTT_BSP
150149
ls bsp/$RTT_BSP/Kconfig && scons -C bsp/$RTT_BSP --pyconfig-silent
151150
config=${{ github.event.inputs.bsp_config}}

.github/workflows/manual_trigger_scons_STM32_all.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,6 @@ jobs:
141141
chmod 777 install_ubuntu.sh
142142
./install_ubuntu.sh
143143
git config --global http.postBuffer 524288000
144-
python -c "import tools.menukconfig; tools.menukconfig.touch_env()"
145144
echo "RTT_ROOT=${{ github.workspace }}" >> $GITHUB_ENV
146145
echo "RTT_CC=gcc" >> $GITHUB_ENV
147146
@@ -161,7 +160,7 @@ jobs:
161160
RTT_BSP: ${{ matrix.legs.RTT_BSP }}
162161
RTT_TOOL_CHAIN: ${{ matrix.legs.RTT_TOOL_CHAIN }}
163162
run: |
164-
source ~/.env/env.sh
163+
# source ~/.env/env.sh
165164
echo $RTT_BSP
166165
ls bsp/$RTT_BSP/Kconfig && scons -C bsp/$RTT_BSP --pyconfig-silent
167166
sed -i "s/# ${{ github.event.inputs.bsp_config }} is not set/${{ github.event.inputs.bsp_config }}=y/g" bsp/$RTT_BSP/.config

.github/workflows/manual_trigger_scons_except_STM32_all.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,6 @@ jobs:
286286
chmod 777 install_ubuntu.sh
287287
./install_ubuntu.sh
288288
git config --global http.postBuffer 524288000
289-
python -c "import tools.menukconfig; tools.menukconfig.touch_env()"
290289
echo "RTT_ROOT=${{ github.workspace }}" >> $GITHUB_ENV
291290
echo "RTT_CC=gcc" >> $GITHUB_ENV
292291
@@ -354,7 +353,7 @@ jobs:
354353
RTT_BSP: ${{ matrix.legs.RTT_BSP }}
355354
RTT_TOOL_CHAIN: ${{ matrix.legs.RTT_TOOL_CHAIN }}
356355
run: |
357-
source ~/.env/env.sh
356+
# source ~/.env/env.sh
358357
echo $RTT_BSP
359358
ls bsp/$RTT_BSP/Kconfig && scons -C bsp/$RTT_BSP --pyconfig-silent
360359
sed -i "s/# ${{ github.event.inputs.bsp_config }} is not set/${{ github.event.inputs.bsp_config }}=y/g" bsp/$RTT_BSP/.config

.github/workflows/manual_trigger_scons_fail_bsp_all.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ jobs:
116116
chmod 777 install_ubuntu.sh
117117
./install_ubuntu.sh
118118
git config --global http.postBuffer 524288000
119-
python -c "import tools.menukconfig; tools.menukconfig.touch_env()"
120119
echo "RTT_ROOT=${{ github.workspace }}" >> $GITHUB_ENV
121120
echo "RTT_CC=gcc" >> $GITHUB_ENV
122121
@@ -175,7 +174,7 @@ jobs:
175174
RTT_BSP: ${{ matrix.legs.RTT_BSP }}
176175
RTT_TOOL_CHAIN: ${{ matrix.legs.RTT_TOOL_CHAIN }}
177176
run: |
178-
source ~/.env/env.sh
177+
# source ~/.env/env.sh
179178
echo $RTT_BSP
180179
ls bsp/$RTT_BSP/Kconfig && scons -C bsp/$RTT_BSP --pyconfig-silent
181180
sed -i "s/# ${{ github.event.inputs.bsp_config }} is not set/${{ github.event.inputs.bsp_config }}=y/g" bsp/$RTT_BSP/.config

tools/building.py

+9-20
Original file line numberDiff line numberDiff line change
@@ -142,17 +142,6 @@ def PrepareBuilding(env, root_directory, has_libcpu=False, remove_components = [
142142
# set BSP_ROOT in ENV
143143
Env['BSP_ROOT'] = Dir('#').abspath
144144
os.environ["BSP_DIR"] = Dir('#').abspath
145-
# set PKGS_ROOT in ENV
146-
if "PKGS_DIR" in os.environ:
147-
pass
148-
elif "PKGS_ROOT" in os.environ:
149-
os.environ["PKGS_DIR"] = os.environ["PKGS_ROOT"]
150-
elif "ENV_ROOT" in os.environ:
151-
os.environ["PKGS_DIR"] = os.path.join(os.environ["ENV_ROOT"], "packages")
152-
elif sys.platform == "win32":
153-
os.environ["PKGS_DIR"] = os.path.join(os.environ["USERPROFILE"], ".env", "packages")
154-
else:
155-
os.environ["PKGS_DIR"] = os.path.join(os.environ["HOME"], ".env", "packages")
156145

157146
sys.path += os.path.join(Rtt_Root, 'tools')
158147

@@ -205,7 +194,7 @@ def PrepareBuilding(env, root_directory, has_libcpu=False, remove_components = [
205194

206195
try:
207196
# try to detect toolchains in env
208-
envm = utils.ImportModule('env')
197+
envm = utils.ImportModule('env_helper')
209198
# from env import GetSDKPath
210199
exec_path = envm.GetSDKPath(rtconfig.CC)
211200
if 'gcc' in rtconfig.CC:
@@ -331,7 +320,7 @@ def PrepareBuilding(env, root_directory, has_libcpu=False, remove_components = [
331320
print('--global-macros arguments are illegal!')
332321

333322
if GetOption('genconfig'):
334-
from menukconfig import genconfig
323+
from env_helper import genconfig
335324
genconfig()
336325
exit(0)
337326

@@ -341,23 +330,23 @@ def PrepareBuilding(env, root_directory, has_libcpu=False, remove_components = [
341330
exit(0)
342331

343332
if GetOption('menuconfig'):
344-
from menukconfig import menuconfig
333+
from env_helper import menuconfig
345334
menuconfig(Rtt_Root)
346335
exit(0)
347336

348-
if GetOption('pyconfig-silent'):
349-
from menukconfig import guiconfig_silent
350-
guiconfig_silent(Rtt_Root)
337+
if GetOption('defconfig'):
338+
from env_helper import defconfig
339+
defconfig(Rtt_Root)
351340
exit(0)
352341

353-
elif GetOption('pyconfig'):
354-
from menukconfig import guiconfig
342+
elif GetOption('guiconfig'):
343+
from env_helper import guiconfig
355344
guiconfig(Rtt_Root)
356345
exit(0)
357346

358347
configfn = GetOption('useconfig')
359348
if configfn:
360-
from menukconfig import mk_rtconfig
349+
from env_helper import mk_rtconfig
361350
mk_rtconfig(configfn)
362351
exit(0)
363352

tools/env.py

-55
This file was deleted.

0 commit comments

Comments
 (0)