Skip to content
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

win, build: generate .sln only when necessary #21284

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ ipch/
/deps/v8/src/debug/obj
/*.exe

used_configure_flags

/config.mk
/config.gypi
/config_fips.gypi
Expand Down
21 changes: 19 additions & 2 deletions vcbuild.bat
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ set target=Build
set target_arch=x64
set target_env=
set noprojgen=
set forceprojgen=
set nobuild=
set sign=
set nosnapshot=
Expand Down Expand Up @@ -67,6 +68,7 @@ if /i "%1"=="x86" set target_arch=x86&goto arg-ok
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe projgen? so it goes as a pair projgen/noprojgen

if /i "%1"=="nobuild" set nobuild=1&goto arg-ok
if /i "%1"=="nosign" set "sign="&echo Note: vcbuild no longer signs by default. "nosign" is redundant.&goto arg-ok
if /i "%1"=="sign" set sign=1&goto arg-ok
Expand Down Expand Up @@ -252,10 +254,24 @@ goto build-doc

:project-gen
@rem Skip project generation if requested.
if defined noprojgen goto msbuild
SETLOCAL EnableDelayedExpansion
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

SETLOCAL EnableDelayedExpansion
set /p prev_configure_flags=<used_configure_flags
if NOT !prev_configure_flags! == !configure_flags! ENDLOCAL & goto run-configure

if defined noprojgen goto skip-configure
if defined forceprojgen goto run-configure
if not exist node.sln goto run-configure
if not exist used_configure_flags goto run-configure
set /p prev_configure_flags=<used_configure_flags
if NOT !prev_configure_flags! == !configure_flags! goto run-configure

:skip-configure
ENDLOCAL
echo Reusing solution generated with %prev_configure_flags%
goto msbuild

:run-configure
ENDLOCAL
@rem Generate the VS project.
echo configure %configure_flags%
echo %configure_flags%> used_configure_flags
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

python configure %configure_flags%
if errorlevel 1 goto create-msvs-files-failed
if not exist node.sln goto create-msvs-files-failed
Expand Down Expand Up @@ -626,10 +642,11 @@ goto exit

:create-msvs-files-failed
echo Failed to create vc project files.
del used_configure_flags
goto exit

:help
echo vcbuild.bat [debug/release] [msi] [doc] [test/test-ci/test-all/test-addons/test-addons-napi/test-internet/test-pummel/test-simple/test-message/test-gc/test-tick-processor/test-known-issues/test-node-inspect/test-check-deopts/test-npm/test-async-hooks/test-v8/test-v8-intl/test-v8-benchmarks/test-v8-all] [ignore-flaky] [static/dll] [noprojgen] [small-icu/full-icu/without-intl] [nobuild] [nosnapshot] [noetw] [noperfctr] [licensetf] [sign] [ia32/x86/x64] [vs2017] [download-all] [enable-vtune] [lint/lint-ci/lint-js/lint-js-ci/lint-md] [lint-md-build] [package] [build-release] [upload] [no-NODE-OPTIONS] [link-module path-to-module] [debug-http2] [debug-nghttp2] [clean] [no-cctest] [openssl-no-asm]
echo vcbuild.bat [debug/release] [msi] [doc] [test/test-ci/test-all/test-addons/test-addons-napi/test-internet/test-pummel/test-simple/test-message/test-gc/test-tick-processor/test-known-issues/test-node-inspect/test-check-deopts/test-npm/test-async-hooks/test-v8/test-v8-intl/test-v8-benchmarks/test-v8-all] [ignore-flaky] [static/dll] [noprojgen] [forceprojgen] [small-icu/full-icu/without-intl] [nobuild] [nosnapshot] [noetw] [noperfctr] [licensetf] [sign] [ia32/x86/x64] [vs2017] [download-all] [enable-vtune] [lint/lint-ci/lint-js/lint-js-ci/lint-md] [lint-md-build] [package] [build-release] [upload] [no-NODE-OPTIONS] [link-module path-to-module] [debug-http2] [debug-nghttp2] [clean] [no-cctest] [openssl-no-asm]
echo Examples:
echo vcbuild.bat : builds release build
echo vcbuild.bat debug : builds debug build
Expand Down