Skip to content

Commit 3091e5b

Browse files
authored
Merge pull request #2154 from IntelPython/generalize-bld-bat-error-check
[MAINT] Make error checks in `.bat` files more general
2 parents 3677fcb + 3d7f165 commit 3091e5b

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

conda-recipe/bld.bat

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
REM A workaround for activate-dpcpp.bat issue to be addressed in 2021.4
32
set "LIB=%BUILD_PREFIX%\Library\lib;%BUILD_PREFIX%\compiler\lib;%LIB%"
43
set "INCLUDE=%BUILD_PREFIX%\include;%INCLUDE%"
@@ -26,9 +25,9 @@ rem fix the issue with IntelLLVM integration with cmake on Windows
2625
if EXIST "%PLATFORM_DIR%" (
2726
dir "%PLATFORM_DIR%\%FN%"
2827
copy /Y "%PLATFORM_DIR%\%FN%" .
29-
if errorlevel 1 exit 1
28+
if %ERRORLEVEL% neq 0 exit 1
3029
copy /Y ".github\workflows\Windows-IntelLLVM_%PATCHED_CMAKE_VERSION%.cmake" "%PLATFORM_DIR%\%FN%"
31-
if errorlevel 1 exit 1
30+
if %ERRORLEVEL% neq 0 exit 1
3231
)
3332

3433
set "CC=icx"
@@ -65,5 +64,5 @@ for /f %%f in ('dir /b /S .\dist') do (
6564
:: Copy wheel package
6665
if NOT "%WHEELS_OUTPUT_FOLDER%"=="" (
6766
copy dist\dpctl*.whl %WHEELS_OUTPUT_FOLDER%
68-
if errorlevel 1 exit 1
67+
if %ERRORLEVEL% neq 0 exit 1
6968
)

conda-recipe/run_test.bat

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
@echo on
22

33
"%PYTHON%" -c "import dpctl; print(dpctl.__version__)"
4-
if errorlevel 1 exit 1
4+
if %ERRORLEVEL% neq 0 exit 1
55

66
"%PYTHON%" -m dpctl -f
7-
if errorlevel 1 exit 1
7+
if %ERRORLEVEL% neq 0 exit 1
88

99
python -m pytest -q -ra --disable-warnings --pyargs dpctl -vv
10-
if errorlevel 1 exit 1
10+
if %ERRORLEVEL% neq 0 exit 1

libsyclinterface/dbg_build.bat

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ dpcpp.exe --version >nul 2>&1
33
if errorlevel 1 (
44
set ERRORLEVEL=
55
call "%ONEAPI_ROOT%\compiler\latest\env\vars.bat"
6-
if errorlevel 1 exit 1
6+
if %ERRORLEVEL% neq 0 exit 1
77
)
88
@REM conda uses %ERRORLEVEL% but FPGA scripts can set it. So it should be reseted.
99
set ERRORLEVEL=
@@ -31,13 +31,13 @@ cmake -G Ninja ^
3131
"-DCMAKE_LINKER:PATH=%DPCPP_HOME%\bin\lld-link.exe" ^
3232
"-DDPCTL_BUILD_CAPI_TESTS=ON" ^
3333
".."
34-
if errorlevel 1 exit 1
34+
if %ERRORLEVEL% neq 0 exit 1
3535

3636
ninja -n
37-
if errorlevel 1 exit 1
37+
if %ERRORLEVEL% neq 0 exit 1
3838
@REM ninja check
3939
@REM IF %ERRORLEVEL% NEQ 0 exit /b 1
4040
ninja install
41-
if errorlevel 1 exit 1
41+
if %ERRORLEVEL% neq 0 exit 1
4242

4343
cd ..

0 commit comments

Comments
 (0)