Skip to content

Commit 4361548

Browse files
authored
bpo-36511: Improve ARM32 buildbot scripts (GH-14251)
1 parent 46e9f15 commit 4361548

File tree

3 files changed

+92
-10
lines changed

3 files changed

+92
-10
lines changed

Tools/buildbot/remoteDeploy.bat

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
@echo off
2+
rem Used by the buildbot "remotedeploy" step.
3+
setlocal
4+
5+
set PATH=%PATH%;%SystemRoot%\SysNative\OpenSSH;%SystemRoot%\System32\OpenSSH
6+
set here=%~dp0
7+
set arm32_ssh=
8+
9+
:CheckOpts
10+
if "%1"=="-arm32" (set arm32_ssh=true) & shift & goto CheckOpts
11+
if NOT "%1"=="" (echo unrecognized option %1) & goto Arm32SshHelp
12+
13+
if "%arm32_ssh%"=="true" goto :Arm32Ssh
14+
15+
:Arm32Ssh
16+
if "%SSH_SERVER%"=="" goto :Arm32SshHelp
17+
18+
ssh %SSH_SERVER% echo Make sure we can find SSH and SSH_SERVER variable is valid
19+
if %ERRORLEVEL% NEQ 0 (echo SSH does not work) & exit /b %ERRORLEVEL%
20+
21+
if "%PYTHON_SOURCE%"=="" (set PYTHON_SOURCE=%here%..\..\)
22+
if "%REMOTE_PYTHON_DIR%"=="" (set REMOTE_PYTHON_DIR=C:\python\)
23+
if NOT "%REMOTE_PYTHON_DIR:~-1,1%"=="\" (set REMOTE_PYTHON_DIR=%REMOTE_PYTHON_DIR%\)
24+
echo PYTHON_SOURCE = %PYTHON_SOURCE%
25+
echo REMOTE_PYTHON_DIR = %REMOTE_PYTHON_DIR%
26+
27+
ssh %SSH_SERVER% "if EXIST %REMOTE_PYTHON_DIR% (rd %REMOTE_PYTHON_DIR% /s/q)"
28+
ssh %SSH_SERVER% "md %REMOTE_PYTHON_DIR%PCBuild\arm32"
29+
ssh %SSH_SERVER% "md %REMOTE_PYTHON_DIR%temp"
30+
ssh %SSH_SERVER% "md %REMOTE_PYTHON_DIR%Modules"
31+
ssh %SSH_SERVER% "md %REMOTE_PYTHON_DIR%PC"
32+
for /f "USEBACKQ" %%i in (`dir PCbuild\*.bat /b`) do @scp PCBuild\%%i "%SSH_SERVER%:%REMOTE_PYTHON_DIR%PCBuild"
33+
for /f "USEBACKQ" %%i in (`dir PCbuild\*.py /b`) do @scp PCBuild\%%i "%SSH_SERVER%:%REMOTE_PYTHON_DIR%PCBuild"
34+
for /f "USEBACKQ" %%i in (`dir PCbuild\arm32\*.exe /b`) do @scp PCBuild\arm32\%%i "%SSH_SERVER%:%REMOTE_PYTHON_DIR%PCBuild\arm32"
35+
for /f "USEBACKQ" %%i in (`dir PCbuild\arm32\*.pyd /b`) do @scp PCBuild\arm32\%%i "%SSH_SERVER%:%REMOTE_PYTHON_DIR%PCBuild\arm32"
36+
for /f "USEBACKQ" %%i in (`dir PCbuild\arm32\*.dll /b`) do @scp PCBuild\arm32\%%i "%SSH_SERVER%:%REMOTE_PYTHON_DIR%PCBuild\arm32"
37+
scp -r "%PYTHON_SOURCE%Include" "%SSH_SERVER%:%REMOTE_PYTHON_DIR%Include"
38+
scp -r "%PYTHON_SOURCE%Lib" "%SSH_SERVER%:%REMOTE_PYTHON_DIR%Lib"
39+
scp -r "%PYTHON_SOURCE%Tools" "%SSH_SERVER%:%REMOTE_PYTHON_DIR%Tools"
40+
scp "%PYTHON_SOURCE%Modules\Setup" "%SSH_SERVER%:%REMOTE_PYTHON_DIR%Modules"
41+
scp "%PYTHON_SOURCE%PC\pyconfig.h" "%SSH_SERVER%:%REMOTE_PYTHON_DIR%PC"
42+
43+
exit /b %ERRORLEVEL%
44+
45+
:Arm32SshHelp
46+
echo SSH_SERVER environment variable must be set to administrator@[ip address]
47+
echo where [ip address] is the address of a Windows IoT Core ARM32 device.
48+
echo.
49+
echo The test worker should have the SSH agent running.
50+
echo Also a key must be created with ssh-keygen and added to both the buildbot worker machine
51+
echo and the ARM32 worker device: see https://docs.microsoft.com/en-us/windows/iot-core/connect-your-device/ssh
52+
exit /b 127

