Uh oh!
There was an error while loading. Please reload this page.
win, build: generate .sln only when necessary - #21284
Conversation
When generating sln, store flags passed to configure. Next time, if node.sln exists and configure flags match those stored, skip building .sln files. Adds forceprojgen vcbuild option to force .sln regeneration.
nodejs-github-bot
commented
Jun 12, 2018
@bzoz sadly an error occured when I tried to trigger a build :( |
bzoz
commented
Jun 13, 2018
| if /i "%1"=="x64" set target_arch=x64&goto arg-ok | ||
| if /i "%1"=="vs2017" set target_env=vs2017&goto arg-ok | ||
| if /i "%1"=="noprojgen" set noprojgen=1&goto arg-ok | ||
| if /i "%1"=="forceprojgen" set forceprojgen=1&goto arg-ok |
There was a problem hiding this comment.
maybe projgen? so it goes as a pair projgen/noprojgen
| :project-gen | ||
| @rem Skip project generation if requested. | ||
| if defined noprojgen goto msbuild | ||
| SETLOCAL EnableDelayedExpansion |
There was a problem hiding this comment.
If this is only needed for L262 & L263, could this be moved there? Otherwise I can see this giving someone a headache in the future.
SETLOCALEnableDelayedExpansionset /p prev_configure_flags=<used_configure_flags
ifNOT!prev_configure_flags!==!configure_flags!ENDLOCAL&goto run-configure| ENDLOCAL | ||
| @rem Generate the VS project. | ||
| echo configure %configure_flags% | ||
| echo %configure_flags%> used_configure_flags |
There was a problem hiding this comment.
Can we rename the tmp file .used_configure_flags. I know this is not *nix, but git will exclude it by default, and Windows will at least group it together with the rest of the settings/temporary files.
refack
commented
Jun 13, 2018
Great idea! /CC @nodejs/build-files @nodejs/platform-windows @zcbenz |
seishun
commented
Jun 13, 2018
What's the cost of always regenerating .sln files? |
refack
commented
Jun 13, 2018
From my POV:
|
bzoz
commented
Jun 13, 2018
@refack: updated with your comments, PTAL Also, project files will always be generated for |
refack
commented
Jun 13, 2018
I'm thinking as a follow up PR to move this logic to |
richardlau
commented
Jun 13, 2018
I'd much prefer this. With this PR as it stands if you tweak a |
Time.... Also
Don't! |
refack
commented
Jun 13, 2018
A very rough sketch: diff --git a/vcbuild.bat b/vcbuild.bat
index 717950bee9..a9ff3a423a 100644
--- a/vcbuild.bat+++ b/vcbuild.bat@@ -258,20 +258,22 @@ goto build-doc
if defined noprojgen goto skip-configure
if defined projgen goto run-configure
if not exist node.sln goto run-configure
-if not exist .used_configure_flags goto run-configure-SETLOCAL EnableDelayedExpansion-set /p prev_configure_flags=<.used_configure_flags-if NOT !prev_configure_flags! == !configure_flags! ENDLOCAL && goto run-configure-ENDLOCAL+if not exist .gyp_configure_stamp goto run-configure+where /R . /T *.gyp? > .tmp_gyp_configure+echo %configure_flags% >> .tmp_gyp_configure+fc .gyp_configure_stamp .tmp_gyp_configure > NUL+if ERRORLEVEL 1 goto run-configure
:skip-configure
-echo Reusing solution generated with %prev_configure_flags%+del .tmp_gyp_configure+echo Reusing solution generated with '%prev_configure_flags%'
goto msbuild
:run-configure
@rem Generate the VS project.
echo configure %configure_flags%
-echo %configure_flags%> .used_configure_flags+where /R . /T *.gyp? > .gyp_configure_stamp+echo %configure_flags% >> .gyp_configure_stamp
python configure %configure_flags%
if errorlevel 1 goto create-msvs-files-failed
if not exist node.sln goto create-msvs-files-failedUnfortunately I can't test this ATM |
bzoz
commented
Jun 14, 2018
Added a warning message that is displayed after build fails with reused solution files: Building Node with reused solution failed. To regenerate project files use "vcbuild projgen" |
addaleax
commented
Jun 14, 2018
BridgeAR
commented
Jun 18, 2018
Is this ready to land? |
bzoz
commented
Jun 20, 2018
bzoz
commented
Jun 21, 2018
@refack idea worked out great, added it to the PR. PTAL. |
bzoz
commented
Jun 26, 2018
bzoz
commented
Jun 26, 2018
landed in 4dece04 |
When generating sln, store flags passed to configure. Next time, if node.sln exists and configure flags match those stored, skip building .sln files. Adds projgen vcbuild option to force .sln regeneration. PR-URL: #21284 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
When generating sln, store flags passed to configure. Next time, if node.sln exists and configure flags match those stored, skip building .sln files. Adds projgen vcbuild option to force .sln regeneration. PR-URL: #21284 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
When generating project files, store flags passed to
configure. Next time, ifnode.slnexists and configure flags match those stored, skip building.slnfiles.Adds
forceprojgenvcbuild option to force project files regeneration.Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes