Skip to content

Commit

Permalink
build: drop support for Visual Studio 2019
Browse files Browse the repository at this point in the history
V8 and Chromium are starting to use C++20 features.
Only Visual Studio 2022 17.6 includes a version of MSVC
with sufficient C++20 support to compile V8.

Refs: https://bugs.chromium.org/p/chromium/issues/detail?id=1284275
Refs: #45427
  • Loading branch information
targos committed Aug 7, 2023
1 parent d150316 commit da86003
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 46 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
if: github.event.pull_request.draft == false
strategy:
matrix:
windows: [windows-2019, windows-2022]
windows: [windows-2022]
fail-fast: false
runs-on: ${{ matrix.windows }}
steps:
Expand Down
16 changes: 8 additions & 8 deletions BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ Depending on the host platform, the selection of toolchains may vary.
| Operating System | Compiler Versions |
| ---------------- | -------------------------------------------------------------- |
| Linux | GCC >= 10.1 |
| Windows | Visual Studio >= 2019 with the Windows 10 SDK on a 64-bit host |
| Windows | Visual Studio >= 2022 with the Windows 10 SDK on a 64-bit host |
| macOS | Xcode >= 11 (Apple LLVM >= 11) |

### Official binary platforms and toolchains
Expand All @@ -170,7 +170,7 @@ Binaries at <https://nodejs.org/download/release/> are produced on:
| linux-ppc64le | RHEL 8 with gcc-toolset-10[^6] |
| linux-s390x | RHEL 8 with gcc-toolset-10[^6] |
| linux-x64 | RHEL 8 with gcc-toolset-10[^6] |
| win-x64 and win-x86 | Windows 2012 R2 (x64) with Visual Studio 2019 |
| win-x64 and win-x86 | Windows Server 2022 (x64) with Visual Studio 2022 |

[^6]: Binaries produced on these systems are compatible with glibc >= 2.28
and libstdc++ >= 6.0.25 (`GLIBCXX_3.4.25`). These are available on
Expand Down Expand Up @@ -576,9 +576,9 @@ to run it again before invoking `make -j4`.

