-
Notifications
You must be signed in to change notification settings - Fork 29.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build: better error message on python fail #17298
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,7 +53,7 @@ set nghttp2_debug= | |
set link_module= | ||
|
||
:next-arg | ||
if "%1"=="" goto args-done | ||
if "%1"=="" goto environment-validate | ||
if /i "%1"=="debug" set config=Debug&goto arg-ok | ||
if /i "%1"=="release" set config=Release&goto arg-ok | ||
if /i "%1"=="clean" set target=Clean&goto arg-ok | ||
|
@@ -125,8 +125,17 @@ shift | |
shift | ||
goto next-arg | ||
|
||
:args-done | ||
:environment-validate | ||
REM Make sure we can find python | ||
call :run-python --version > NUL 2>&1 | ||
if errorlevel 1 ( | ||
echo Could not find python2. More information can be found at | ||
echo https://github.com/nodejs/node/blob/master/BUILDING.md#windows-1 | ||
exit /b 1 | ||
) | ||
|
||
|
||
REM Shortcut for just linting (does not need python) | ||
if "%*"=="lint" ( | ||
goto lint-cpp | ||
) | ||
|
@@ -167,14 +176,14 @@ if "%i18n_arg%"=="without-intl" set configure_flags=%configure_flags% --without- | |
|
||
if defined config_flags set configure_flags=%configure_flags% %config_flags% | ||
|
||
if not "%target%"=="Clean" goto no-clean | ||
if not exist "%~dp0deps\icu" goto no-depsicu | ||
if "%target%"=="Clean" echo deleting %~dp0deps\icu | ||
if "%target%"=="Clean" rmdir /S /Q %~dp0deps\icu | ||
:no-depsicu | ||
|
||
call :getnodeversion || exit /b 1 | ||
|
||
if "%target%"=="Clean" rmdir /Q /S "%~dp0%config%\node-v%FULLVERSION%-win-%target_arch%" > nul 2> nul | ||
for /d %%I IN ("%~dp0%config%\node-v*") do rmdir /Q /S "%%I" | ||
:no-clean | ||
|
||
if defined noprojgen if defined nobuild if not defined sign if not defined msi goto licensertf | ||
|
||
|
@@ -354,6 +363,7 @@ if not defined msi goto run | |
|
||
:msibuild | ||
echo Building node-v%FULLVERSION%-%target_arch%.msi | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Isn't There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also in |
||
call :getnodeversion || exit /b 1 | ||
msbuild "%~dp0tools\msvs\msi\nodemsi.sln" /m /t:Clean,Build /p:PlatformToolset=%PLATFORM_TOOLSET% /p:GypMsvsVersion=%GYP_MSVS_VERSION% /p:Configuration=%config% /p:Platform=%target_arch% /p:NodeVersion=%NODE_VERSION% /p:FullVersion=%FULLVERSION% /p:DistTypeDir=%DISTTYPEDIR% %noetw_msi_arg% %noperfctr_msi_arg% /clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal /nologo | ||
if errorlevel 1 goto exit | ||
|
||
|
@@ -556,8 +566,13 @@ echo vcbuild.bat lint : runs the C++ and JavaScript linter | |
goto exit | ||
|
||
:run-python | ||
call tools\msvs\find_python.cmd | ||
if errorlevel 1 echo Could not find python2 & goto :exit | ||
IF NOT DEFINED DEBUG_HELPER ( | ||
call tools\msvs\find_python.cmd 1>NUL 2>&1 | ||
) ELSE ( | ||
call tools\msvs\find_python.cmd | ||
) | ||
if errorlevel 1 exit /b 1 | ||
|
||
set cmd1="%VCBUILD_PYTHON_LOCATION%" %* | ||
echo %cmd1% | ||
%cmd1% | ||
|
@@ -575,8 +590,6 @@ rem *************** | |
set NODE_VERSION= | ||
set TAG= | ||
set FULLVERSION= | ||
:: Call as subroutine for validation of python | ||
call :run-python tools\getnodeversion.py > nul | ||
for /F "tokens=*" %%i in ('"%VCBUILD_PYTHON_LOCATION%" tools\getnodeversion.py') do set NODE_VERSION=%%i | ||
if not defined NODE_VERSION ( | ||
echo Cannot determine current version of Node.js | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The next line uses
FULLVERSION
which is populated ingetnodeversion
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed by making the rmdir line more generic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
%TAG% is used in
project-gen
too.