Commit Graph

794 Commits

Author SHA1 Message Date
Anna Henningsen
f2e35ff691 build: improve make coverage
Run cleanup for all relevant subdirectories, and exclude generated
source files (e.g. `out/Release/...`) from coverage reporting.
Also enable running `make cctest` again (It’s unclear to me why this
was disabled, as it does reduce coverage unnecessarily).

PR-URL: https://github.com/nodejs/node/pull/29487
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
2019-09-10 01:49:17 -07:00
Daniel Bevenius
25d59cf83a build: hard code doctool in test-doc target
This commit removes the usage of the CI_DOC variable in the test-doc
recipe and specifies the doctool argument to tools/test.py explicitly.

The motivation for this is that the build is taking longer time and
this is mostly due to tests being run twice as the CI_DOC
variable will be empty in most cases (when not using --without-ssl).

This change was introduced with/after Commit
9039af83a3 ("build: skip test-ci doc
targets if no crypto") and while I though it might make sense to change
the setting of CI_DOC I not sure about the implications that might have
to our CI environment. It currently looks like this:

ifeq ($(node_use_openssl), false)
        CI_DOC := doctool
else
        CI_DOC =
endif

Which is setting CI_DOC to doctool if there is no crypto support which
not available. But perhaps this should be be the other way around,
changing the order or updating condition to be true.

PR-URL: https://github.com/nodejs/node/pull/29375
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2019-08-30 18:23:22 -07:00
Daniel Bevenius
db3fdfbcb6 build: move tooltest to before jstest target
This commit moves the tooltest target to come before the jstest target
to make the console output consistent with it was before I introduced
the tooltest target.

Currently the output looks like this which is might give the impression
that only one test was run:
/Applications/Xcode.app/Contents/Developer/usr/bin/make -s tooltest
.
----------------------------------------------------------------------
Ran 1 test in 0.000s

Compared to the usual:
[03:58|% 100|+ 2739|-   0]: Done

PR-URL: https://github.com/nodejs/node/pull/29220
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
2019-08-23 05:41:54 +02:00
Rich Trott
ec16fdae54 build: remove unused option
There is no longer a need to skip sequential/test-benchmark-napi because
it no longer resides in sequential. Benchmark tests are now in their own
directory.

PR-URL: https://github.com/nodejs/node/pull/29173
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2019-08-18 16:33:18 -07:00
Daniel Bevenius
a890771cd0 build: add a testclean target
This commit adds a target named testclean to allow for cleaning the
temporary files generated during a test run without having to use the
clean target.

PR-URL: https://github.com/nodejs/node/pull/29094
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2019-08-16 16:23:33 -07:00
Daniel Bevenius
b4f0a18b5a tools: allow single JS file for --link-module
The description for the --link-module configuration option is as
follows:
$ ./configure --help | grep -A 5 'link-module'
  --link-module=LINKED_MODULE
                      Path to a JS file to be bundled in the binary as a
                      builtin. This module will be referenced by path
                      without extension; e.g. /root/x/y.js will be
                      referenced via require('root/x/y'). Can be used
                      multiple times

This lead me to think that it was possible to specify a file like this:
$ ./configure --link-module=something.js
$ NODE_DEBUG=mkcodecache make -j8

This will lead to a compilation error as an entry in the source_ map in
node_javascript.cc will end up having an empty string as its key:
source_.emplace("", UnionBytes{_raw, 105});

This will then be used by CodeCacheBuilder when it iterates over the
module ids, which will lead to the following compilation errors:

/node/out/Release/obj/gen/node_code_cache.cc:12:23: warning:
ISO C++17 does not allow a decomposition group to be
empty [-Wempty-decomposition]
static const uint8_t [] = {
                      ^
/node/out/Release/obj/gen/node_code_cache.cc:12:22: warning:
decomposition declarations are a C++17 extension [-Wc++17-extensions]
static const uint8_t [] = {
                     ^~
/node/out/Release/obj/gen/node_code_cache.cc:12:1: error:
decomposition declaration cannot be declared 'static'
static const uint8_t [] = {
^~~~~~
/node/out/Release/obj/gen/node_code_cache.cc:12:22: error:
decomposition declaration cannot be declared with type 'const uint8_t'
(aka 'const unsigned char'); declared type must be 'auto' or
reference to 'auto'
static const uint8_t [] = {
                     ^
/node/out/Release/obj/gen/node_code_cache.cc:12:22: error:
excess elements in scalar initializer
static const uint8_t [] = {
                     ^
/node/out/Release/obj/gen/node_code_cache.cc:660:7: error:
expected expression
      ,
      ^
/node/out/Release/obj/gen/node_code_cache.cc:661:24: error:
no matching function for call to 'arraysize'
      static_cast<int>(arraysize()), policy
                       ^~~~~~~~~
../src/util.h:667:18: note: candidate function template not viable:
requires 1 argument, but 0 were provided
constexpr size_t arraysize(const T (&)[N]) {
                 ^
2 warnings and 5 errors generated.

This commit suggests that passing a single file be allowed by modifying
tools/js2c.py.

PR-URL: https://github.com/nodejs/node/pull/28443
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2019-08-12 12:56:43 +02:00
Luigi Pinca
ab155335bc build: do not mix spaces and tabs in Makefile
PR-URL: https://github.com/nodejs/node/pull/28881
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2019-07-30 13:31:45 -07:00
Ben Noordhuis
30666edd05 build: uname -m is amd64 on freebsd, not x86_64
Fixes: https://github.com/nodejs/node/issues/13150

PR-URL: https://github.com/nodejs/node/pull/28804
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2019-07-24 11:32:44 -07:00
Michaël Zasso
3117899414 tools: remove unused pkgsrc directory
The pkgsrc Makefile target was removed in 2015

Refs: https://github.com/nodejs/node/pull/1938

PR-URL: https://github.com/nodejs/node/pull/28783
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2019-07-22 11:31:17 -07:00
Rod Vagg
9039af83a3 build: skip test-ci doc targets if no crypto
PR-URL: https://github.com/nodejs/node/pull/28747
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2019-07-20 09:32:55 -07:00
Daniel Bevenius
b456bbcc6d build: guard test-doc recipe with node_use_openssl
Currently, when configuring --without-ssl the test-doc target fails with
the following error:
/node/test/common/index.js:707
const crashOnUnhandledRejection = (err) => { throw err; };
                                             ^

Error [ERR_NO_CRYPTO]:
Node.js is not compiled with OpenSSL crypto support
    at Object.assertCrypto (internal/util.js:97:11)
    at https.js:26:26
    at NativeModule.compile (internal/bootstrap/loaders.js:300:5)
    ...
    at /node/tools/doc/versions.js:7:19
    at new Promise (<anonymous>)
    at getUrl (/node/tools/doc/versions.js:6:10)
Command: out/Release/node /node/test/doctool/test-doctool-html.js
[00:02|% 100|+   3|-   1]: Done
make: *** [test-doc] Error 1

This commit guards the test-doc recipe to not run if node was
configured without crypto support.

PR-URL: https://github.com/nodejs/node/pull/28199
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2019-06-17 05:32:15 +02:00
Richard Lau
d74dc17afe build: lint all docs under doc
`**` expansion doesn't behave as expected and as a result files in
nested subdirectories under `doc` were not linted. Use `find` instead
to generate the list of files to lint.

PR-URL: https://github.com/nodejs/node/pull/28128
Refs: https://github.com/nodejs/node/pull/28127
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2019-06-12 21:03:57 -07:00
Refael Ackermann
46eb532a2a build: delegate building from Makefile to ninja
PR-URL: https://github.com/nodejs/node/pull/27504
Refs: https://mobile.twitter.com/refack/status/1118484079077482498
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
2019-05-02 21:03:53 -04:00
Joyee Cheung
d701667950
tools: implement node_mksnapshot
Implements a node_mksnapshot target that generates a snapshot blob
from a Node.js main instance's isolate, and serializes the data blob
with other additional data into a C++ file that can be embedded into
the Node.js binary.

PR-URL: https://github.com/nodejs/node/pull/27321
Refs: https://github.com/nodejs/node/issues/17058
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2019-04-23 11:26:01 +08:00
Refael Ackermann
e356807a79 deps,test: bump googletest to 39f72ea6f5
Refs: 39f72ea6f5

PR-URL: https://github.com/nodejs/node/pull/27231
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2019-04-22 17:34:12 -04:00
Refael Ackermann
14df42fd00 build: run mkcodecache as an action
* fix test-code-cache (for the common cases)
* deprecate `configure --code-cache-path`

PR-URL: https://github.com/nodejs/node/pull/27161
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2019-04-16 18:25:04 -04:00
Joyee Cheung
4fd7193579 tools: implement mkcodecache as an executable
This patch implement a mkcodecache executable on top of the
`NativeModuleLoader` singleton.
This makes it possible to build a Node.js binary with embedded
code cache without building itself using the code cache stub -
the cache is now initialized by `NativeModuleEnv` instead which
can be refactored out of the mkcodecache dependencies.

PR-URL: https://github.com/nodejs/node/pull/27161
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2019-04-16 18:23:32 -04:00
Refael Ackermann
3b5773fee3 build,deps: move gypfiles out 2/2 - moving
* move all used files to `tools/v8_gypfiles` directory
* fix references in node configuration

PR-URL: https://github.com/nodejs/node/pull/26685
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
2019-03-28 16:39:16 -04:00
Refael Ackermann
ecf98b0839 build,meta: quiet/pretty make output by default
PR-URL: https://github.com/nodejs/node/pull/26740
Refs: https://github.com/nodejs/node/pull/26252
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2019-03-21 20:21:01 -04:00
Refael Ackermann
91e1a043a6 Revert "build: silence cpp lint by default"
This reverts commit 0373836b39.

PR-URL: https://github.com/nodejs/node/pull/26358
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2019-03-07 18:46:27 -05:00
Ruben Bridgewater
0373836b39
build: silence cpp lint by default
The cpp linter is very noisy at the moment. So use the --quiet flag
by default instead of being verbose in this case.

PR-URL: https://github.com/nodejs/node/pull/26252
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2019-02-28 17:44:12 +01:00
Daniel Bevenius
f17f467544 build,test: guard eslint with crypto check
Currently, configuring --without-ssl will cause the lint-js target to
fail with the following error:
$ make lint-js
Running JS linter...
internal/util.js:101
    throw new ERR_NO_CRYPTO();
    ^

Error [ERR_NO_CRYPTO]:
Node.js is not compiled with OpenSSL crypto support
at assertCrypto (internal/util.js:101:11)
at crypto.js:31:1
...
(/node/tools/node_modules/eslint/node_modules/file-entry-cache/
cache.js:2:14)
at Module._compile (internal/modules/cjs/loader.js:746:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:757:10)
make: *** [lint-js] Error 1

There are also a number of tests that are affected in a similar way.

This commit adds crypto checks to allow for lint-js and the affected
tests to be skipped when configured --without-ssl.

PR-URL: https://github.com/nodejs/node/pull/26182
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2019-02-21 05:35:12 +01:00
Rich Trott
4deb23a2f6 tools: improve prerequisites for test-all-suites
The prerequisistes for test-all-suites were running some tests
themselves. When one of those tests failed during a coverage run, it
resulted in artificially low coverage. Fix the prerequisites to only
build stuff, not test.

PR-URL: https://github.com/nodejs/node/pull/25892
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2019-02-02 17:20:20 -08:00
Rich Trott
8198ca0b26 tools: exclude benchmark code from coverage report
Refs: https://github.com/nodejs/build/issues/1676#issuecomment-459218651

PR-URL: https://github.com/nodejs/node/pull/25841
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Ben Coe <bencoe@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2019-02-01 23:11:58 -08:00
Rich Trott
e1aa9438ea tools: add test-all-suites to Makefile
There is currently no Makefile target that runs every test suite. This
adds one.

PR-URL: https://github.com/nodejs/node/pull/25799
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
2019-02-01 15:40:46 -08:00
Benjamin Coe
a861adde3b
test: allow coverage threshold to be enforced
If COV_ENFORCE_THRESHOLD is set, tests run in coverage mode will
exit with an error, if line coverage is below the percentage
threshold.

PR-URL: https://github.com/nodejs/node/pull/25675
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2019-02-01 10:20:40 -08:00
Michael Dawson
c06653efdb test: enable marking of failing coverage tests
Enable marking of coverage tests so that we can
allow some tests to fail without blocking the generation
of coverage data. This will later allow us to
fail the coverage job if other kinds of errors occur and
to capture which tests we believe are not running properly
with coverage enabled.

PR-URL: https://github.com/nodejs/node/pull/25671
Reviewed-By: Ben Coe <bencoe@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Refael Ackermann <refack@gmail.com>
2019-01-29 08:18:06 +01:00
Joyee Cheung
715df64b46 build: do not lint python scripts under test/fixtures
PR-URL: https://github.com/nodejs/node/pull/25639
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2019-01-22 12:47:00 -05:00
Benjamin Coe
d1dee495db
test: switch to native v8 coverage
PR-URL: https://github.com/nodejs/node/pull/25157
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
2019-01-20 14:21:16 -08:00
Michael Dawson
1375af204a test: revert fail coverage target if tests fail"
This reverts commit f216d5bbb1.
Seems like it breaks the nightly job so reverting until
we figure that out.

PR-URL: https://github.com/nodejs/node/pull/25543
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2019-01-17 12:58:29 -05:00
Refael Ackermann
f216d5bbb1 build,test: fail coverage target if tests fail
PR-URL: https://github.com/nodejs/node/pull/25432
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2019-01-15 07:58:39 +01:00
Rich Trott
10642d625e tools: report unused disable-directives for ESLint
Refs: https://eslint.org/docs/user-guide/command-line-interface#--report-unused-disable-directives

PR-URL: https://github.com/nodejs/node/pull/25119
Reviewed-By: Teddy Katz <teddy.katz@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2018-12-21 10:38:45 -08:00
Daniel Bevenius
4ac170251b build: correct fi indentation in Makefile
PR-URL: https://github.com/nodejs/node/pull/25107
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2018-12-21 13:54:51 +01:00
Joyee Cheung
9190e4ecdf tools: make apilinks building more robust
1. Move the apilinks.json file into out/doc so it gets cleaned when
  running `make docclean`
2. When the apilinks.json generated is empty, throw a specific error
  so it's easier to understand what's wrong
3. Write to a file passed through CLI arguments instead writing to
  stdout in apilinks.js so the build process is more robust in
  the case of a bad binary

PR-URL: https://github.com/nodejs/node/pull/25019
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-12-18 05:14:24 +01:00
Daniel Bevenius
e7c3a1b40a build: make lint-addon-docs run only if needed
Currently, the lint-addon-docs targets recipe will always be run.
This commit makes lint-addon-docs a phony target and adds a new
target named tools/.doclintstamp what will be an actual file,
similar to what the lint-cpp target does.

PR-URL: https://github.com/nodejs/node/pull/24993
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2018-12-15 06:48:07 -08:00
cclauss
5652cb0b53 tools: do not lint tools/inspector_protocol or tools/markupsafe
PR-URL: https://github.com/nodejs/node/pull/24882
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-12-09 19:46:13 -08:00
cclauss
7bcbf044dd build: add '.git' to 'make lint-py' exclude list
When run locally [flake8](http://flake8.pycqa.org) was creating false positives by scanning the __.git__ directory.  This PR prevents that behavior.

PR-URL: https://github.com/nodejs/node/pull/24802
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2018-12-05 20:06:12 -08:00
Rod Vagg
6ccc80c82a build: fix check-xz for platforms defaulting to sh
5e80a9a160 introduced check-xz, using `[[ .. ]]` syntax, but this is a
bash builtin and some platforms default to `sh` when doing
`$(shell ...)` in Makefiles.

Fix is to make it sh friendly.

Ref: https://github.com/nodejs/node/pull/24551

PR-URL: https://github.com/nodejs/node/pull/24841
Refs: https://github.com/nodejs/node/pull/24551
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2018-12-04 22:01:01 -08:00
Rod Vagg
5e80a9a160 build: make tar.xz creation opt-out, fail if no xz
PR-URL: https://github.com/nodejs/node/pull/24551
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2018-12-04 14:44:52 -08:00
Gabriel Schulhof
938e11882b test: partition N-API tests
Partition test/addons-napi into test/js-native-api and test/node-api to
isolate the Node.js-agnostic portion of the N-API tests from the
Node.js-specific portion.

PR-URL: https://github.com/nodejs/node/pull/24557
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
2018-12-04 13:58:17 -08:00
Rod Vagg
89e8fc4520 build: only check REPLACEME & DEP...X for releases
PR-URL: https://github.com/nodejs/node/pull/24575
Refs: https://github.com/nodejs/node/pull/24551
Refs: https://github.com/nodejs/node/pull/12958
Refs: https://github.com/nodejs/node/pull/12957
Refs: https://github.com/nodejs/node/pull/8325
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2018-11-28 23:33:55 +11:00
Rich Trott
e20be47c17 build: replace -not with ! in find
Replace `find -not` usage with `find !` as `-not` is not universally
supported.

Fixes: https://github.com/nodejs/node/issues/24634
PR-URL: https://github.com/nodejs/node/pull/24635
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
2018-11-25 17:45:37 +05:30
Gabriel Schulhof
596bd5f1bb src: factor out Node.js-agnostic N-APIs
Split the Node.js ECMAScript API (N-EAPI?) into its own header and
implementation files. The motivation is that the ECMAScript API stand
on its own so it might be embedded separately, implementation and all.

Portions of the implementation used by both files are stored in
`node_api_impl.h`.

The checked boxes below indicate that the given API remains in
`node_api.h`, whereas the lack of a checkbox indicates that the API was
moved to `node_ecma_api.h`.

* [x] NAPI_MODULE
* [x] NAPI_MODULE_INIT
* [x] napi_acquire_threadsafe_function
* [x] napi_add_env_cleanup_hook
* [x] napi_async_destroy
* [x] napi_async_init
* [x] napi_call_threadsafe_function
* [x] napi_cancel_async_work
* [x] napi_close_callback_scope
* [x] napi_create_async_work
* [x] napi_create_buffer
* [x] napi_create_buffer_copy
* [x] napi_create_external_buffer
* [x] napi_create_threadsafe_function
* [x] napi_delete_async_work
* [x] napi_fatal_error
* [x] napi_fatal_exception
* [x] napi_get_buffer_info
* [x] napi_get_node_version
* [x] napi_get_threadsafe_function_context
* [x] napi_get_uv_event_loop
* [x] napi_is_buffer
* [x] napi_make_callback
* [x] napi_module_register
* [x] napi_open_callback_scope
* [x] napi_queue_async_work
* [x] napi_ref_threadsafe_function
* [x] napi_release_threadsafe_function
* [x] napi_remove_env_cleanup_hook
* [x] napi_unref_threadsafe_function
* [ ] napi_add_finalizer
* [ ] napi_adjust_external_memory
* [ ] napi_call_function
* [ ] napi_close_escapable_handle_scope
* [ ] napi_close_handle_scope
* [ ] napi_coerce_to_bool
* [ ] napi_coerce_to_number
* [ ] napi_coerce_to_object
* [ ] napi_coerce_to_string
* [ ] napi_create_array
* [ ] napi_create_arraybuffer
* [ ] napi_create_array_with_length
* [ ] napi_create_bigint_int64
* [ ] napi_create_bigint_uint64
* [ ] napi_create_bigint_words
* [ ] napi_create_dataview
* [ ] napi_create_double
* [ ] napi_create_error
* [ ] napi_create_external
* [ ] napi_create_external_arraybuffer
* [ ] napi_create_function
* [ ] napi_create_int32
* [ ] napi_create_int64
* [ ] napi_create_object
* [ ] napi_create_promise
* [ ] napi_create_range_error
* [ ] napi_create_reference
* [ ] napi_create_string_latin1
* [ ] napi_create_string_utf16
* [ ] napi_create_string_utf8
* [ ] napi_create_symbol
* [ ] napi_create_typedarray
* [ ] napi_create_type_error
* [ ] napi_create_uint32
* [ ] napi_define_class
* [ ] napi_define_properties
* [ ] napi_delete_element
* [ ] napi_delete_property
* [ ] napi_delete_reference
* [ ] napi_escape_handle
* [ ] napi_get_and_clear_last_exception
* [ ] napi_get_arraybuffer_info
* [ ] napi_get_array_length
* [ ] napi_get_boolean
* [ ] napi_get_cb_info
* [ ] napi_get_dataview_info
* [ ] napi_get_element
* [ ] napi_get_global
* [ ] napi_get_last_error_info
* [ ] napi_get_named_property
* [ ] napi_get_new_target
* [ ] napi_get_null
* [ ] napi_get_property
* [ ] napi_get_property_names
* [ ] napi_get_prototype
* [ ] napi_get_reference_value
* [ ] napi_get_typedarray_info
* [ ] napi_get_undefined
* [ ] napi_get_value_bigint_int64
* [ ] napi_get_value_bigint_uint64
* [ ] napi_get_value_bigint_words
* [ ] napi_get_value_bool
* [ ] napi_get_value_double
* [ ] napi_get_value_external
* [ ] napi_get_value_int32
* [ ] napi_get_value_int64
* [ ] napi_get_value_string_latin1
* [ ] napi_get_value_string_utf16
* [ ] napi_get_value_string_utf8
* [ ] napi_get_value_uint32
* [ ] napi_get_version
* [ ] napi_has_element
* [ ] napi_has_named_property
* [ ] napi_has_own_property
* [ ] napi_has_property
* [ ] napi_instanceof
* [ ] napi_is_array
* [ ] napi_is_arraybuffer
* [ ] napi_is_dataview
* [ ] napi_is_error
* [ ] napi_is_exception_pending
* [ ] napi_is_promise
* [ ] napi_is_typedarray
* [ ] napi_new_instance
* [ ] napi_open_escapable_handle_scope
* [ ] napi_open_handle_scope
* [ ] napi_reference_ref
* [ ] napi_reference_unref
* [ ] napi_reject_deferred
* [ ] napi_remove_wrap
* [ ] napi_resolve_deferred
* [ ] napi_run_script
* [ ] napi_set_element
* [ ] napi_set_named_property
* [ ] napi_set_property
* [ ] napi_strict_equals
* [ ] napi_throw
* [ ] napi_throw_error
* [ ] napi_throw_range_error
* [ ] napi_throw_type_error
* [ ] napi_typeof
* [ ] napi_unwrap
* [ ] napi_wrap

PR-URL: https://github.com/nodejs/node/pull/23786
Reviewed-By: Yazhong Liu <yorkiefixer@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2018-11-17 14:38:51 -08:00
Daijiro Wachi
62d053b707 tools: fix make lint-md-rollup and run it
PR-URL: https://github.com/nodejs/node/pull/24333
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
2018-11-16 04:20:40 +01:00
Rich Trott
150c9bed1e build: remove unnecessary prerequisite in Makefile
bench-addons-build is not needed by test-ci.

PR-URL: https://github.com/nodejs/node/pull/24342
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2018-11-15 14:50:18 -08:00
Rich Trott
f697457dd8 build: fix benchmark tests on CI
PR-URL: https://github.com/nodejs/node/pull/24307
Refs:
https://github.com/nodejs/build/issues/1568#issuecomment-437681599
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2018-11-12 11:00:22 +01:00
Daniel Bevenius
ce6ec368a6 build: use BUILDTYPE in bench-addons-build targets
This commit uses the BUILDTYPE for the benchmark targets that currently
explicitly use Release as the build type.

The motivation for this change is allows switching between debug builds
and release builds using the bench-addons-clean/bench-addons-build
targets.

PR-URL: https://github.com/nodejs/node/pull/24033
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-11-11 12:09:25 -05:00
Rich Trott
b5420c9577 test: move benchmark tests out of main test suite
Move benchmark tests (which are slow) out of the main test suite. We can
hopefully add them to node-daily-master so that they are still run daily
on CI.

PR-URL: https://github.com/nodejs/node/pull/24265
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-11-10 22:44:26 -08:00
Joyee Cheung
9858e331e3
test: initialize test/wpt to run URL and console .js tests
This patch:

- Creates a new test suite `wpt` that can be used to run a subset
  of Web Platform Tests
- Adds a `WPTRunner` in `test/common/wpt.js` that can run the WPT
  subset in `test/fixtures/wpt` with a vm and the WPT harness
  while taking the status file in `test/wpt/status` into account.
  Here we use a new format of status file (in JSON) to handle specific
  requirements (like ICU requirements) in the tests and to handle
  expected failures and TODOs.
- Adds documentation on how the runner and the update automation works
- Runs the WHATWG URL tests and the console tests with the new test
  runner.

With this patch we eliminates the need of copy-pasting with manual
modifications to update a large chunk of our WPT subset previously
maintained in `test/parallel`. Now the tests run in `test/wpt` can
be automatically updated with `git node wpt` without modifications
by the actual WPT harness instead of our home-grown mock.

There are still a few URL tests left that need to be migrated in the
upstream to be placed in .js instead of .html - we currently still use
the legacy harness mock in the test files.

PR-URL: https://github.com/nodejs/node/pull/24035
Refs: https://github.com/nodejs/node/issues/23192
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
2018-11-09 20:27:21 +08:00
Joyee Cheung
dc3bc8928f build: only try to find node when it's needed by the target
Right now `node -p process.versions.openssl` always gets run
in the Makefile even when it's not needed by the target
(e.g. `make clean`, `make test-only`). This patch makes it
a run time call instead of part of the global expansion.

PR-URL: https://github.com/nodejs/node/pull/24115
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
2018-11-07 20:51:17 -08:00
mritunjaygoutam12
7cefc8063c build: change repo to https protocol in Makefile
PR-URL: https://github.com/nodejs/node/pull/24073
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2018-11-07 20:11:49 -08:00
Daniel Bevenius
98819dfa58 build: make benchmark/napi all prereq order-only
This commit makes the all prerequisites order-only to prevent this
target's rules to be executed every time which is currently the case as
the all target is a phony target and will be executed every time.

PR-URL: https://github.com/nodejs/node/pull/23951
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
2018-11-01 15:24:56 +01:00
cclauss
0c39290201 build: add lint-py which uses flake8
PR-URL: https://github.com/nodejs/node/pull/21952
Reviewed-By: Refael Ackermann <refack@gmail.com>
2018-10-24 17:19:28 -04:00
Emily Marigold Klassen
8c99a224d2 test: add test-benchmark-napi
Also makes sure that the napi benchmark is built before running jstest.

Skipped on windows since n-api benchmarks aren't built there yet.

PR-URL: https://github.com/nodejs/node/pull/23585
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2018-10-24 06:58:19 -07:00
Michael Dawson
9464e43c7b build: fix coverage generation
Changes in command line options for nyc resulted in the
coverage target no longer working.

Pin the major version of nyc and update the options to
get it working again.

PR-URL: https://github.com/nodejs/node/pull/23769
Fixes: https://github.com/nodejs/node/issues/23690
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: George Adams <george.adams@uk.ibm.com>
2018-10-22 11:28:49 -04:00
Refael Ackermann
b3ae9150de build: spawn make test-ci with -j1
All the sub targets have internal parallelism, so no performance loss.
Also `make` doesn't to a good enough job of combining the output
streams, or eliminate races.

PR-URL: https://github.com/nodejs/node/pull/23733
Fixes: https://github.com/nodejs/node/issues/22006
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Matheus Marchini <mat@mmarchini.me>
2018-10-20 11:02:50 -04:00
Daniel Bevenius
ff3fd3bf80 build: toggle lint-cpp using verbose (V) variable
This commit the verbosity of cpplint to be toggled by using the V
variable. The default setting is verbose but by passing an empty string
cpplint will be quiet.

PR-URL: https://github.com/nodejs/node/pull/23217
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2018-10-05 07:18:30 +02:00
Daniel Bevenius
c1cad2f9df build: make lint-addon-docs quiet
This commit adds the --quiet flag to cpplint for the lint-addon-docs
target to be consistent with the lint-cpp target.

PR-URL: https://github.com/nodejs/node/pull/23217
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2018-10-05 07:18:18 +02:00
Ben Noordhuis
df6a1306e8 doc: remove GA tracking
The Google Analytics tracking wasn't wholly uncontroversial and hasn't
been used in practice. Remove it.

PR-URL: https://github.com/nodejs/node/pull/23083
Fixes: https://github.com/nodejs/node/issues/22652
Refs: https://github.com/nodejs/node/pull/6601
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2018-10-04 07:18:23 +02:00
Refael Ackermann
6dd4a077c0 build: reduce chance of unneeded rebuild
Run `node_js2c` and `mkssldef` as actions and not as targets makes sure
they are run only once, just before processing the rest of `node_lib`.
This helps `make` based dependency change detection be more accurate.

Add comments with tagrget names for readability.

Use `process_outputs_as_sources` for automatic inclution of outputs.

PR-URL: https://github.com/nodejs/node/pull/23156
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2018-10-02 17:53:14 -04:00
Daniel Bevenius
6df2c556bd build: add --quiet to lint-cpp
This commit adds the --quiet flag to cpplint to avoid informational
output like:
Done processing src/node.cc
...

PR-URL: https://github.com/nodejs/node/pull/23075
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2018-10-01 10:35:57 +02:00
Rich Trott
a79c88a4ce build: remove unnecessary Makefile output
Remove unnecessary @echo commands from Makefile.

These were originally comments but were changed to @echo in 6bc43aeea7.
They aren't terribly useful so let's remove them.

PR-URL: https://github.com/nodejs/node/pull/23129
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-09-30 21:34:03 -07:00
Rich Trott
c9c4550dd4 build: move addons message in Makefile
Displaying a message about building addons before building docs can be
confusing when troubleshooting. (This just happened to me.) Move the
message about building addons to just before the step for building
addons.

PR-URL: https://github.com/nodejs/node/pull/23114
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2018-09-27 09:46:22 -07:00
Refael Ackermann
c55ebd8502 build: make config verbose on CI
PR-URL: https://github.com/nodejs/node/pull/22935
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-09-21 16:20:25 -04:00
Ruben Bridgewater
92fd4fcd3d
build: stop printing execution of lint-md command
The executed command is very verbose and removing that from the
output improves the overall experience.

PR-URL: https://github.com/nodejs/node/pull/22904
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
2018-09-19 18:06:04 +02:00
Joyee Cheung
bb9d788f77
build: do not lint fixtures in make lint-md
PR-URL: https://github.com/nodejs/node/pull/22549
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
2018-09-17 14:48:28 -04:00
Refael Ackermann
e4dd213516 tools: use lint-md.js
* remove unused `tools/remark-cli`
* vcbuild tested with `vcbuild nobuild noprojgen lint-md-build lint-md`

PR-URL: https://github.com/nodejs/node/pull/20109
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-09-11 14:12:30 -04:00
Refael Ackermann
fe6c74c2a5 tools: make lint-md-rollup & checkin lint-md.js
PR-URL: https://github.com/nodejs/node/pull/20109
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-09-11 14:12:23 -04:00
Refael Ackermann
7fcc178be1 tools: relocate remark-preset-lint-node
PR-URL: https://github.com/nodejs/node/pull/20109
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-09-11 14:12:18 -04:00
Refael Ackermann
d1c5d18ff6 build: rename configure to configure.py
!Should go with next commit!

* renaming so that IDEs can properly detect this as python
* Add dependency to Makefile

PR-URL: https://github.com/nodejs/node/pull/22450
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2018-09-07 10:17:52 -04:00
Sam Ruby
441391b9eb tools: add [src] links to async_hooks.html
handle ES2015 Class, contructor, and instance methods

unrelated: update Makefile so that generated HTML is out of date whenever
tools/doc/apilinks.js is updated.

PR-URL: https://github.com/nodejs/node/pull/22656
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-09-05 12:46:51 +02:00
Daniel Bevenius
d7d3bf57a6 build: use arm64 as DESTCPU for aarch64
On a aarch64 system I can run the complete build with tests without
specifying the Makefile variable DESTCPU.

But when running the tar-headers target DESTCPU is passed to configure:
$(PYTHON) ./configure \
       --prefix=/ \
       --dest-cpu=$(DESTCPU) \
       ...
The value of DESTCPU in this case will be aarch64 which will cause
configure to fail:
configure: error: option --dest-cpu: invalid choice: 'aarch64'
(choose from 'arm', 'arm64', 'ia32', 'mips', 'mipsel', 'mips64el', 'ppc',
'ppc64', 'x32', 'x64', 'x86', 'x86_64', 's390', 's390x')

In the configure script there is a matching of __aarch64__ to arm64:
$ python -c 'from configure import host_arch_cc; print host_arch_cc()'
arm64

In our case it would be nice to have consitent behaviour for both of
these cases on aarch64.

This commit changes DESTCPU to arm64 to be consistent with the
configure script. DESTCPU is used in $(TARBALL)-headers and in
$(BINARYTAR) but I'm not sure about the implications of making the
change purposed and hope others might chime in and provide some
guidance.

PR-URL: https://github.com/nodejs/node/pull/22548
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
2018-09-03 09:05:03 +02:00
Sam Ruby
60465700ed tools: Include links to source code in documentation
Parse source code using acorn; extracting exports.  When producing
documentation, match exports to headers.  When a match is found, add a [src]
link.

This first commit handles simple exported classes and functions, and does so
without requiring any changes to the source code or markdown.  Subsequent
commits will attempt to match more headers, and some of these changes are
likely to require changes to the source code and/or markdown.

PR-URL: https://github.com/nodejs/node/pull/22405
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
2018-08-29 22:20:46 -04:00
Refael Ackermann
d32051147c build: use npm ci
* remove obsolete `node_modules/js-yaml/package.json` target
* remove `@touch` since `npm ci` is always destructive

PR-URL: https://github.com/nodejs/node/pull/22399
Refs: https://github.com/nodejs/node/pull/21802
Refs: https://github.com/nodejs/node/pull/21490
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Sam Ruby <rubys@intertwingly.net>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
2018-08-22 20:19:54 -04:00
Daniel Bevenius
9d9f691d26 Revert "build: extract common code from NODE_EXE/_G_EXE"
This reverts commit 4e2fa8b0dc.

Refs: https://github.com/nodejs/node/issues/22457

PR-URL: https://github.com/nodejs/node/pull/22458
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-08-22 19:23:33 -04:00
Daniel Bevenius
4e2fa8b0dc build: extract common code from NODE_EXE/_G_EXE
This commit extracts common parts of the NODE_EXE, and NODE_G_EXE
recipes into a canned reciepe to reduce some code duplication.

PR-URL: https://github.com/nodejs/node/pull/22310
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2018-08-22 06:32:47 +02:00
Daniel Bevenius
28675b66d2 build: move available-node variable to top
Currently node_use_openssl uses the available-node variable before it is
defined causing the conditions that use it before that point to
evaluate incorrectly. As an example running the target
test/addons/.docbuildstamp will currently be skipped:

$ make test/addons/.docbuildstamp
Skipping .docbuildstamp (no crypto)

With this commit the target will only be skipped if configured --without-ssl.

PR-URL: https://github.com/nodejs/node/pull/22356
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-08-20 18:51:47 +02:00
Daniel Bevenius
104492bd83
build: touch tools/doc/node_modules after run
Currently, tools/doc/node_modules is not touched after running npm
install resulting in npm install being run every time. I missed this
while testing commit 88bff82624 ("build:
make tools/doc/node_modules non-phony").

PR-URL: https://github.com/nodejs/node/pull/22350
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2018-08-20 16:08:12 +02:00
Daniel Bevenius
95b0e2c133 build: add test-doc to test target
This commit adds the test-doc target to the test recipe so that docs are
built and linters run. This used to happen but was removed at some
point.

PR-URL: https://github.com/nodejs/node/pull/22294
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2018-08-20 13:20:24 +02:00
Daniel Bevenius
6bc43aeea7 build: use echo command instead of shell comments
Currently, there are a few recipes where comments are indented
and being passed to the shell.

This commit updates these comments to use the echo command instead,
which is the more common approach used in other recipes in the
makefile.

PR-URL: https://github.com/nodejs/node/pull/22293
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
2018-08-20 11:05:45 +02:00
Rich Trott
c535bde5da tools: simplify ESLint invocation in Makefile
Makefile currently enforces .eslintrc.js linting on the command line but
it is already enforced in the .estlintignore file.

This also simplifies an arguably-related comment in .estlinrc.js.

PR-URL: https://github.com/nodejs/node/pull/22348
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-08-18 18:48:55 -07:00
Rich Trott
7cec27c799 tools,build: apply markdown linting to test dir
Enable markdown linting of the test directory. This change is applied
only to Makefile and not vcbuild.bat because we do not currently lint
anything outside of the doc directory using vcbuild.bat. In the
Makefile, the other targets are called "misc" but that feature does not
currently exist in vcbuild.bat. Adding it would be good, but outside the
scope of this change.

PR-URL: https://github.com/nodejs/node/pull/22221
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Khaidi Chu <i@2333.moe>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: George Adams <george.adams@uk.ibm.com>
2018-08-12 15:30:17 -07:00
Daniel Bevenius
ec8f31dace build: add CONFIG_FLAGS to with-code-cache target
This commit adds CONFIG_FLAGS to allow the with-code-cache target to be
used with a debug build. The motivation for this is to make it easier to
debug a build with the code cache enabled.

The suggested usage:
$ make BUILDTYPE=Debug with-code-cache

The BUILDTYPE option is not needed if ./configure was already
configured with --debug.

PR-URL: https://github.com/nodejs/node/pull/22207
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
2018-08-11 20:30:23 -04:00
Daniel Bevenius
88bff82624 build: make tools/doc/node_modules non-phony
This commit makes the target tools/doc/node_modules a non-phony target
and also adds tools/doc/package.json as a prerequisite to it to avoid
running it unnecessary. This is currently causing the target
test/addons/.docbuildstamp to be always be executed as it has
tools/doc/node_modules as a prerequisite.

PR-URL: https://github.com/nodejs/node/pull/22189
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Sam Ruby <rubys@intertwingly.net>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
2018-08-10 15:38:23 +02:00
Daniel Bevenius
77da6d9e8c build: add crypto check to build targets
Currently when configured without-ssl the build will fail when trying
to run the tools/doc/node_modules, and .docbuildstamp make targets:

internal/util.js:97
    throw new ERR_NO_CRYPTO();
    ^
Error [ERR_NO_CRYPTO]: Node.js is not compiled with OpenSSL crypto
                       support
    at assertCrypto (internal/util.js:97:11)
    at crypto.js:31:1
    ...
    at Object.<anonymous>
       (/node/deps/npm/node_modules/uuid/lib/rng.js:4:14)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    ...
make[1]: *** [tools/doc/node_modules] Error 1

This commit adds crypto check to these targets to allow the build to
pass.

PR-URL: https://github.com/nodejs/node/pull/22148
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2018-08-10 07:15:33 +02:00
Daniel Bevenius
d3d54aa8ef build: extract common parts from addon .buildstamp
This commit extracts common parts from the targets
test/addons/.buildstamp, and test/addons-napi/.buildstamp to reduce some
duplication.

PR-URL: https://github.com/nodejs/node/pull/22171
Reviewed-By: Jon Moss <me@jonathanmoss.me>
2018-08-10 05:38:29 +02:00
Joyee Cheung
0da144f4d4
tools: add make format-cpp to run clang-format on C++ diffs
This patch adds a `make format-cpp` shortcut to the Makefile
that runs clang-format on the C++ diffs, and a
`make format-cpp-build` to install clang-format from
npm.

To format staged changes:

```
$ make format-cpp
```

To format HEAD~1...HEAD (latest commit):

```
$ CLANG_FORMAT_START=`git rev-parse HEAD~1` make format-cpp
```

To format diff between master and current branch head (master...HEAD):

```
$ CLANG_FORMAT_START=master make format-cpp
```

Most of the .clang-format file comes from running

```
$ clang-format --dump-config --style=Google
```

with clang-format built with llvm/trunk 328768 (npm version 1.2.3)

The clang-format version is fixed because different version of
clang-format may format the files differently.

PR-URL: https://github.com/nodejs/node/pull/21997
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2018-08-03 19:40:23 +08:00
Anna Henningsen
02badc424f
test: remove test/gc, integrate into parallel
There’s no reason to have a separate addon just for
testing GC anymore.

PR-URL: https://github.com/nodejs/node/pull/22001
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-08-01 18:04:56 +02:00
Sam Ruby
f41dd5592e tools: produce JSON documentation using unified/remark/rehype
PR-URL: https://github.com/nodejs/node/pull/21697
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-07-25 21:33:06 +03:00
Rich Trott
b38b8d3b9d build: remove redundant Makefile target
The only target that uses the
`tools/doc/node_modules/js-yaml/package.json` target is `doc-only`. As a
result of a recent change, it has `tools/doc/node_modules` as a
prerequisite, which does the exact same npm install as
`tools/doc/node_modules/js-yaml/package.json`. Remove
`tools/doc/node_modules/js-yaml/package.json` as unnecessary.

PR-URL: https://github.com/nodejs/node/pull/21915
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2018-07-23 14:28:23 -07:00
Sam Ruby
946686521d tools: create HTML docs with unified/remark/rehype
PR-URL: https://github.com/nodejs/node/pull/21490
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2018-07-20 13:37:40 -07:00
Kenny Yuan
266c1f45a9 build: add new benchmark targets
Adding new build targets: 'bench-addons' & 'bench-addons-clean'. With
these two, it will be easier to manage the dependencies among targets
and easier to build/clean the addons which are being used in
benchmarking.

PR-URL: https://github.com/nodejs/node/pull/20905
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2018-07-19 20:00:44 -04:00
Rich Trott
fe67287306 build: move to npm ci where possible
Recent events (involving a maliciously published version of a popular
module's dependency) have reinvigorated my interest in seeing us move to
`npm ci` instead of `npm install`. This moves us to `npm ci` where
possible in Makefile and vcbuild.bat.

PR-URL: https://github.com/nodejs/node/pull/21802
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-07-19 13:49:14 -07:00
Anna Henningsen
31ecf630d0
build: account for pure C sources in build-addons-napi
PR-URL: https://github.com/nodejs/node/pull/21797
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-07-16 20:07:34 +02:00
Sam Ruby
0c743b5f77 tools: build all.json by combining generated JSON
Notes:

1) Removed a number of root properties that did not seem relevant:
   source, desc, and introduced_in.  There no longer is a source, and
   the other two are from the first include and do not reflect the
   entire API.

2) As with https://github.com/nodejs/node/issues/20100, the current
   "desc" properties sometimes contained in-page links, other times
   referenced another page, and often did not match the links in the
   original HTML or JSON file. I chose to standardize on external links
   as "desc" values are isolated snippets as opposed to all.html which
   can be viewed as a standalone and self contained document.

3) Eliminated preprocessing for @include entirely, including the test
   case for this function.

4) _toc.md was renamed to index.md.

5) index comments no longer appear in embedded TOCs (left hand side
   column in the generated documentation.

PR-URL: https://github.com/nodejs/node/pull/21637
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2018-07-09 22:57:33 +03:00
Kenny Yuan
3314b3a2f5 benchmark: add n-api function args benchmark
This benchmark suite is added to measure the performance of n-api
function call with various type/number of arguments. The cases in
this suite are carefully selected to efficiently show the performance
trend.

PR-URL: https://github.com/nodejs/node/pull/21555
Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com>
Reviewed-By: Kyle Farnung <kfarnung@microsoft.com>
2018-07-05 21:16:55 -04:00
Sam Ruby
f85962fe4d tools: build all.html by combining generated HTML
Combine the toc and api contents from the generated doc/api/*.html
files. This ensures that the single page version of the documentation
exactly matches the individual pages.

PR-URL: https://github.com/nodejs/node/pull/21568
Fixes: https://github.com/nodejs/node/issues/20100
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
2018-07-02 21:33:30 +03:00
Anna Henningsen
074e7f88af build: remove requirement to re-run ./configure
Instead of requiring `./configure` to be run again after
the file changed, first try to re-run the configure script
with the arguments with which it was originally run.

Usually, those arguments will either contain no flags,
or all flags that were passed are still supported.

PR-URL: https://github.com/nodejs/node/pull/21371
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
2018-06-29 13:09:25 -07:00
Joyee Cheung
4750ce26f2
build: speed up startup with V8 code cache
This patch speeds up the startup time and reduce the startup memory
footprint by using V8 code cache when comiling builtin modules.

The current approach is demonstrated in the `with-code-cache`
Makefile target (no corresponding Windows target at the moment).

1. Build the binary normally (`src/node_code_cache_stub.cc` is used),
  by now `internalBinding('code_cache')` is an empty object
2. Run `tools/generate_code_cache.js` with the binary, which generates
  the code caches by reading source code of builtin modules off source
  code exposed by `require('internal/bootstrap/cache').builtinSource`
  and then generate a C++ file containing static char arrays of the
  code cache, using a format similar to `node_javascript.cc`
3. Run `configure` with the `--code-cache-path` option so that
  the newly generated C++ file will be used when compiling the
  new binary. The generated C++ file will put the cache into
  the `internalBinding('code_cache')` object with the module
  ids as keys
4. The new binary tries to read the code cache from
  `internalBinding('code_cache')` and use it to compile
  builtin modules. If the cache is used, it will put the id
  into `require('internal/bootstrap/cache').compiledWithCache`
  for bookkeeping, otherwise the id will be pushed into
  `require('internal/bootstrap/cache').compiledWithoutCache`

This patch also added tests that verify the code cache is
generated and used when compiling builtin modules.

The binary with code cache:

- Is ~1MB bigger than the binary without code cahe
- Consumes ~1MB less memory during start up
- Starts up about 60% faster

PR-URL: https://github.com/nodejs/node/pull/21405
Reviewed-By: John-David Dalton <john.david.dalton@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Gus Caplan <me@gus.host>
2018-06-27 21:11:31 +08:00
Benjamin Coe
ba4f5e9bb9
build: fail on instrumentation errors
nyc was silently failing to instrument new language features,
resulting in a failure to instrument console.js.

Refs: https://github.com/nodejs/node/issues/20952
PR-URL: https://github.com/nodejs/node/pull/21071
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Rebecca Turner <me@re-becca.org>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
2018-06-25 16:28:27 -07:00
Anatoli Papirovski
6f63f8d730
test: remove outdated, non-functioning test
The timers directory test, utilizing FakeTime, has not worked in
quite a while and is not truly testing Node.js behaviour. If a
similar test is necessary it would be better suited to libuv
on which Node.js relies for timers functionality.

PR-URL: https://github.com/nodejs/node/pull/20894
Fixes: https://github.com/nodejs/node/issues/10154
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
2018-06-24 21:34:59 -07:00
Daniel Bevenius
6ced651b6c build: add crypto check to markdown lint target
Currently, if configured --without-ssl the following error will be
repored by remark-cli:

Running Markdown linter on misc docs...
internal/util.js:100
    throw new ERR_NO_CRYPTO();
    ^

Error [ERR_NO_CRYPTO]: Node.js is not compiled with OpenSSL crypto support
    at assertCrypto (internal/util.js💯11)
    at crypto.js:31:1
    at NativeModule.compile (internal/bootstrap/loaders.js:235:7)
    at Function.NativeModule.require
      (internal/bootstrap/loaders.js:155:18)
    at Function.Module._load (internal/modules/cjs/loader.js:530:25)
    at Module.require (internal/modules/cjs/loader.js:650:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.<anonymous>
      (/node/tools/remark-cli/node_modules/math-random/node.js:1:76)
    at Module._compile (internal/modules/cjs/loader.js:702:30)
    at Object.Module._extensions..js
      (internal/modules/cjs/loader.js:713:10)
make[1]: *** [tools/.miscmdlintstamp] Error 1
make: *** [lint] Error 2

This commit adds a check for crypto to avoid this error when node has
been configured without crypto support. The alternative was to try to
fix this in randomatic but that lead to another dependency failing
(uuid) and felt like this might be simpler.

PR-URL: https://github.com/nodejs/node/pull/21326
Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-06-24 06:47:37 +02:00
Rich Trott
d10742d891 benchmark: create napi benchmark directory
Move C++ benchmark useful for NAPI to its own directory. This will
isolate the benchmark so it can be excluded from testing that applies to
all other benchmarks but not this one.

PR-URL: https://github.com/nodejs/node/pull/21046
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2018-06-19 10:37:38 -07:00
Rich Trott
ff00a765dc tools: lint doc/*.md files
Makefile tasks only lint doc/**/*.md files but omit files that match
doc/*.md. This change adds these previously-omitted files to the list of
files to be linted.

PR-URL: https://github.com/nodejs/node/pull/21361
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2018-06-16 07:54:34 -07:00
Anna Henningsen
cea10baa22
build: build addon tests in parallel
Use a JS script to build addons rather than a shell command
embedded in the Makefile, because parallelizing is hard in sh
and easy in JS.

PR-URL: https://github.com/nodejs/node/pull/21155
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-06-11 20:09:28 +02:00
Ujjwal Sharma
2237a8e45d build: stop distclean from deleting v8 files
Stop `make distclean` from deleting files in the `deps/v8/testing/gmock`
folder, thus avoiding deleting version-controlled files important for
v8.

Fixes: https://github.com/nodejs/node/issues/21163

PR-URL: https://github.com/nodejs/node/pull/21164
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2018-06-08 23:09:31 -07:00
Kenny Yuan
e41ccd4e2d n-api: improve runtime perf of n-api func call
Added a new struct CallbackBundle to eliminate all
GetInternalField() calls.

The principle is to store all required data inside a C++ struct,
and then store the pointer in the JavaScript object. Before this
change, the required data are stored in the JavaScript object in
3 or 4 seperate pointers. For every napi fun call, 3 of them
have to be fetched out, which are 3 GetInternalField() calls;
after this change, the C++ struct will be directly fetched out
by using v8::External::Value(), which is faster.

Profiling data show that GetInternalField() is slow.
On an i7-4770K (3.50GHz) box, a C++ V8-binding fun call is 8 ns,
before this change, napi fun call is 36 ns; after this change,
napi fun call is 20 ns.

The above data are measured using a modified benchmark in
'benchmark/misc/function_call'. The modification adds an indicator
of the average time of a "chatty" napi fun call (max 50M runs).
This change will speed up chatty case 1.8x (overall), and will cut
down the delay of napi mechanism to approx. 0.5x.

Background: a simple C++ binding function (e.g. receiving little
from JS, doing little and returning little to JS) is called
'chatty' case for JS<-->C++ fun call routine.

This improvement also applies to getter/setter fun calls.

PR-URL: https://github.com/nodejs/node/pull/21072
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com>
2018-06-07 22:56:20 -04:00
Matheus Marchini
e1fc52d9e6
test: create new directory v8-updates
`v8-updates` holds all tests related to V8 updates, for example, testing
for postmortem metadata chages.

PR-URL: https://github.com/nodejs/node/pull/20783
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2018-06-06 11:10:12 -07:00
Myles Borins
1aa582a97c
tools: ensure doc-only doesn't update package-lock
Currently `make doc-only` is updating the package-lock.json
which is breaking our release build.

This adds the flags `--no-package-lock` when
running `npm install` to ensure the package-lock.json is not
changed unintentionally by running make

PR-URL: https://github.com/nodejs/node/pull/21015
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-06-06 14:29:07 +02:00
Benjamin Coe
16377146b6
test: fix tests that fail under coverage
Make test runner capable of skipping tests, which makes it possible
to skip the failing test/message/core_line_numbers.js test.

Make nyc no longer generate compact instrumentation (this causes
significantly different code output, which leads to failing test
assertions).

PR-URL: https://github.com/nodejs/node/pull/20794
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Khaidi Chu <i@2333.moe>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
2018-05-22 12:45:54 +04:00
Benjamin Coe
d5a117c73f
build: use nyc's merge command
a 'merge' command has recently been added to nyc, eliminating the need
for the istanbul-merge library.

PR-URL: https://github.com/nodejs/node/pull/20760
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-05-18 16:14:47 +02:00
Joyee Cheung
657723e5c0
build: always use BUILDTYPE binary to run JS tests
PR-URL: https://github.com/nodejs/node/pull/20362
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-05-14 21:53:50 +08:00
Ruben Bridgewater
c71b97303c
build: check for different deprecation signatures
Right now we strictly test for `DEP00XX`. We are already above that
number of deprecations and it is better to have a wildcard for the
first three numbers. Only the last character has to match the X to
print a warning.

PR-URL: https://github.com/nodejs/node/pull/20384
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2018-05-05 13:50:17 +02:00
Vse Mozhet Byt
ad6a65ba11 tools: simplify HTML generation
PR-URL: https://github.com/nodejs/node/pull/20307
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-04-28 00:52:25 +03:00
Rich Trott
7424d86523 build: use -9 with kill in Makefile
Fixes: https://github.com/nodejs/node/issues/20194

PR-URL: https://github.com/nodejs/node/pull/20195
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-04-24 11:47:03 -07:00
Chris Miller
8786889656
build: normalise test.py calls to use PARALLEL_ARGS
PR-URL: https://github.com/nodejs/node/pull/20124
Fixes: https://github.com/nodejs/node/issues/20065
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-04-23 16:00:51 +02:00
Michaël Zasso
3e6ff85894
tools: fix make test-v8
PR-URL: https://github.com/nodejs/node/pull/19201
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-04-11 13:23:27 -04:00
Joyee Cheung
dd49677096
build: update node.gyp to reference gypfiles/v8.gyp
Refs: f9934aa9cf
Fixes: https://github.com/nodejs/node-v8/issues/36

PR-URL: https://github.com/nodejs/node/pull/19201
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-04-11 13:23:19 -04:00
Joyee Cheung
2f8df6b0f2
build: introduce make jstest
Add a `make jstest` target that runs tests written in JavaScript
(excluding documentation tests which are run in `make test-doc`).

PR-URL: https://github.com/nodejs/node/pull/19324
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Matheus Marchini <matheus@sthima.com>
2018-04-04 13:45:34 +08:00
Rod Vagg
c5928ab631 build: make lint-ci work properly on Linux make
PR-URL: https://github.com/nodejs/node/pull/19746
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2018-04-03 20:44:29 +10:00
Rich Trott
f05eaa4a53
build: lint .eslintrc.js file
Update default files to be linted with ESLint to include .eslintrc.js.

PR-URL: https://github.com/nodejs/node/pull/19122
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Khaidi Chu <i@2333.moe>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-03-06 09:30:57 +01:00
Michael Dawson
29697ef3de build: fix gocvr version used for coverage
Fix the gcovr version to a fixed version and uses patches
specific to that version. This avoids us being broken by
changes in the gcovr repo. Using file name for patches
specific to the version level will allow us to move up when
necessary without breaking coverage for earlier versions
of Node.js

PR-URL: https://github.com/nodejs/node/pull/19094
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
2018-03-05 11:06:37 -05:00
killagu
3f78d3fcf8 build: fix coverage after gcovr update
PR-URL: https://github.com/nodejs/node/pull/18958
Fixes: https://github.com/nodejs/node/issues/18938
Ref: https://github.com/nodejs/build/pull/1145
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
2018-02-28 11:46:34 -05:00
Joyee Cheung
0bff955b6d
build: fix lint-md-build dependency
PR-URL: https://github.com/nodejs/node/pull/18981
Fixes: https://github.com/nodejs/node/issues/18978
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-02-27 18:56:46 +08:00
Gus Caplan
6934792eb3 lint: move eslint to new plugin system
PR-URL: https://github.com/nodejs/node/pull/18566
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
2018-02-20 13:13:22 -06:00
Joyee Cheung
b50571602a
build: do not suppress output in make doc-only
This helps to show the cause of errors in the CI.

PR-URL: https://github.com/nodejs/node/pull/18507
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-02-08 17:56:07 +08:00
Camilo Gonzalez
0548034272 build: add doc linting when runnning make lint
Fixes: https://github.com/nodejs/node/issues/18466

PR-URL: https://github.com/nodejs/node/pull/18472
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2018-02-06 11:29:18 +01:00
Yihong Wang
a89d215b79 build: fix coverage build
After adding the node_lib target in node.gyp, most of the node source
files are moved to that target. When coverage option is enabled,
corresponding cflags and ldflags are needed in that target as well.
gcovr also needs to check .gcda data for both node and node_lib.

PR-URL: https://github.com/nodejs/node/pull/18409
Fixes: https://github.com/nodejs/node/issues/18402
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2018-02-02 10:07:25 -05:00
Ben Noordhuis
09ef021bf4 build: fix rm commands in tarball rule
The `$(RM) {foo,bar,baz}` rules don't seem to work with GNU make 4.1.
Write them out in full and get rid of a few overlong lines in the
process.

PR-URL: https://github.com/nodejs/node/pull/18332
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
2018-01-26 16:32:52 -05:00
Ben Noordhuis
56ee94f184
build: compile V8 using system compiler
Stop using the copy of clang that is bundled with Google's build tools
and start using the compiler that is installed on the buildbots.
It stopped working on one of the machines because it looked in the
wrong place for system headers and is not representative of how users
build Node.js on their systems.

PR-URL: https://github.com/nodejs/node/pull/17489
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
2018-01-24 15:02:41 -08:00
Michaël Zasso
e9bcb39ef2
build: remove --no-i18n from V8 test options
The option was removed in [1] to use compiler option instead.

[1]: 0b9acc20e2

PR-URL: https://github.com/nodejs/node/pull/17489
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
2018-01-24 15:02:38 -08:00
Rod Vagg
57bd27eda8 Revert "build,test: make building addon tests less fragile"
This reverts commit d9b59def72.

Breaks downloadable source tarball builds as we remove some files prior
to creating a tarball but those files are included in the comprehensive
list of dependencies listed in .deps.

Ref: https://github.com/nodejs/node/pull/17407
PR-URL: https://github.com/nodejs/node/pull/18287
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2018-01-25 08:18:24 +11:00
Rod Vagg
d5d024d6ec Revert "build,tools: check freshness of doc addons"
This reverts commit 2cb9e2a6f7.

Reverted along with d9b59def7 as this introduces freshness checks that
are too stringent without the comprehensive dependency checking of
introduced in d9b59def7 so `make test` won't work with this.

Ref: https://github.com/nodejs/node/pull/17407
PR-URL: https://github.com/nodejs/node/pull/18287
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2018-01-25 08:17:53 +11:00
Joyee Cheung
13bc53fb26
build: make lint-js independent of local node
PR-URL: https://github.com/nodejs/node/pull/18272
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-01-24 03:49:54 +08:00
Joyee Cheung
be0778b361
build: make lint-md independent of local node
PR-URL: https://github.com/nodejs/node/pull/18272
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-01-24 03:49:42 +08:00
Ben Noordhuis
2cb9e2a6f7
build,tools: check freshness of doc addons
Add a `--check` flag to `tools/doc/addon-verify.js` and use that in the
`make test` target to determine if the generated files in `test/addons`
are fresh or stale.

PR-URL: https://github.com/nodejs/node/pull/17407
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2018-01-21 02:19:47 +01:00
Ben Noordhuis
d9b59def72
build,test: make building addon tests less fragile
* Get rid of recursive `make` when building the node binary.  An earlier
  commit makes GYP write out rules that we can use for proper dependency
  tracking.

* Use module name 'binding' in addons.md and addons-napi/*/binding.gyp.
  This massively simplifies the logic for generating the build rules.

* Check in auto-generated add-on tests from `doc/api/addons.md`.  The
  files change rarely and generating them dynamically causes no end of
  race conditions and special-casing during the build.

PR-URL: https://github.com/nodejs/node/pull/17407
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2018-01-21 02:19:46 +01:00
Joyee Cheung
0c8aaf318a
build: remove bench-* targets
PR-URL: https://github.com/nodejs/node/pull/18150
Fixes: https://github.com/nodejs/node/issues/17053
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2018-01-17 02:30:31 +08:00
Michael Dawson
8229fc0715 src: fix code coverage cleanup
In https://github.com/nodejs/node/pull/17987 which updated
the location of the code coverage patches I missed a few
changes needed to properly clean up for code coverage.  Add
these.

PR-URL: https://github.com/nodejs/node/pull/18081
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-01-16 10:50:46 -05:00
Michaël Zasso
3dc3063275 tools: move eslint from tools to tools/node_modules
This is required because we need to add the babel-eslint dependency
and it has to be able to resolve "eslint".
babel-eslint is required to support future ES features such as async
iterators and import.meta.

Refs: https://github.com/nodejs/node/pull/17755
PR-URL: https://github.com/nodejs/node/pull/17820
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2018-01-11 09:48:05 +01:00
Yang Guo
a2c7085dd4 build: fix Makefile wrt finding node executable
Not all shells set PWD, so use CURDIR instead.

`which node` may return the empty string, so guard against
that too. Consider:
if [ -x `which velociraptor` ] && [ -e `which velociprator` ];\
then echo "run"; else echo "keep calm"; fi;

PR-URL: https://github.com/nodejs/node/pull/18040
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2018-01-11 07:52:21 +01:00
Joyee Cheung
d64279b4ee
build: document targets in the Makefile
PR-URL: https://github.com/nodejs/node/pull/16975
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
2018-01-09 17:07:19 +08:00
Michael Dawson
c91bd2f24f src: update make for new code coverage locations
The files for code coverage are moving to the build
repository.  Update the references to reflect this.

PR-URL: https://github.com/nodejs/node/pull/17987
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Khaidi Chu <i@2333.moe>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-01-08 18:20:13 -05:00
Oky Antoro
feaf6ac3dc
build: put .PHONY directly before its target
Before this change, the .PHONY is followed by multiple targets.
Now it is multiple .PHONY for each target.

PR-URL: https://github.com/nodejs/node/pull/17964
Refs: https://github.com/nodejs/node/issues/16968
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-01-05 12:52:49 +01:00
Rich Trott
f05fb0104a build: remove duplicate async-hooks and known_issues test runs
The `default` test suite in `test.py` includes `async-hooks` and
`known_issues`. Our current setup results in those test suites being run
twice during each CI run. Remove the duplication.

PR-URL: https://github.com/nodejs/node/pull/17912
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-01-02 20:50:14 -08:00
Refael Ackermann
51a7d97625
tools: don't lint-md as part of main lint target
PR-URL: https://github.com/nodejs/node/pull/17587
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2017-12-11 11:53:28 -05:00
Gibson Fahnestock
d865395b7d
build: add a make help option for common targets
PR-URL: https://github.com/nodejs/node/pull/17323
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2017-12-09 08:04:59 +00:00
Michaël Zasso
6c47033024
build: fix test-v8 target
Clean the deps/v8 directory before rebuilding node for the hash seed
test. It is necessary to avoid the script added in [1] to use ignored
files while generating `node-debug-support.cc`.

[1]: https://github.com/nodejs/node/pull/14901

PR-URL: https://github.com/nodejs/node/pull/17269
Fixes: https://github.com/nodejs/node-v8/issues/26
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
2017-11-29 10:46:54 +09:00
Joyee Cheung
7dc24062fc
build: add make lint-js-fix
PR-URL: https://github.com/nodejs/node/pull/17283
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2017-11-28 02:42:29 +01:00
Richard Littauer
887e2327ee
tools: fix gitignore for tools/doc/
PR-URL: https://github.com/nodejs/node/pull/17224
Fixes: https://github.com/nodejs/node/issues/17216
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2017-11-24 10:24:37 -05:00
Anatoli Papirovski
c6b7052bb7 test: keep coverage reports after coverage-clean
Add coverage folder to .gitignore and remove it from the list
of files & folders delete by coverage-clean.

PR-URL: https://github.com/nodejs/node/pull/15470
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2017-11-22 13:11:43 -08:00
Joyee Cheung
289fcb05be
build: do not build doc in source tarball
PR-URL: https://github.com/nodejs/node/pull/17100
Fixes: https://github.com/nodejs/node/issues/16650
Reviewed-By: Refael Ackermann <refack@gmail.com>
2017-11-20 21:38:50 +08:00
Joyee Cheung
c5b8e168b3
build: enforce order of dependency when building addons
PR-URL: https://github.com/nodejs/node/pull/17048
Fixes: https://github.com/nodejs/node/issues/17043
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2017-11-18 20:33:31 +01:00
Joyee Cheung
f24d9619ff
tools: try installing js-yaml only once
PR-URL: https://github.com/nodejs/node/pull/16661
Fixes: https://github.com/nodejs/node/issues/16650
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2017-11-17 21:43:31 +08:00
Daniel Bevenius
9ae81b9cb9 Revert "build: for --enable-static, run only cctest"
This reverts commit a36b540502.

PR-URL: https://github.com/nodejs/node/pull/14986
Refs: https://github.com/nodejs/node/issues/14158
Refs: https://github.com/nodejs/node/pull/14892
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
2017-11-16 09:22:13 +01:00
Daniel Bevenius
a0b1e2eca6 build: prevent echoing of recipes for test target
Currenlty the test target will echo additional information that might
not be that useful, for example:
make doc-only
make[1]: Nothing to be done for `doc-only'.
make lint
Running JS linter...
Running C++ linter...
Total errors found: 0
make[2]: Nothing to be done for `lint-md'.
Running C++ linter on addon docs...
Total errors found: 0
make cctest

This commit suggests reducing this to:
make -s doc-only
make -s lint
Running JS linter...
Running C++ linter...
Running C++ linter on addon docs...
Total errors found: 0
make -s cctest

PR-URL: https://github.com/nodejs/node/pull/17010
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2017-11-16 08:33:22 +01:00
Refael Ackermann
e6245030b1
tools,build: allow build without remark-cli
PR-URL: https://github.com/nodejs/node/pull/16893
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2017-11-10 17:09:28 -05:00
Joyee Cheung
eebcb481c2 tools: don't lint files that have not changed
PR-URL: https://github.com/nodejs/node/pull/16581
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
2017-11-08 16:25:00 +08:00
Gibson Fahnestock
60d055e224
build: suppress lint-md output
We don't need to print out the output if we've already installed it, at
the same time we do want to see some output when we haven't installed.

PR-URL: https://github.com/nodejs/node/pull/16551
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Khaidi Chu <i@2333.moe>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
2017-11-02 22:28:30 +00:00
Joyee Cheung
390eda100d build: make test-doc and lint addon docs
- Implements the make test-doc target that build, verify
  and lint docs
- Lint the C++ snippets in addon docs
- When generating addons and running the JS linter,
  use the global node executable if it is not built.
  Therefore one does not have to build node in order to
  run make test-doc.

PR-URL: https://github.com/nodejs/node/pull/16377
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
2017-10-30 17:28:07 +08:00
Daniel Bevenius
6f684d9578 build: make doc target quiet
Currently it can be a little difficult to detect errors in the output
from the doc target. This commit suggests reducing the output to make it
easier to identify errors.

PR-URL: https://github.com/nodejs/node/pull/16516
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2017-10-30 07:14:35 +01:00
Anna Henningsen
65d2067936
build: ignore empty folders in test-addons-napi
The same as https://github.com/nodejs/node/pull/16031 except
for N-API addons.

PR-URL: https://github.com/nodejs/node/pull/16380
Fixes: https://github.com/nodejs/node/issues/13521
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2017-10-29 23:06:18 +01:00
Joyee Cheung
2875459972 build: run linter before running tests
PR-URL: https://github.com/nodejs/node/pull/16284
Fixes: https://github.com/node/issues/16283
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2017-10-29 10:49:43 +08:00
Refael Ackermann
9ab648120c
build: improve make clean
also undocument the `vcbuild.bat` command since it's broken
and seems to only be relevant to release builds

PR-URL: https://github.com/nodejs/node/pull/16372
Refs: https://github.com/nodejs/node/pull/16010
Refs: https://github.com/nodejs/node/issues/16278
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-10-26 18:38:36 -04:00
Daijiro Wachi
a399881773 tools: add make lint-md-clean
PR-URL: https://github.com/nodejs/node/pull/12756
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2017-10-25 21:13:57 +02:00
Daijiro Wachi
212f4b981d build: add lint-md-build
PR-URL: https://github.com/nodejs/node/pull/12756
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2017-10-25 21:13:49 +02:00
Daijiro Wachi
f1329543d6 tools: add lint-md command in Makefile
PR-URL: https://github.com/nodejs/node/pull/12756
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2017-10-25 21:13:22 +02:00
Rich Trott
d6ba14e5a5 build: use doc-only instead of doc
Use `make doc-only` instead of `make doc` where applicable.

PR-URL: https://github.com/nodejs/node/pull/16309
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2017-10-19 09:10:40 -07:00
Rich Trott
c9d5be4af0 test: fix flaky test-make-doc
`test-make-doc` fails in CI on Raspberry Pi devices where `test-ci-js`
runs the test but does not build the docs. We do not want to build the
docs in these cases. Move the test to the `doctool` suite and add that
suite to `IGNORED_SUITES` in `test.py`. Specify `doctool` as a test
suite to run with `make test` or `make test-ci` but not with the
`make test-ci-js` job run on cross-compiled fanned CI tests like we do
with Raspberry Pi devices in CI.

PR-URL: https://github.com/nodejs/node/pull/16301
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-10-19 09:07:51 -07:00
Gibson Fahnestock
532d8b24fd
test: update test-npm to use test-npm-package.js
Deletes the old test-npm.sh script.

PR-URL: https://github.com/nodejs/node/pull/11540
Refs: https://github.com/nodejs/node/pull/7867
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
2017-10-19 12:06:04 +01:00
Evan Lucas
a0785845bf build: add c++ coverage support on macOS
macOS requires passing the --coverage flag in OTHER_LDFLAGS and
OTHER_CFLAGS in xcode_settings.

PR-URL: https://github.com/nodejs/node/pull/16163
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Khaidi Chu <i@2333.moe>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2017-10-18 13:51:31 -05:00
Joyee Cheung
df5dc2da39 test: test make doc and verify toc
PR-URL: https://github.com/nodejs/node/pull/16208
Fixes: https://github.com/nodejs/build/issues/887
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
2017-10-18 20:24:22 +08:00
Jon Moss
978629ca12
test: move inspector tests to parallel/sequential
* remove inspector directory artifacts

PR-URL: https://github.com/nodejs/node/pull/16197
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-10-17 19:35:50 -04:00
Ben Noordhuis
411695e1d2 build: lint benchmark addon
PR-URL: https://github.com/nodejs/node/pull/16160
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
2017-10-15 12:07:32 +08:00
Ben Noordhuis
4157342744 build: use local node-gyp for benchmark addon
Move the logic for building the benchmark/misc/function_call to
the top-level Makefile and use our local copy of node-gyp.

PR-URL: https://github.com/nodejs/node/pull/16160
Fixes: https://github.com/nodejs/node/issues/16154
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
2017-10-15 12:06:56 +08:00
Refael Ackermann
88d05aa43b
build: restore mistakenly dropped suites
suites dropped during the last commit by a typo
restore $(CI_JS_SUITES) to test-ci-js
restore $(CI_NATIVE_SUITES) for `test-ci`
and var assignment tweak

PR-URL: https://github.com/nodejs/node/pull/16132
Fixes: https://github.com/nodejs/node/issues/16129
Fixes: https://github.com/nodejs/build/issues/910
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Benjamin E. Coe <ben@npmjs.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2017-10-12 10:56:12 -04:00
Gregor
7da45f87da build: ignore empty folders in test-addons
Fixes: https://github.com/nodejs/node/issues/14843
PR-URL: https://github.com/nodejs/node/pull/16031
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-10-11 16:03:48 -04:00
Benjamin Coe
5be4dfaa13
test: make it easier to run tests for subsystems
You can now run suites for subsystem using shorthand, e.g., http.
Switch to black-list of default test folders from white-list.
Tests run by 'make test', 'make coverage', etc., now configurable.
Stop running known_issues suite when collecting test coverage.

PR-URL: https://github.com/nodejs/node/pull/15450
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-10-01 20:30:48 -03:00
JP Wesselink
03954f778e
tools, build: refactor macOS installer
Creates macOS pkg installer by using `pkgbuild` and `productbuild`.
Removes previous npm installation before installing npm.
Packages carry correct version attributes.
Support for intl installer features, defaults to `en`.
Fancy formatted license.
Renamed `osx` references to `macOS`.
Optional installation of npm.

PR-URL: https://github.com/nodejs/node/pull/15179
Fixes: https://github.com/nodejs/node/issues/15012
Refs: https://github.com/nodejs/node/pull/5656
Refs: https://github.com/nodejs/node/pull/2571
Refs: https://github.com/nodejs/node/pull/7097
Reviewed-By: Lance Ball <lball@redhat.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2017-09-28 02:05:59 -03:00
Benjamin Coe
a1b6cfd362
build: run es-module tests in CI
Add es-module to CI_JS_SUITES/js_test_suites, so that tests run in CI.
Update test/README adding es-module section.

PR-URL: https://github.com/nodejs/node/pull/15276
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
2017-09-27 21:46:24 -04:00
Trevor Norris
4321206c5b
build: add test-with-async-hooks
The new test-with-async-hooks runs all normal tests (except async-hooks)
with the environment variable NODE_TEST_WITH_ASYNC_HOOKS set. These
extra checks do a minimum check to make sure async_hooks operates
normally under all other tests. e.g. if init() or destroy() is called
twice for the same id.

Also move test "async-hooks" from CI_JS_SUITES into its own
CI_ASYNC_HOOKS. Makes it cleaner to add, instead of supplying a massive
list of tests that may change in the future.

PR-URL: https://github.com/nodejs/node/pull/14208
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
2017-09-27 04:14:47 -06:00
Nikolai Vavilov
b2eb98721e
build: use generic names for linting tasks
"jslint" is the name of a tool that actually is not used, which can
cause confusion.

PR-URL: https://github.com/nodejs/node/pull/15272
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
2017-09-24 12:31:52 -03:00
Gibson Fahnestock
66e45b821a
build: don't fail make test on source tarballs
Tries to achieve the same effect as
https://github.com/nodejs/node/pull/13658 without breaking source
tarballs. Presumably if `tools/eslint` wasn't there at all, people
would notice in the PR review!

PR-URL: https://github.com/nodejs/node/pull/15441
Fixes: https://github.com/nodejs/node/issues/14513
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-09-21 19:23:36 -03:00
Rich Trott
d38e643409
test: remove obsolete debugger tests
The tests in `test/debugger` all fail since the removal of the
pre-inspector debugger (if they weren't already failing). They do not
run in CI (probably because they were never reliable). Remove them and
associated fixtures.

PR-URL: https://github.com/nodejs/node/pull/15139
Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-09-13 17:58:38 -03:00
Benjamin Coe
e9442d1582
test: exclude write-coverage from coverage report
Added a .nyrc configuration file that can be used to configure
test coverage.

Added an exclude rule that removes write-coverage.js from coverage
reports.

Pulled reporter configuration into .nycrc and added an additional
text reporter.

PR-URL: https://github.com/nodejs/node/pull/15194
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2017-09-08 00:31:57 -03:00
Simon Brewster
9168b8cf47
test: use no-save and no-package-lock flags
Use these flags when running make coverage so that a package-lock.json
file is not generated and npm does not attempt to save the deps to a
non-existent package.json file.

PR-URL: https://github.com/nodejs/node/pull/15196
Refs: https://github.com/nodejs/node/pull/15190/files#r136932786
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2017-09-08 00:26:19 -03:00
Bradley Farias
c8a389e19f module: Allow runMain to be ESM
This follows the EPS an allows the node CLI to have ESM as an entry point.
`node ./example.mjs`. A newer V8 is needed for `import()` so that is not
included. `import.meta` is still in specification stage so that also is not
included.

PR-URL: https://github.com/nodejs/node/pull/14369
Author: Bradley Farias <bradley.meck@gmail.com>
Author: Guy Bedford <guybedford@gmail.com>
Author: Jan Krems <jan.krems@groupon.com>
Author: Timothy Gu <timothygu99@gmail.com>
Author: Michaël Zasso <targos@protonmail.com>
Author: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2017-09-07 15:18:32 -05:00
Rich Trott
70c775a810 test: run abort tests
Currently, tests in test/abort do not run in CI.

This change configures the test runner to not write core files for abort
tests and to run them.

PR-URL: https://github.com/nodejs/node/pull/14013
Fixes: https://github.com/nodejs/node/issues/14012
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2017-08-26 16:30:35 -07:00
Daniel Bevenius
a36b540502 build: for --enable-static, run only cctest
Currently when building with --enable-static and running the test target
the following error will be reported:
Building addon
/node/test/addons/01_function_arguments/
env: ./node: No such file or directory
make[1]: *** [test/addons/.buildstamp] Error 1

Note that this is with a clean build where no prior node executable was
built.

This commit suggests only running the cctest target when --enable-static
is specified.

PR-URL: https://github.com/nodejs/node/pull/14892
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Lance Ball <lball@redhat.com>
2017-08-24 05:52:23 +02:00
Jon Moss
8850fd4da1 build: allow proper generation of html docs
`gen-doc` always calls `gen-json`, which means it's impossible to
generate html docs. Changed this to pass in the command the user wants
to run.

PR-URL: https://github.com/nodejs/node/pull/14932
Fixes: https://github.com/nodejs/node/issues/14930
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2017-08-21 14:17:11 +02:00
Anna Henningsen
491cc76871
src: use unordered_set instead of custom rb tree
Use a standard hash-based container instead of the custom included
red/black tree implementation. There is likely no noticeable
performance difference, and if there is one, it is very likely
to be an improvement.

PR-URL: https://github.com/nodejs/node/pull/14826
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2017-08-17 20:26:59 +02:00
Ruslan Bekenev
2710616d53 build: remove duplicated code
Makefile contains copy-pasted code in some targets and this commit
aims to remove it.

PR-URL: https://github.com/nodejs/node/pull/13482
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Kunal Pathak <kunal.pathak@microsoft.com>
2017-08-16 17:04:23 +02:00
James M Snell
eac0147085 tools: checkout for unassigned DEP00XX codes
Check for `DEP00XX` codes on release build like we do with `REPLACEME`

PR-URL: https://github.com/nodejs/node/pull/14702
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2017-08-16 00:04:03 -07:00
jeyanthinath
e88908d868
build: enable C++ linting for src/*/*
Fixes: https://github.com/nodejs/node/issues/14490
PR-URL: https://github.com/nodejs/node/pull/14497
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Khaidi Chu <i@2333.moe>
Reviewed-By: Refael Ackermann <refack@gmail.com>
2017-08-07 10:16:30 +08:00
Evan Lucas
e36166bd18 build: codesign tarball binary on macOS
Previously, we were signing the binary that was released in the .pkg,
but not the binary released in the tarball.

PR-URL: https://github.com/nodejs/node/pull/14179
Fixes: https://github.com/nodejs/node/issues/11936
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-07-19 16:38:32 -05:00
Evan Lucas
2309f3aaa6 build,tools: do not force codesign prefix
Allow passing the prefix in via the PKGDIR env var. This will allow us
to use this same script to codesign the binary tarball.

PR-URL: https://github.com/nodejs/node/pull/14179
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-07-19 16:38:27 -05:00
Michaël Zasso
016d81ceec
build: run test-hash-seed at the end of test-v8
The v8 and test-hash-seed targets cannot be run in parallel because they
need different copies of the deps/v8 directory.

Ref: https://github.com/nodejs/node/pull/14004#issuecomment-314774773
PR-URL: https://github.com/nodejs/node/pull/14219
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2017-07-14 23:47:09 +08:00
Ali Ijaz Sheikh
9fedc1f096
test: verify hash seed uniqueness
This tests that the hash seed used by V8 for hashing is random.

PR-URL: https://github.com/nodejs/node-private/pull/84
Reviewed-By: bnoordhuis - Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: mhdawson - Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: indutny - Fedor Indutny <fedor.indutny@gmail.com>
2017-07-11 17:47:37 +01:00
Rich Trott
22436b055d build: check for linter in bin rather than lib
Make the "can we lint?" check in Makefile and vcbuild.bat depend on
bin/eslint.js rather than lib/eslint.js. In ESLint 4.0.0, lib/eslint.js
is not present. The lint rules call bin/eslint.js so check for that
instead.

PR-URL: https://github.com/nodejs/node/pull/13645
Reviewed-By: Teddy Katz <teddy.katz@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-06-17 12:56:50 -07:00
Gibson Fahnestock
b7473c2117 build: fail linter if linting not available
PR-URL: https://github.com/nodejs/node/pull/13658
Ref: https://github.com/nodejs/node/pull/13645#issuecomment-308100452
Reviewed-By: João Reis <reis@janeasystems.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2017-06-16 09:34:34 -07:00