diff --git a/CPP_STYLE_GUIDE.md b/CPP_STYLE_GUIDE.md index 3bea5bb1075..3c552fc2bf2 100644 --- a/CPP_STYLE_GUIDE.md +++ b/CPP_STYLE_GUIDE.md @@ -1,5 +1,22 @@ # C++ Style Guide +## Table of Contents + +* [Left-leaning (C++ style) asterisks for pointer declarations](#left-leaning-c-style-asterisks-for-pointer-declarations) +* [2 spaces of indentation for blocks or bodies of conditionals](#2-spaces-of-indentation-for-blocks-or-bodies-of-conditionals) +* [4 spaces of indentation for statement continuations](#4-spaces-of-indentation-for-statement-continuations) +* [Align function arguments vertically](#align-function-arguments-vertically) +* [Initialization lists](#initialization-lists) +* [CamelCase for methods, functions and classes](#camelcase-for-methods-functions-and-classes) +* [snake\_case for local variables and parameters](#snake_case-for-local-variables-and-parameters) +* [snake\_case\_ for private class fields](#snake_case_-for-private-class-fields) +* [Space after `template`](#space-after-template) +* [Type casting](#type-casting) +* [Memory allocation](#memory-allocation) +* [`nullptr` instead of `NULL` or `0`](#nullptr-instead-of-null-or-0) +* [Do not include `*.h` if `*-inl.h` has already been included](#do-not-include-h-if--inlh-has-already-been-included) +* [Avoid throwing JavaScript errors in nested C++ methods](#avoid-throwing-javascript-errors-in-nested-c-methods) + Unfortunately, the C++ linter (based on [Google’s `cpplint`](https://github.com/google/styleguide)), which can be run explicitly via `make lint-cpp`, does not currently catch a lot of rules that are diff --git a/Makefile b/Makefile index 763e944e9b0..07e8a1e57c1 100644 --- a/Makefile +++ b/Makefile @@ -205,23 +205,18 @@ v8: tools/make-v8.sh $(MAKE) -C deps/v8 $(V8_ARCH).$(BUILDTYPE_LOWER) $(V8_BUILD_OPTIONS) -ifeq ($(NODE_TARGET_TYPE),static_library) test: all - $(MAKE) cctest -else -test: all - $(MAKE) build-addons - $(MAKE) build-addons-napi - $(MAKE) doc-only - $(MAKE) lint - $(MAKE) cctest + $(MAKE) -s build-addons + $(MAKE) -s build-addons-napi + $(MAKE) -s doc-only + $(MAKE) -s lint + $(MAKE) -s cctest $(PYTHON) tools/test.py --mode=release --flaky-tests=$(FLAKY_TESTS) -J \ $(CI_ASYNC_HOOKS) \ $(CI_JS_SUITES) \ $(CI_NATIVE_SUITES) \ $(CI_DOC) \ known_issues -endif # For a quick test, does not run linter or build doc test-only: all diff --git a/common.gypi b/common.gypi index 8639afadb75..eb21acfdfd0 100644 --- a/common.gypi +++ b/common.gypi @@ -69,9 +69,9 @@ 'V8_BASE': '<(PRODUCT_DIR)/libv8_base.a', }], ['openssl_fips != ""', { - 'OPENSSL_PRODUCT': 'libcrypto.a', + 'OPENSSL_PRODUCT': '<(STATIC_LIB_PREFIX)crypto<(STATIC_LIB_SUFFIX)', }, { - 'OPENSSL_PRODUCT': 'libopenssl.a', + 'OPENSSL_PRODUCT': '<(STATIC_LIB_PREFIX)openssl<(STATIC_LIB_SUFFIX)', }], ['OS=="mac"', { 'clang%': 1, diff --git a/configure b/configure index 37a33281c56..d1740290323 100755 --- a/configure +++ b/configure @@ -1512,8 +1512,6 @@ config = { 'BUILDTYPE': 'Debug' if options.debug else 'Release', 'USE_XCODE': str(int(options.use_xcode or 0)), 'PYTHON': sys.executable, - 'NODE_TARGET_TYPE': variables['node_target_type'] if options.enable_static \ - else '', } if options.prefix: diff --git a/doc/api/fs.md b/doc/api/fs.md index 06f889e47fb..c282b418d3b 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -2028,8 +2028,21 @@ changes: * `err` {Error} * `resolvedPath` {string|Buffer} -Asynchronous realpath(3). The `callback` gets two arguments `(err, -resolvedPath)`. May use `process.cwd` to resolve relative paths. +Asynchronously computes the canonical pathname by resolving `.`, `..` and +symbolic links. + +Note that "canonical" does not mean "unique": hard links and bind mounts can +expose a file system entity through many pathnames. + +This function behaves like realpath(3), with some exceptions: + +1. No case conversion is performed on case-insensitive file systems. + +2. The maximum number of symbolic links is platform-independent and generally + (much) higher than what the native realpath(3) implementation supports. + +The `callback` gets two arguments `(err, resolvedPath)`. May use `process.cwd` +to resolve relative paths. Only paths that can be converted to UTF8 strings are supported. @@ -2041,6 +2054,33 @@ the path returned will be passed as a `Buffer` object. *Note*: If `path` resolves to a socket or a pipe, the function will return a system dependent name for that object. +## fs.realpath.native(path[, options], callback) + + +* `path` {string|Buffer|URL} +* `options` {string|Object} + * `encoding` {string} **Default:** `'utf8'` +* `callback` {Function} + * `err` {Error} + * `resolvedPath` {string|Buffer} + +Asynchronous realpath(3). + +The `callback` gets two arguments `(err, resolvedPath)`. + +Only paths that can be converted to UTF8 strings are supported. + +The optional `options` argument can be a string specifying an encoding, or an +object with an `encoding` property specifying the character encoding to use for +the path passed to the callback. If the `encoding` is set to `'buffer'`, +the path returned will be passed as a `Buffer` object. + +*Note*: On Linux, when Node.js is linked against musl libc, the procfs file +system must be mounted on `/proc` in order for this function to work. Glibc +does not have this restriction. + ## fs.realpathSync(path[, options]) + +* `path` {string|Buffer|URL} +* `options` {string|Object} + * `encoding` {string} **Default:** `'utf8'` + +Synchronous realpath(3). + +Only paths that can be converted to UTF8 strings are supported. + +The optional `options` argument can be a string specifying an encoding, or an +object with an `encoding` property specifying the character encoding to use for +the path passed to the callback. If the `encoding` is set to `'buffer'`, +the path returned will be passed as a `Buffer` object. + +*Note*: On Linux, when Node.js is linked against musl libc, the procfs file +system must be mounted on `/proc` in order for this function to work. Glibc +does not have this restriction. + ## fs.rename(oldPath, newPath, callback)