* [Python 3.11](https://apps.microsoft.com/store/detail/python-311/9NRWMJP3717K)
* The "Desktop development with C++" workload from
[Visual Studio 2019](https://visualstudio.microsoft.com/vs/older-downloads/#visual-studio-2019-and-other-products) or
[Visual Studio 2022](https://visualstudio.microsoft.com/downloads/) or
the "C++ build tools" workload from the
[Build Tools](https://aka.ms/vs/16/release/vs_buildtools.exe),
[Build Tools](https://aka.ms/vs/17/release/vs_buildtools.exe),
with the default optional components
* Basic Unix tools required for some tests,
[Git for Windows](https://git-scm.com/download/win) includes Git Bash
Expand All @@ -590,11 +590,11 @@ to run it again before invoking `make -j4`.

Optional requirements to build the MSI installer package:

* The .NET SDK component from [Visual Studio 2019](https://visualstudio.microsoft.com/vs/older-downloads/#visual-studio-2019-and-other-products)
* The .NET SDK component from [Visual Studio 2022](https://visualstudio.microsoft.com/downloads/)

Optional requirements for compiling for Windows 10 on ARM (ARM64):

* Visual Studio 15.9.0 or newer
* Visual Studio 17.6.0 or newer
* Visual Studio optional components
* Visual C++ compilers and libraries for ARM64
* Visual C++ ATL for ARM64
Expand All @@ -610,8 +610,8 @@ packages:
* [Git for Windows](https://chocolatey.org/packages/git) with the `git` and
Unix tools added to the `PATH`
* [Python 3.x](https://chocolatey.org/packages/python)
* [Visual Studio 2019 Build Tools](https://chocolatey.org/packages/visualstudio2019buildtools)
with [Visual C++ workload](https://chocolatey.org/packages/visualstudio2019-workload-vctools)
* [Visual Studio 2022 Build Tools](https://chocolatey.org/packages/visualstudio2022buildtools)
with [Visual C++ workload](https://chocolatey.org/packages/visualstudio2022-workload-vctools)
* [NetWide Assembler](https://chocolatey.org/packages/nasm)

To install Node.js prerequisites using
Expand Down
6 changes: 3 additions & 3 deletions tools/bootstrap/windows_boxstarter
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
choco install git -params /GitAndUnixToolsOnPath -y
choco install python python2 -y

# Installs VS 2019 Build Tools
choco install visualstudio2019buildtools -y
choco install visualstudio2019-workload-vctools -y --params="--add Microsoft.VisualStudio.Component.VC.Tools.ARM64 --add Microsoft.VisualStudio.Component.VC.ATL.ARM64"
# Installs VS 2022 Build Tools
choco install visualstudio2022buildtools -y
choco install visualstudio2022-workload-vctools -y --params="--add Microsoft.VisualStudio.Component.VC.Tools.ARM64 --add Microsoft.VisualStudio.Component.VC.ATL.ARM64"

# NASM
choco install nasm -y
39 changes: 5 additions & 34 deletions vcbuild.bat
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ if /i "%1"=="ia32" set target_arch=x86&goto arg-ok
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"=="arm64" set target_arch=arm64&goto arg-ok
if /i "%1"=="vs2019" set target_env=vs2019&goto arg-ok
if /i "%1"=="vs2022" set target_env=vs2022&goto arg-ok
if /i "%1"=="noprojgen" set noprojgen=1&goto arg-ok
if /i "%1"=="projgen" set projgen=1&goto arg-ok
Expand Down Expand Up @@ -176,7 +175,6 @@ if defined package set stage_package=1
set "node_exe=%config%\node.exe"
set "node_gyp_exe="%node_exe%" deps\npm\node_modules\node-gyp\bin\node-gyp"
set "npm_exe="%~dp0%node_exe%" %~dp0deps\npm\bin\npm-cli.js"
if "%target_env%"=="vs2019" set "node_gyp_exe=%node_gyp_exe% --msvs_version=2019"
if "%target_env%"=="vs2022" set "node_gyp_exe=%node_gyp_exe% --msvs_version=2022"

:: skip building if the only argument received was lint
Expand Down Expand Up @@ -246,14 +244,14 @@ if %target_arch%==%msvs_host_arch% set vcvarsall_arg=%target_arch%

@rem Look for Visual Studio 2022
:vs-set-2022
if defined target_env if "%target_env%" NEQ "vs2022" goto vs-set-2019
if defined target_env if "%target_env%" NEQ "vs2022" goto msbuild-not-found
echo Looking for Visual Studio 2022
@rem VCINSTALLDIR may be set if run from a VS Command Prompt and needs to be
@rem cleared first as vswhere_usability_wrapper.cmd doesn't when it fails to
@rem detect the version searched for
if not defined target_env set "VCINSTALLDIR="
call tools\msvs\vswhere_usability_wrapper.cmd "[17.0,18.0)" %target_arch% "prerelease"
if "_%VCINSTALLDIR%_" == "__" goto vs-set-2019
call tools\msvs\vswhere_usability_wrapper.cmd "[17.6,18.0)" %target_arch% "prerelease"
if "_%VCINSTALLDIR%_" == "__" goto msbuild-not-found
@rem check if VS2022 is already setup, and for the requested arch
if "_%VisualStudioVersion%_" == "_17.0_" if "_%VSCMD_ARG_TGT_ARCH%_"=="_%target_arch%_" goto found_vs2022
@rem need to clear VSINSTALLDIR for vcvarsall to work as expected
Expand All @@ -263,41 +261,14 @@ set "VSCMD_START_DIR=%CD%"
set vcvars_call="%VCINSTALLDIR%\Auxiliary\Build\vcvarsall.bat" %vcvarsall_arg%
echo calling: %vcvars_call%
call %vcvars_call%
if errorlevel 1 goto vs-set-2019
if errorlevel 1 goto msbuild-not-found
if defined DEBUG_HELPER @ECHO ON
:found_vs2022
echo Found MSVS version %VisualStudioVersion%
set GYP_MSVS_VERSION=2022
set PLATFORM_TOOLSET=v143
goto msbuild-found

@rem Look for Visual Studio 2019
:vs-set-2019
if defined target_env if "%target_env%" NEQ "vs2019" goto msbuild-not-found
echo Looking for Visual Studio 2019
@rem VCINSTALLDIR may be set if run from a VS Command Prompt and needs to be
@rem cleared first as vswhere_usability_wrapper.cmd doesn't when it fails to
@rem detect the version searched for
if not defined target_env set "VCINSTALLDIR="
call tools\msvs\vswhere_usability_wrapper.cmd "[16.0,17.0)" %target_arch% "prerelease"
if "_%VCINSTALLDIR%_" == "__" goto msbuild-not-found
@rem check if VS2019 is already setup, and for the requested arch
if "_%VisualStudioVersion%_" == "_16.0_" if "_%VSCMD_ARG_TGT_ARCH%_"=="_%target_arch%_" goto found_vs2019
@rem need to clear VSINSTALLDIR for vcvarsall to work as expected
set "VSINSTALLDIR="
@rem prevent VsDevCmd.bat from changing the current working directory
set "VSCMD_START_DIR=%CD%"
set vcvars_call="%VCINSTALLDIR%\Auxiliary\Build\vcvarsall.bat" %vcvarsall_arg%
echo calling: %vcvars_call%
call %vcvars_call%
if errorlevel 1 goto msbuild-not-found
if defined DEBUG_HELPER @ECHO ON
:found_vs2019
echo Found MSVS version %VisualStudioVersion%
set GYP_MSVS_VERSION=2019
set PLATFORM_TOOLSET=v142
goto msbuild-found

:msbuild-not-found
echo Failed to find a suitable Visual Studio installation.
echo Try to run in a "Developer Command Prompt" or consult
Expand Down Expand Up @@ -740,7 +711,7 @@ set exit_code=1
goto exit

:help
echo vcbuild.bat [debug/release] [msi] [doc] [test/test-all/test-addons/test-doc/test-js-native-api/test-node-api/test-internet/test-tick-processor/test-known-issues/test-node-inspect/test-check-deopts/test-npm/test-v8/test-v8-intl/test-v8-benchmarks/test-v8-all] [ignore-flaky] [static/dll] [noprojgen] [projgen] [small-icu/full-icu/without-intl] [nobuild] [nosnapshot] [nonpm] [nocorepack] [ltcg] [licensetf] [sign] [ia32/x86/x64/arm64] [vs2019/vs2022] [download-all] [enable-vtune] [lint/lint-ci/lint-js/lint-md] [lint-md-build] [package] [build-release] [upload] [no-NODE-OPTIONS] [link-module path-to-module] [debug-http2] [debug-nghttp2] [clean] [cctest] [no-cctest] [openssl-no-asm]
echo vcbuild.bat [debug/release] [msi] [doc] [test/test-all/test-addons/test-doc/test-js-native-api/test-node-api/test-internet/test-tick-processor/test-known-issues/test-node-inspect/test-check-deopts/test-npm/test-v8/test-v8-intl/test-v8-benchmarks/test-v8-all] [ignore-flaky] [static/dll] [noprojgen] [projgen] [small-icu/full-icu/without-intl] [nobuild] [nosnapshot] [nonpm] [nocorepack] [ltcg] [licensetf] [sign] [ia32/x86/x64/arm64] [vs2022] [download-all] [enable-vtune] [lint/lint-ci/lint-js/lint-md] [lint-md-build] [package] [build-release] [upload] [no-NODE-OPTIONS] [link-module path-to-module] [debug-http2] [debug-nghttp2] [clean] [cctest] [no-cctest] [openssl-no-asm]
echo Examples:
echo vcbuild.bat : builds release build
echo vcbuild.bat debug : builds debug build
Expand Down

0 comments on commit da86003

Please sign in to comment.