1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

make.bat: remove even more >NUL redirects, that HIDE USEFUL error info

Please do not hide *error information especially*.

A few lines more will NOT cause you much suffering in the happy case,
while they WILL be of great help to maintainers, when things go south.
This commit is contained in:
Delyan Angelov 2021-07-19 09:09:15 +03:00
parent dae32e378d
commit 11161f4550
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED

View File

@ -76,7 +76,7 @@ if "%~1" == "--logfile" (
echo Log file is not specified for -logfile parameter. 1>&2 echo Log file is not specified for -logfile parameter. 1>&2
exit /b 2 exit /b 2
) )
pushd "%~dp2" 2>NUL || ( pushd "%~dp2" || (
echo The log file specified for -logfile parameter does not exist. 1>&2 echo The log file specified for -logfile parameter does not exist. 1>&2
exit /b 2 exit /b 2
) )
@ -104,13 +104,13 @@ if !flag_verbose! EQU 1 (
echo [Debug] rmdir /s /q "%tcc_dir%">>"!log_file!" echo [Debug] rmdir /s /q "%tcc_dir%">>"!log_file!"
echo rmdir /s /q "%tcc_dir%" echo rmdir /s /q "%tcc_dir%"
) )
rmdir /s /q "%tcc_dir%">>"!log_file!" 2>NUL rmdir /s /q "%tcc_dir%">>"!log_file!"
echo ^> Purge vc repository echo ^> Purge vc repository
if !flag_verbose! EQU 1 ( if !flag_verbose! EQU 1 (
echo [Debug] rmdir /s /q "%vc_dir%">>"!log_file!" echo [Debug] rmdir /s /q "%vc_dir%">>"!log_file!"
echo rmdir /s /q "%vc_dir%" echo rmdir /s /q "%vc_dir%"
) )
rmdir /s /q "%vc_dir%">>"!log_file!" 2>NUL rmdir /s /q "%vc_dir%">>"!log_file!"
exit /b 0 exit /b 0
:clean :clean
@ -120,20 +120,20 @@ if !flag_verbose! EQU 1 (
echo [Debug] del *.pdb *.lib *.bak *.out *.ilk *.exp *.obj *.o *.a *.so>>"!log_file!" echo [Debug] del *.pdb *.lib *.bak *.out *.ilk *.exp *.obj *.o *.a *.so>>"!log_file!"
echo del *.pdb *.lib *.bak *.out *.ilk *.exp *.obj *.o *.a *.so echo del *.pdb *.lib *.bak *.out *.ilk *.exp *.obj *.o *.a *.so
) )
del *.pdb *.lib *.bak *.out *.ilk *.exp *.obj *.o *.a *.so>>"!log_file!" 2>NUL del *.pdb *.lib *.bak *.out *.ilk *.exp *.obj *.o *.a *.so>>"!log_file!"
echo ^> Delete old V executable echo ^> Delete old V executable
if !flag_verbose! EQU 1 ( if !flag_verbose! EQU 1 (
echo [Debug] del v_old.exe v*.exe>>"!log_file!" echo [Debug] del v_old.exe v*.exe>>"!log_file!"
echo del v_old.exe v*.exe echo del v_old.exe v*.exe
) )
del v_old.exe v*.exe>>"!log_file!" 2>NUL del v_old.exe v*.exe>>"!log_file!"
exit /b 0 exit /b 0
:help :help
if [!subcmd!] == [] ( if [!subcmd!] == [] (
call :usage 2>NUL call :usage
) else ( ) else (
call :help_!subcmd! 2>NUL call :help_!subcmd!
) )
if %ERRORLEVEL% NEQ 0 echo Invalid subcommand: !subcmd! if %ERRORLEVEL% NEQ 0 echo Invalid subcommand: !subcmd!
exit /b %ERRORLEVEL% exit /b %ERRORLEVEL%
@ -142,24 +142,24 @@ exit /b %ERRORLEVEL%
if !flag_local! NEQ 1 ( if !flag_local! NEQ 1 (
call :download_tcc call :download_tcc
if %ERRORLEVEL% NEQ 0 goto :error if %ERRORLEVEL% NEQ 0 goto :error
del "!log_file!">NUL 2>&1 del "!log_file!"
pushd "%vc_dir%" 2>NUL && ( pushd "%vc_dir%" && (
echo Updating vc... echo Updating vc...
echo ^> Sync with remote !vc_url! echo ^> Sync with remote !vc_url!
if !flag_verbose! EQU 1 ( if !flag_verbose! EQU 1 (
echo [Debug] cd "%vc_dir%">>"!log_file!" echo [Debug] cd "%vc_dir%">>"!log_file!"
echo cd "%vc_dir%" echo cd "%vc_dir%"
cd "%vc_dir%">>"!log_file!" 2>NUL cd "%vc_dir%">>"!log_file!"
echo [Debug] git pull --quiet>>"!log_file!" echo [Debug] git pull --quiet>>"!log_file!"
echo git pull --quiet echo git pull --quiet
git pull --quiet>>"!log_file!" 2>NUL git pull --quiet>>"!log_file!"
echo [Debug] cd ..>>"!log_file!" echo [Debug] cd ..>>"!log_file!"
echo cd .. echo cd ..
cd ..>>"!log_file!" 2>NUL cd ..>>"!log_file!"
) else ( ) else (
cd "%vc_dir%">>"!log_file!" 2>NUL cd "%vc_dir%">>"!log_file!"
git pull --quiet>>"!log_file!" 2>NUL git pull --quiet>>"!log_file!"
cd ..>>"!log_file!" 2>NUL cd ..>>"!log_file!"
) )
popd popd
) || call :cloning_vc ) || call :cloning_vc
@ -270,9 +270,9 @@ for /f "usebackq tokens=*" %%i in (`"%VsWhereDir%\Microsoft Visual Studio\Instal
) )
if exist "%InstallDir%\Common7\Tools\vsdevcmd.bat" ( if exist "%InstallDir%\Common7\Tools\vsdevcmd.bat" (
call "%InstallDir%\Common7\Tools\vsdevcmd.bat" -arch=%HostArch% -host_arch=%HostArch% -no_logo > NUL call "%InstallDir%\Common7\Tools\vsdevcmd.bat" -arch=%HostArch% -host_arch=%HostArch% -no_logo
) else if exist "%VsWhereDir%\Microsoft Visual Studio 14.0\Common7\Tools\vsdevcmd.bat" ( ) else if exist "%VsWhereDir%\Microsoft Visual Studio 14.0\Common7\Tools\vsdevcmd.bat" (
call "%VsWhereDir%\Microsoft Visual Studio 14.0\Common7\Tools\vsdevcmd.bat" -arch=%HostArch% -host_arch=%HostArch% -no_logo > NUL call "%VsWhereDir%\Microsoft Visual Studio 14.0\Common7\Tools\vsdevcmd.bat" -arch=%HostArch% -host_arch=%HostArch% -no_logo
) )
set ObjFile=.v.c.obj set ObjFile=.v.c.obj
@ -285,7 +285,7 @@ if !flag_verbose! EQU 1 (
cl.exe /volatile:ms /Fo%ObjFile% /O2 /MD /D_VBOOTSTRAP vc\v_win.c user32.lib kernel32.lib advapi32.lib shell32.lib /link /nologo /out:v.exe /incremental:no>>"!log_file!" cl.exe /volatile:ms /Fo%ObjFile% /O2 /MD /D_VBOOTSTRAP vc\v_win.c user32.lib kernel32.lib advapi32.lib shell32.lib /link /nologo /out:v.exe /incremental:no>>"!log_file!"
if %ERRORLEVEL% NEQ 0 ( if %ERRORLEVEL% NEQ 0 (
REM In some cases, compile errors happen because of the MSVC compiler version REM In some cases, compile errors happen because of the MSVC compiler version
cl.exe 1>NUL 2>"!log_file!" cl.exe 2>"!log_file!"
goto :compile_error goto :compile_error
) )
@ -300,14 +300,14 @@ if %ERRORLEVEL% NEQ 0 goto :compile_error
goto :success goto :success
:download_tcc :download_tcc
pushd %tcc_dir% 2>NUL && ( pushd %tcc_dir% && (
echo Updating TCC echo Updating TCC
echo ^> Syncing TCC from !tcc_url! echo ^> Syncing TCC from !tcc_url!
if !flag_verbose! EQU 1 ( if !flag_verbose! EQU 1 (
echo [Debug] git pull --quiet>>"!log_file!" echo [Debug] git pull --quiet>>"!log_file!"
echo git pull --quiet echo git pull --quiet
) )
git pull --quiet>>"!log_file!" 2>NUL git pull --quiet>>"!log_file!"
popd popd
) || call :bootstrap_tcc ) || call :bootstrap_tcc
@ -322,7 +322,7 @@ exit /b 0
:compile_error :compile_error
echo. echo.
type "!log_file!">NUL 2>&1 type "!log_file!"
goto :error goto :error
:error :error
@ -416,7 +416,7 @@ if !flag_verbose! EQU 1 (
echo [Debug] git clone --depth 1 --quiet --single-branch --branch !tcc_branch! !tcc_url! "%tcc_dir%">>"!log_file!" echo [Debug] git clone --depth 1 --quiet --single-branch --branch !tcc_branch! !tcc_url! "%tcc_dir%">>"!log_file!"
echo git clone --depth 1 --quiet --single-branch --branch !tcc_branch! !tcc_url! "%tcc_dir%" echo git clone --depth 1 --quiet --single-branch --branch !tcc_branch! !tcc_url! "%tcc_dir%"
) )
git clone --depth 1 --quiet --single-branch --branch !tcc_branch! !tcc_url! "%tcc_dir%">>"!log_file!" 2>NUL git clone --depth 1 --quiet --single-branch --branch !tcc_branch! !tcc_url! "%tcc_dir%">>"!log_file!"
exit /b 0 exit /b 0
:cloning_vc :cloning_vc
@ -426,7 +426,7 @@ if !flag_verbose! EQU 1 (
echo [Debug] git clone --depth 1 --quiet %vc_url%>>"!log_file!" echo [Debug] git clone --depth 1 --quiet %vc_url%>>"!log_file!"
echo git clone --depth 1 --quiet %vc_url% echo git clone --depth 1 --quiet %vc_url%
) )
git clone --depth 1 --quiet %vc_url%>>"!log_file!" 2>NUL git clone --depth 1 --quiet %vc_url%>>"!log_file!"
exit /b 0 exit /b 0
:eof :eof