diff --git a/.gitignore b/.gitignore index 55152e1317f0ad..65caf766e9319d 100644 --- a/.gitignore +++ b/.gitignore @@ -131,6 +131,9 @@ _UpgradeReport_Files/ # Ignore dependencies fetched by deps/v8/tools/node/fetch_deps.py /deps/.cipd +# === Rules for Windows vcbuild.bat === +/temp-vcbuild + # === Global Rules === # Keep last to avoid being excluded *.pyc diff --git a/BUILDING.md b/BUILDING.md index bdf74da21fb424..779313e5669820 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -237,7 +237,7 @@ test with Python 3. * GNU Make 3.81 or newer * Python (see note above) * Python 2.7 - * Python 3.5, 3.6, 3.7, and 3.8. + * Python 3.5, 3.6, 3.7, and 3.8 Installation via Linux package manager can be achieved with: @@ -256,7 +256,7 @@ Python 3 users may also need to install `python3-distutils`. * Xcode Command Line Tools >= 10 for macOS * Python (see note above) * Python 2.7 - * Python 3.5, 3.6, 3.7, and 3.8. + * Python 3.5, 3.6, 3.7, and 3.8 macOS users can install the `Xcode Command Line Tools` by running `xcode-select --install`. Alternatively, if you already have the full Xcode @@ -531,7 +531,7 @@ to run it again before invoking `make -j4`. [Visual Studio 2019](https://visualstudio.microsoft.com/downloads/) or the "Visual C++ build tools" workload from the [Build Tools](https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2019), - with the default optional components. + with the default optional components * Basic Unix tools required for some tests, [Git for Windows](https://git-scm.com/download/win) includes Git Bash and tools which can be included in the global `PATH`. @@ -543,7 +543,9 @@ to run it again before invoking `make -j4`. Optional requirements to build the MSI installer package: * The [WiX Toolset v3.11](https://wixtoolset.org/releases/) and the - [Wix Toolset Visual Studio 2019 Extension](https://marketplace.visualstudio.com/items?itemName=WixToolset.WixToolsetVisualStudio2019Extension). + [Wix Toolset Visual Studio 2019 Extension](https://marketplace.visualstudio.com/items?itemName=WixToolset.WixToolsetVisualStudio2019Extension) +* The [WiX Toolset v3.14](https://wixtoolset.org/releases/) if + building for Windows 10 on ARM (ARM64) Optional requirements for compiling for Windows 10 on ARM (ARM64): @@ -561,7 +563,7 @@ This script will install the following [Chocolatey](https://chocolatey.org/) packages: * [Git for Windows](https://chocolatey.org/packages/git) with the `git` and - Unix tools added to the `PATH`. + Unix tools added to the `PATH` * [Python 3.x](https://chocolatey.org/packages/python) and [legacy Python](https://chocolatey.org/packages/python2) * [Visual Studio 2019 Build Tools](https://chocolatey.org/packages/visualstudio2019buildtools) diff --git a/README.md b/README.md index 75ecb02a2b85e0..6e3a1d80be11d0 100644 --- a/README.md +++ b/README.md @@ -153,8 +153,6 @@ For information about the governance of the Node.js project, see ### TSC (Technical Steering Committee) -* [addaleax](https://github.com/addaleax) - -**Anna Henningsen** <anna@addaleax.net> (she/her) * [apapirovski](https://github.com/apapirovski) - **Anatoli Papirovski** <apapirovski@mac.com> (he/him) * [BethGriggs](https://github.com/BethGriggs) - @@ -196,6 +194,8 @@ For information about the governance of the Node.js project, see ### TSC Emeriti +* [addaleax](https://github.com/addaleax) - +**Anna Henningsen** <anna@addaleax.net> (she/her) * [bnoordhuis](https://github.com/bnoordhuis) - **Ben Noordhuis** <info@bnoordhuis.nl> * [chrisdickinson](https://github.com/chrisdickinson) - diff --git a/doc/api/module.md b/doc/api/module.md index 98bc8e82f95247..46eafeb7b622bd 100644 --- a/doc/api/module.md +++ b/doc/api/module.md @@ -184,11 +184,11 @@ consists of the following keys: * originalLine: {number} * originalColumn: {number} -[`createRequire()`]: #module_module_createrequire_filename -[module wrapper]: modules_cjs.html#modules_cjs_the_module_wrapper -[source map include directives]: https://sourcemaps.info/spec.html#h.lmz475t4mvbx +[Source map v3 format]: https://sourcemaps.info/spec.html#h.mofvlxcwqzej [`--enable-source-maps`]: cli.html#cli_enable_source_maps -[`NODE_V8_COVERAGE=dir`]: cli.html#cli_node_v8_coverage_dir [`Error.prepareStackTrace(error, trace)`]: https://v8.dev/docs/stack-trace-api#customizing-stack-traces +[`NODE_V8_COVERAGE=dir`]: cli.html#cli_node_v8_coverage_dir [`SourceMap`]: #module_class_module_sourcemap -[Source map v3 format]: https://sourcemaps.info/spec.html#h.mofvlxcwqzej +[`createRequire()`]: #module_module_createrequire_filename +[module wrapper]: modules_cjs.html#modules_cjs_the_module_wrapper +[source map include directives]: https://sourcemaps.info/spec.html#h.lmz475t4mvbx diff --git a/src/node_credentials.cc b/src/node_credentials.cc index acc48cac3c90ef..fa3dfa48a3ceb2 100644 --- a/src/node_credentials.cc +++ b/src/node_credentials.cc @@ -57,8 +57,20 @@ bool SafeGetenv(const char* key, std::string* text, Environment* env) { { Mutex::ScopedLock lock(per_process::env_var_mutex); - if (const char* value = getenv(key)) { - *text = value; + + size_t init_sz = 256; + MaybeStackBuffer val; + int ret = uv_os_getenv(key, *val, &init_sz); + + if (ret == UV_ENOBUFS) { + // Buffer is not large enough, reallocate to the updated init_sz + // and fetch env value again. + val.AllocateSufficientStorage(init_sz); + ret = uv_os_getenv(key, *val, &init_sz); + } + + if (ret >= 0) { // Env key value fetch success. + *text = *val; return true; } } diff --git a/test/parallel/test-cluster-net-listen-relative-path.js b/test/parallel/test-cluster-net-listen-relative-path.js index 0e1c3f7cf7cf4a..76676b2902730b 100644 --- a/test/parallel/test-cluster-net-listen-relative-path.js +++ b/test/parallel/test-cluster-net-listen-relative-path.js @@ -17,7 +17,7 @@ const tmpdir = require('../common/tmpdir'); // Choose a socket name such that the absolute path would exceed 100 bytes. const socketDir = './unix-socket-dir'; -const socketName = 'A'.repeat(100 - socketDir.length - 1); +const socketName = 'A'.repeat(101 - socketDir.length); // Make sure we're not in a weird environment. assert.ok(path.resolve(socketDir, socketName).length > 100, diff --git a/test/parallel/test-repl-preview.js b/test/parallel/test-repl-preview.js index 02c1ec31cd5020..b0159bfd646a82 100644 --- a/test/parallel/test-repl-preview.js +++ b/test/parallel/test-repl-preview.js @@ -7,8 +7,9 @@ const { Stream } = require('stream'); const { inspect } = require('util'); common.skipIfInspectorDisabled(); -common.skipIfDumbTerminal(); +// Ignore terminal settings. This is so the test can be run intact if TERM=dumb. +process.env.TERM = ''; const PROMPT = 'repl > '; class REPLStream extends Stream { diff --git a/test/parallel/test-unicode-node-options.js b/test/parallel/test-unicode-node-options.js new file mode 100644 index 00000000000000..e5a40d118791d3 --- /dev/null +++ b/test/parallel/test-unicode-node-options.js @@ -0,0 +1,26 @@ +'use strict'; +// Flags: --expose-internals +require('../common'); +const { getOptionValue } = require('internal/options'); +const assert = require('assert'); +const cp = require('child_process'); + +const expected_redirect_value = 'foó'; + +if (process.argv.length === 2) { + const NODE_OPTIONS = `--redirect-warnings=${expected_redirect_value}`; + const result = cp.spawnSync(process.argv0, + ['--expose-internals', __filename, 'test'], + { + env: { + ...process.env, + NODE_OPTIONS + }, + stdio: 'inherit' + }); + assert.strictEqual(result.status, 0); +} else { + const redirect_value = getOptionValue('--redirect-warnings'); + console.log(`--redirect-warings=${redirect_value}`); + assert.strictEqual(redirect_value, expected_redirect_value); +} diff --git a/vcbuild.bat b/vcbuild.bat index eb7bc0d74ec7b9..527de7ee39664e 100644 --- a/vcbuild.bat +++ b/vcbuild.bat @@ -362,7 +362,26 @@ if errorlevel 1 echo Failed to sign exe&goto exit @rem Skip license.rtf generation if not requested. if not defined licensertf goto stage_package -%node_exe% tools\license2rtf.js < LICENSE > %config%\license.rtf +set "use_x64_node_exe=false" +if "%target_arch%"=="arm64" if "%PROCESSOR_ARCHITECTURE%"=="AMD64" set "use_x64_node_exe=true" +if "%use_x64_node_exe%"=="true" ( + echo Cross-compilation to ARM64 detected. We'll use the x64 Node executable for license2rtf. + if not defined "%x64_node_exe%" set "x64_node_exe=temp-vcbuild\node-x64-cross-compiling.exe" + if not exist "%x64_node_exe%" ( + echo Downloading x64 node.exe... + if not exist "temp-vcbuild" mkdir temp-vcbuild + powershell -c "Invoke-WebRequest -Uri 'https://nodejs.org/dist/latest/win-x64/node.exe' -OutFile 'temp-vcbuild\node-x64-cross-compiling.exe'" + ) + if not exist "%x64_node_exe%" ( + echo Could not find the Node executable at the given x64_node_exe path. Aborting. + set exit_code=1 + goto exit + ) + %x64_node_exe% tools\license2rtf.js < LICENSE > %config%\license.rtf +) else ( + %node_exe% tools\license2rtf.js < LICENSE > %config%\license.rtf +) + if errorlevel 1 echo Failed to generate license.rtf&goto exit :stage_package