Skip to content

Commit f4b0a6b

Browse files
author
Paul Monson
committed
workaround optimization problem, cleanup tools\winiot
1 parent fa8b2f1 commit f4b0a6b

File tree

6 files changed

+120
-204
lines changed

6 files changed

+120
-204
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ PCbuild/*.VC.opendb
7171
PCbuild/.vs/
7272
PCbuild/amd64/
7373
PCbuild/arm32/
74+
PCbuild/iot/
7475
PCbuild/obj/
7576
PCbuild/win32/
7677
.purify

Lib/test/test_ssl.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1319,7 +1319,7 @@ def test_load_verify_cadata(self):
13191319
with self.assertRaisesRegex(ssl.SSLError, "not enough data"):
13201320
ctx.load_verify_locations(cadata=b"broken")
13211321

1322-
@unittest.skipIf(platform.machine() == 'ARM', "ssl error needs investigation")
1322+
@unittest.skipIf(platform.win32_editionId() == 'IoTUAP' and 'python_d' in sys.executable, "Crashes on debug python builds on Windows IoT Core")
13231323
def test_load_dh_params(self):
13241324
ctx = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
13251325
ctx.load_dh_params(DHFILE)
@@ -1621,7 +1621,7 @@ def test_str(self):
16211621
self.assertEqual(str(e), "foo")
16221622
self.assertEqual(e.errno, 1)
16231623

1624-
@unittest.skipIf(platform.machine() == 'ARM', "ssl error needs investigation")
1624+
@unittest.skipIf(platform.win32_editionId() == 'IoTUAP' and 'python_d' in sys.executable, "Crashes on debug python builds on Windows IoT Core")
16251625
def test_lib_reason(self):
16261626
# Test the library and reason attributes
16271627
ctx = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
@@ -3726,7 +3726,7 @@ def test_compression_disabled(self):
37263726
sni_name=hostname)
37273727
self.assertIs(stats['compression'], None)
37283728

3729-
@unittest.skipIf(platform.machine() == 'ARM', "ssl error needs investigation")
3729+
@unittest.skipIf(platform.win32_editionId() == 'IoTUAP' and 'python_d' in sys.executable, "Crashes on debug python builds on Windows IoT Core")
37303730
def test_dh_params(self):
37313731
# Check we can get a connection with ephemeral Diffie-Hellman
37323732
client_context, server_context, hostname = testing_context()

Python/ceval.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -547,6 +547,10 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
547547
return tstate->interp->eval_frame(f, throwflag);
548548
}
549549

550+
#ifdef _M_ARM
551+
#pragma optimize ("", off)
552+
#endif // _M_ARM
553+
550554
PyObject* _Py_HOT_FUNCTION
551555
_PyEval_EvalFrameDefault(PyFrameObject *f, int throwflag)
552556
{
@@ -3500,6 +3504,10 @@ _PyEval_EvalFrameDefault(PyFrameObject *f, int throwflag)
35003504
return _Py_CheckFunctionResult(NULL, retval, "PyEval_EvalFrameEx");
35013505
}
35023506

3507+
#ifdef _M_ARM
3508+
#pragma optimize ("", on)
3509+
#endif // _M_ARM
3510+
35033511
static void
35043512
format_missing(const char *kind, PyCodeObject *co, PyObject *names)
35053513
{

Tools/winiot/build.bat

Lines changed: 15 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,39 +2,29 @@
22
setlocal
33
set D=%~dp0
44
set PCBUILD=%D%..\..\PCbuild\
5+
set PYTHON_EXE=%PCBUILD%..\externals\pythonx86\tools\python.exe
56
if "%Py_OutDir%"=="" set Py_OutDir=%PCBUILD%
67

78
set BUILDX86=
89
set BUILDX64=
910
set BUILDARM=
10-
set SYNCX86=
11-
set SYNCX64=
12-
set SYNCARM=
1311
set REBUILD=
14-
set OUTPUT=
15-
set PACKAGES=
1612
set DEBUG=
17-
set DEBUG_SUFFIX=
13+
set TEST=
14+
set _SUFFIX=
1815

1916
:CheckOpts
2017
if "%~1" EQU "-h" goto Help
21-
if "%~1" EQU "-x86" (set BUILDX86=1 && set SYNCX86=1) && shift && goto CheckOpts
22-
if "%~1" EQU "-x64" (set BUILDX64=1 && set SYNCX64=1) && shift && goto CheckOpts
23-
if "%~1" EQU "-arm" (set BUILDARM=1 && set SYNCARM=1) && shift && goto CheckOpts
18+
if "%~1" EQU "-x86" (set BUILDX86=1) && shift && goto CheckOpts
19+
if "%~1" EQU "-x64" (set BUILDX64=1) && shift && goto CheckOpts
20+
if "%~1" EQU "-arm" (set BUILDARM=1) && shift && goto CheckOpts
21+
if "%~1" EQU "-t" (set TEST=-t) && shift && goto CheckOpts
2422
if "%~1" EQU "-r" (set REBUILD=-r) && shift && goto CheckOpts
2523
if "%~1" EQU "-d" (set DEBUG=-d && set _SUFFIX=_d) && shift && goto CheckOpts
26-
if "%~1" EQU "-o" (set OUTPUT="/p:OutputPath=%~2") && shift && shift && goto CheckOpts
27-
if "%~1" EQU "--out" (set OUTPUT="/p:OutputPath=%~2") && shift && shift && goto CheckOpts
28-
if "%~1" EQU "-p" (set PACKAGES=%PACKAGES% %~2) && shift && shift && goto CheckOpts
2924
if "%~1" NEQ "" echo Unknown parameter "%~1" && exit
3025

3126
if not defined BUILDX86 if not defined BUILDX64 if not defined BUILDARM (set BUILDX86=1) && (set BUILDX64=1) && (set BUILDARM=1)
3227

33-
:: need x64 python.exe to run sync_win_iot.pl when only building for ARM
34-
if defined BUILDARM (
35-
if not exist "%PCBUILD%amd64\python.exe" ( set BUILDX64=1 )
36-
)
37-
3828
call "%PCBUILD%find_msbuild.bat" %MSBUILD%
3929
if ERRORLEVEL 1 (echo Cannot locate MSBuild.exe on PATH or as MSBUILD variable & exit /b 2)
4030

@@ -45,29 +35,26 @@ if defined DEBUG (set CONFIGURATION=Debug
4535

4636
if defined BUILDX86 (
4737
if defined REBUILD ( call "%PCBUILD%build.bat" -e -r
48-
) else if not exist "%Py_OutDir%win32\python.exe" call "%PCBUILD%build.bat" -e %DEBUG%
38+
) else if not exist "%Py_OutDir%win32\python%_SUFFIX%.exe" call "%PCBUILD%build.bat" -e %DEBUG%
4939
if errorlevel 1 goto :eof
5040

51-
if defined SYNCX86 ( %MSBUILD% "%D%sync_win_iot.proj" /p:Configuration=%CONFIGURATION% /p:Platform=x86 %OUTPUT% %PACKAGES% %WINIOT% )
52-
if errorlevel 1 goto :eof
41+
%PYTHON_EXE% %D%sync_win_iot.py %DEBUG% %TEST% -p win32
5342
)
5443

5544
if defined BUILDX64 (
5645
if defined REBUILD ( call "%PCBUILD%build.bat" -p x64 -e -r
57-
) else if not exist "%Py_OutDir%amd64\python.exe" call "%PCBUILD%build.bat" -p x64 -e %DEBUG%
46+
) else if not exist "%Py_OutDir%amd64\python%_SUFFIX%.exe" call "%PCBUILD%build.bat" -p x64 -e %DEBUG%
5847
if errorlevel 1 goto :eof
5948

60-
if defined SYNCX64 ( %MSBUILD% "%D%sync_win_iot.proj" /p:Configuration=%CONFIGURATION% /p:Platform=x64 %OUTPUT% %PACKAGES% %WINIOT% )
61-
if errorlevel 1 goto :eof
49+
%PYTHON_EXE% %D%sync_win_iot.py %DEBUG% %TEST% -p amd64
6250
)
6351

6452
if defined BUILDARM (
65-
if defined REBUILD ( call "%PCBUILD%build.bat" -p ARM -e %DEBUG% -r --no-tkinter --no-ssl --no-vs
66-
) else if not exist "%Py_OutDir%arm32\python%_SUFFIX%.exe" call "%PCBUILD%build.bat" -p ARM -e %DEBUG% --no-tkinter --no-vs
53+
if defined REBUILD ( call "%PCBUILD%build.bat" -p ARM -e %DEBUG% -r --no-tkinter --no-vs
54+
) else if not exist "%Py_OutDir%arm32\python%_SUFFIX%.exe" call "%PCBUILD%build.bat" -p ARM -E %DEBUG% --no-tkinter --no-vs
6755
if errorlevel 1 goto :eof
6856

69-
if defined SYNCARM ( %MSBUILD% "%D%sync_win_iot.proj" /p:Configuration=%CONFIGURATION% /p:Platform=ARM /p:"PythonExe=%PCBUILD%amd64\python.exe" %OUTPUT% %PACKAGES% %WINIOT% )
70-
if errorlevel 1 goto :eof
57+
%PYTHON_EXE% %D%sync_win_iot.py %DEBUG% %TEST% -p arm32
7158
)
7259

7360
exit /B 0
@@ -78,7 +65,7 @@ echo.
7865
echo -x86 Build and sync x86 files
7966
echo -x64 Build and sync x64 files
8067
echo -arm Build and sync arm files (will build X64 to execute tools)
68+
echo -t Include test files
8169
echo -d Build Debug configuration
8270
echo -r Rebuild rather than incremental build
83-
echo --out [DIR] Override output directory
8471
echo -h Show usage

Tools/winiot/sync_win_iot.proj

Lines changed: 0 additions & 37 deletions
This file was deleted.

0 commit comments

Comments
 (0)