Skip to content

Commit

Permalink
Fix the script doesn't stop eariler on error for MSVC and Ninja (pyto…
Browse files Browse the repository at this point in the history
…rch#8277)

* Simplify the solution

* Remove the usage of set errorlevel
  • Loading branch information
peterjc123 authored and weiyangfb committed Jun 11, 2018
1 parent 5463e44 commit 61a68e3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 3 additions & 2 deletions .jenkins/pytorch/win-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ mkdir %CD%\\tmp_bin
if "%REBUILD%"=="" (
:check_sccache
%CD%\\tmp_bin\\sccache.exe --show-stats || (
taskkill /im sccache.exe /f /t || set ERRORLEVEL=0
taskkill /im sccache.exe /f /t || ver > nul
del %CD%\\tmp_bin\\sccache.exe
aws s3 cp s3://ossci-windows/sccache.exe %CD%\\tmp_bin\\sccache.exe
goto :check_sccache
Expand Down Expand Up @@ -95,7 +95,8 @@ if "%REBUILD%"=="" (
set NO_CUDA=1
python setup.py install
)
if %errorlevel% neq 0 exit /b %errorlevel%
if errorlevel 1 exit /b 1
if not errorlevel 0 exit /b 1
if "%REBUILD%"=="" (
sccache --show-stats
sccache --zero-stats
Expand Down
6 changes: 4 additions & 2 deletions tools/build_pytorch_libs.bat
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,8 @@ goto:eof
-DCMAKE_BUILD_TYPE=%BUILD_TYPE%

%MAKE_COMMAND%
IF NOT %ERRORLEVEL%==0 exit 1
IF ERRORLEVEL 1 exit 1
IF NOT ERRORLEVEL 0 exit 1
cd ../..
@endlocal

Expand Down Expand Up @@ -198,7 +199,8 @@ goto:eof
-DWITH_ROCM=%WITH_ROCM%

%MAKE_COMMAND%
IF NOT %ERRORLEVEL%==0 exit 1
IF ERRORLEVEL 1 exit 1
IF NOT ERRORLEVEL 0 exit 1
cd ..
@endlocal

Expand Down

0 comments on commit 61a68e3

Please sign in to comment.