0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-30 07:27:22 +01:00
Commit Graph

647 Commits

Author SHA1 Message Date
Joyee Cheung
54a0553a9f build: do not indent assignments in Makefile
Indented assignment in a Makefile can be interpreted
as a command in e.g. GNU Make 3.81 which results in the
following error:

```
make: CPPLINT_QUIET: No such file or directory
```

PR-URL: https://github.com/nodejs/node/pull/29623
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2019-09-22 16:57:31 -07:00
Anna Henningsen
ac59dc42ed
http: remove legacy parser
Remove the legacy `http_parser` implementation as a dependency
and all code that uses it in favor of llhttp, given that the latter
has been the default for all of Node 12 with no outstanding issues.

PR-URL: https://github.com/nodejs/node/pull/29589
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2019-09-20 20:18:35 +02:00
Anna Henningsen
03eec137a2
build: re-run configure on node_version.h change
Fixes: https://github.com/nodejs/node/issues/29509

PR-URL: https://github.com/nodejs/node/pull/29510
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2019-09-12 19:05:10 +02:00
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