From 5acc69cdad3c8f1670f5eeeaa4c8ffa8b86bf6b3 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Mon, 17 Aug 2020 14:37:42 +0200 Subject: [PATCH 1/7] doc: move addaleax to TSC emeritus MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/34809 Reviewed-By: Richard Lau Reviewed-By: Colin Ihrig Reviewed-By: Matteo Collina Reviewed-By: Gireesh Punathil Reviewed-By: Trivikram Kamat Reviewed-By: Michaël Zasso Reviewed-By: Shelley Vohr Reviewed-By: Franziska Hinkelmann Reviewed-By: Tobias Nießen Reviewed-By: Yuta Hiroto Reviewed-By: Jiawen Geng Reviewed-By: Ricky Zhou <0x19951125@gmail.com> Reviewed-By: Khaidi Chu Reviewed-By: Rich Trott Reviewed-By: Michael Dawson --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) - From 03293aa3a1e810c5ae6938cae41bf62ae418bb5f Mon Sep 17 00:00:00 2001 From: Dennis Ameling Date: Mon, 22 Jun 2020 11:22:42 +0200 Subject: [PATCH 2/7] build,win: use x64 Node when building for ARM64 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Uses x64 node executable for running .js files in arm64 cross-compilation scenarios. MSI can now be created by running `vcbuild.bat release msi arm64` Refs: https://github.com/nodejs/node/issues/25998 Refs: https://github.com/nodejs/node/issues/32582 PR-URL: https://github.com/nodejs/node/pull/34009 Reviewed-By: James M Snell Reviewed-By: João Reis --- .gitignore | 3 +++ BUILDING.md | 2 ++ vcbuild.bat | 21 ++++++++++++++++++++- 3 files changed, 25 insertions(+), 1 deletion(-) 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..00f45ccc7792b0 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -544,6 +544,8 @@ 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). +* 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): 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 From de565ad1b2de6d173a9ea5e1932e3d85472d4c23 Mon Sep 17 00:00:00 2001 From: Bartosz Sosnowski Date: Wed, 22 Jul 2020 12:55:11 +0200 Subject: [PATCH 3/7] process: correctly parse Unicode in NODE_OPTIONS Fixes an issue on Windows, where Unicode in NODE_OPTIONS was not parsed correctly. Fixes: https://github.com/nodejs/node/issues/34399 PR-URL: https://github.com/nodejs/node/pull/34476 Reviewed-By: Anna Henningsen Reviewed-By: James M Snell Reviewed-By: Gus Caplan Reviewed-By: Denys Otrishko --- src/node_credentials.cc | 16 +++++++++++-- test/parallel/test-unicode-node-options.js | 26 ++++++++++++++++++++++ 2 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 test/parallel/test-unicode-node-options.js 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-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); +} From 6130cdd190eaf334c8a12185b7ffa02ae25a88d6 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Sun, 16 Aug 2020 10:33:39 -0700 Subject: [PATCH 4/7] test: run REPL preview test regardless of terminal type PR-URL: https://github.com/nodejs/node/pull/34798 Reviewed-By: Ruben Bridgewater Reviewed-By: James M Snell Reviewed-By: Mary Marchini --- test/parallel/test-repl-preview.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 { From 9d81d1266cc6062418812357115cd647a473bfbc Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Wed, 19 Aug 2020 18:29:42 -0700 Subject: [PATCH 5/7] doc: sort references lexically Keep references sorted in ASCII order in module.md. PR-URL: https://github.com/nodejs/node/pull/34848 Reviewed-By: Daijiro Wachi Reviewed-By: James M Snell Reviewed-By: Ricky Zhou <0x19951125@gmail.com> --- doc/api/module.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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 From 9fd71a9964a9fdfd3647ae99097e10df634bb1ed Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Wed, 19 Aug 2020 19:16:44 -0700 Subject: [PATCH 6/7] doc: fix bulleted list punctuation in BUILDING.md Remove/add periods as appropriate in bulleted lists in BUILDING.md. PR-URL: https://github.com/nodejs/node/pull/34849 Reviewed-By: James M Snell Reviewed-By: Ricky Zhou <0x19951125@gmail.com> --- BUILDING.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/BUILDING.md b/BUILDING.md index 00f45ccc7792b0..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,9 +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). + building for Windows 10 on ARM (ARM64) Optional requirements for compiling for Windows 10 on ARM (ARM64): @@ -563,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) From 796317fb6552053846a96d02d6b36113cb7accc6 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Mon, 17 Aug 2020 22:33:22 -0700 Subject: [PATCH 7/7] test: fix test-cluster-net-listen-relative-path.js to run in / test-cluster-net-listen-relative-path fails if run from the root directory on POSIX because the socket filename isn't quite long enough. Increase it by 2 so that the path length always exceeds 100 characters. PR-URL: https://github.com/nodejs/node/pull/34820 Reviewed-By: Anna Henningsen Reviewed-By: James M Snell Reviewed-By: Ricky Zhou <0x19951125@gmail.com> --- test/parallel/test-cluster-net-listen-relative-path.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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,