summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorDaniel Bevenius <daniel.bevenius@gmail.com>2019-06-27 05:17:43 +0200
committerDaniel Bevenius <daniel.bevenius@gmail.com>2019-08-12 12:56:43 +0200
commitb4f0a18b5a717b10d2d1c98e7aba85f0ac33aa68 (patch)
treee65eeaac66d8ba684321de744adda7cdc5c1053d /Makefile
parent2103ae483547831281e1e3882029e37d445689a7 (diff)
downloadandroid-node-v8-b4f0a18b5a717b10d2d1c98e7aba85f0ac33aa68.tar.gz
android-node-v8-b4f0a18b5a717b10d2d1c98e7aba85f0ac33aa68.tar.bz2
android-node-v8-b4f0a18b5a717b10d2d1c98e7aba85f0ac33aa68.zip
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>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile6
1 files changed, 6 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 1e4915a6d2..b18facf08e 100644
--- a/Makefile
+++ b/Makefile
@@ -294,6 +294,10 @@ jstest: build-addons build-js-native-api-tests build-node-api-tests ## Runs addo
$(CI_JS_SUITES) \
$(CI_NATIVE_SUITES)
+.PHONY: tooltest
+tooltest:
+ @$(PYTHON) test/tools/test-js2c.py
+
.PHONY: coverage-run-js
coverage-run-js:
$(RM) -r out/$(BUILDTYPE)/.coverage
@@ -311,6 +315,7 @@ test: all ## Runs default tests, linters, and builds docs.
$(MAKE) -s build-node-api-tests
$(MAKE) -s cctest
$(MAKE) -s jstest
+ $(MAKE) -s tooltest
.PHONY: test-only
test-only: all ## For a quick test, does not run linter or build docs.
@@ -319,6 +324,7 @@ test-only: all ## For a quick test, does not run linter or build docs.
$(MAKE) build-node-api-tests
$(MAKE) cctest
$(MAKE) jstest
+ $(MAKE) tooltest
# Used by `make coverage-test`
test-cov: all