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

test: fix test-cluster-net-listen-relative-path.js to run in / #34820

Merged
merged 7 commits into from
Aug 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 7 additions & 5 deletions BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand All @@ -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
Expand Down Expand Up @@ -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`.
Expand All @@ -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):

Expand All @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,6 @@ For information about the governance of the Node.js project, see
### TSC (Technical Steering Committee)

<!--lint disable prohibited-strings-->
* [addaleax](https://github.com/addaleax) -
**Anna Henningsen** &lt;[email protected]&gt; (she/her)
* [apapirovski](https://github.com/apapirovski) -
**Anatoli Papirovski** &lt;[email protected]&gt; (he/him)
* [BethGriggs](https://github.com/BethGriggs) -
Expand Down Expand Up @@ -196,6 +194,8 @@ For information about the governance of the Node.js project, see

### TSC Emeriti

* [addaleax](https://github.com/addaleax) -
**Anna Henningsen** &lt;[email protected]&gt; (she/her)
* [bnoordhuis](https://github.com/bnoordhuis) -
**Ben Noordhuis** &lt;[email protected]&gt;
* [chrisdickinson](https://github.com/chrisdickinson) -
Expand Down
10 changes: 5 additions & 5 deletions doc/api/module.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
16 changes: 14 additions & 2 deletions src/node_credentials.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<char, 256> 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;
}
}
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-cluster-net-listen-relative-path.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
3 changes: 2 additions & 1 deletion test/parallel/test-repl-preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
26 changes: 26 additions & 0 deletions test/parallel/test-unicode-node-options.js
Original file line number Diff line number Diff line change
@@ -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);
}
21 changes: 20 additions & 1 deletion vcbuild.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down