Tools/buildbot/remotePythonInfo.bat

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
@echo off
2+
rem Used by the buildbot "remotedeploy" step.
3+
setlocal
4+
5+
set PATH=%PATH%;%SystemRoot%\SysNative\OpenSSH;%SystemRoot%\System32\OpenSSH
6+
set here=%~dp0
7+
set arm32_ssh=
8+
set suffix=_d
9+
if "%REMOTE_PYTHON_DIR%"=="" (set REMOTE_PYTHON_DIR=C:\python\)
10+
if NOT "%REMOTE_PYTHON_DIR:~-1,1%"=="\" (set REMOTE_PYTHON_DIR=%REMOTE_PYTHON_DIR%\)
11+
12+
:CheckOpts
13+
if "%1"=="-arm32" (set arm32_ssh=true) & (set prefix=%REMOTE_PYTHON_DIR%pcbuild\arm32) & shift & goto CheckOpts
14+
if "%1"=="-d" (set suffix=_d) & shift & goto CheckOpts
15+
if "%1"=="+d" (set suffix=) & shift & goto CheckOpts
16+
if NOT "%1"=="" (echo unrecognized option %1) & goto Arm32SshHelp
17+
18+
if "%arm32_ssh%"=="true" goto :Arm32Ssh
19+
20+
:Arm32Ssh
21+
if "%SSH_SERVER%"=="" goto :Arm32SshHelp
22+
23+
set PYTHON_EXE=%prefix%\python%suffix%.exe
24+
echo on
25+
ssh %SSH_SERVER% %PYTHON_EXE% -m test.pythoninfo
26+
exit /b %ERRORLEVEL%
27+
28+
:Arm32SshHelp
29+
echo SSH_SERVER environment variable must be set to administrator@[ip address]
30+
echo where [ip address] is the address of a Windows IoT Core ARM32 device.
31+
echo.
32+
echo The test worker should have the SSH agent running.
33+
echo Also a key must be created with ssh-keygen and added to both the buildbot worker machine
34+
echo and the ARM32 worker device: see https://docs.microsoft.com/en-us/windows/iot-core/connect-your-device/ssh
35+
exit /b 127

Tools/buildbot/test.bat

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
rem Used by the buildbot "test" step.
33
setlocal
44

5+
set PATH=%PATH%;%SystemRoot%\SysNative\OpenSSH;%SystemRoot%\System32\OpenSSH
56
set here=%~dp0
67
set rt_opts=-q -d
78
set regrtest_args=-j1
@@ -18,8 +19,10 @@ if "%1"=="+d" (set rt_opts=%rt_opts:-d=%) & shift & goto CheckOpts
1819
if "%1"=="+q" (set rt_opts=%rt_opts:-q=%) & shift & goto CheckOpts
1920
if NOT "%1"=="" (set regrtest_args=%regrtest_args% %1) & shift & goto CheckOpts
2021

22+
if "%PROCESSOR_ARCHITECTURE%"=="ARM" if "%arm32_ssh%"=="true" goto NativeExecution
2123
if "%arm32_ssh%"=="true" goto :Arm32Ssh
2224

25+
:NativeExecution
2326
call "%here%..\..\PCbuild\rt.bat" %rt_opts% -uall -rwW --slowest --timeout=1200 --fail-env-changed %regrtest_args%
2427
exit /b %ERRORLEVEL%
2528

@@ -28,17 +31,9 @@ set dashU=-unetwork,decimal,subprocess,urlfetch,tzdata
2831
if "%SSH_SERVER%"=="" goto :Arm32SshHelp
2932
if "%PYTHON_SOURCE%"=="" (set PYTHON_SOURCE=%here%..\..\)
3033
if "%REMOTE_PYTHON_DIR%"=="" (set REMOTE_PYTHON_DIR=C:\python\)
34+
if NOT "%REMOTE_PYTHON_DIR:~-1,1%"=="\" (set REMOTE_PYTHON_DIR=%REMOTE_PYTHON_DIR%\)
35+
3136
set TEMP_ARGS=--temp %REMOTE_PYTHON_DIR%temp
32-
ssh %SSH_SERVER% "if EXIST %REMOTE_PYTHON_DIR% (rd %REMOTE_PYTHON_DIR% /s/q)"
33-
ssh %SSH_SERVER% "md %REMOTE_PYTHON_DIR%PCBuild\arm32"
34-
ssh %SSH_SERVER% "md %REMOTE_PYTHON_DIR%temp"
35-
for /f "USEBACKQ" %%i in (`dir PCbuild\*.bat /b`) do @scp PCBuild\%%i "%SSH_SERVER%:%REMOTE_PYTHON_DIR%PCBuild"
36-
for /f "USEBACKQ" %%i in (`dir PCbuild\*.py /b`) do @scp PCBuild\%%i "%SSH_SERVER%:%REMOTE_PYTHON_DIR%PCBuild"
37-
for /f "USEBACKQ" %%i in (`dir PCbuild\arm32\*.exe /b`) do @scp PCBuild\arm32\%%i "%SSH_SERVER%:%REMOTE_PYTHON_DIR%PCBuild\arm32"
38-
for /f "USEBACKQ" %%i in (`dir PCbuild\arm32\*.pyd /b`) do @scp PCBuild\arm32\%%i "%SSH_SERVER%:%REMOTE_PYTHON_DIR%PCBuild\arm32"
39-
for /f "USEBACKQ" %%i in (`dir PCbuild\arm32\*.dll /b`) do @scp PCBuild\arm32\%%i "%SSH_SERVER%:%REMOTE_PYTHON_DIR%PCBuild\arm32"
40-
scp -r "%PYTHON_SOURCE%Include" "%SSH_SERVER%:%REMOTE_PYTHON_DIR%Include"
41-
scp -r "%PYTHON_SOURCE%Lib" "%SSH_SERVER%:%REMOTE_PYTHON_DIR%Lib"
4237

4338
set rt_args=%rt_opts% %dashU% -rwW --slowest --timeout=1200 --fail-env-changed %regrtest_args% %TEMP_ARGS%
4439
ssh %SSH_SERVER% "set TEMP=%REMOTE_PYTHON_DIR%temp& %REMOTE_PYTHON_DIR%PCbuild\rt.bat" %rt_args%

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy