From c8df5cf74a2b495ccbc8b25a29c1692391c505f3 Mon Sep 17 00:00:00 2001 From: Richard Lau Date: Wed, 16 Oct 2019 13:47:02 -0400 Subject: [PATCH] build: build benchmark addons like test addons Build the addons for benchmarks in the same way that the addons for tests are built. PR-URL: https://github.com/nodejs/node/pull/29995 Fixes: https://github.com/nodejs/build/issues/1961 Refs: https://github.com/nodejs/node/commit/53ca0b9ae145c430842bf78e553e3b6cbd2823aa#commitcomment-35494896 Reviewed-By: Anna Henningsen Reviewed-By: Rich Trott Reviewed-By: Beth Griggs Reviewed-By: Jiawen Geng --- Makefile | 36 ++++++++++++++--------------------- benchmark/napi/ref/.gitignore | 1 + 2 files changed, 15 insertions(+), 22 deletions(-) create mode 100644 benchmark/napi/ref/.gitignore diff --git a/Makefile b/Makefile index 87afe29b46828f..53dea85eb8f553 100644 --- a/Makefile +++ b/Makefile @@ -347,24 +347,6 @@ test-valgrind: all test-check-deopts: all $(PYTHON) tools/test.py $(PARALLEL_ARGS) --mode=$(BUILDTYPE_LOWER) --check-deopts parallel sequential -benchmark/napi/function_call/build/$(BUILDTYPE)/binding.node: \ - benchmark/napi/function_call/napi_binding.c \ - benchmark/napi/function_call/binding.cc \ - benchmark/napi/function_call/binding.gyp | all - $(NODE) deps/npm/node_modules/node-gyp/bin/node-gyp rebuild \ - --python="$(PYTHON)" \ - --directory="$(shell pwd)/benchmark/napi/function_call" \ - --nodedir="$(shell pwd)" - -benchmark/napi/function_args/build/$(BUILDTYPE)/binding.node: \ - benchmark/napi/function_args/napi_binding.c \ - benchmark/napi/function_args/binding.cc \ - benchmark/napi/function_args/binding.gyp | all - $(NODE) deps/npm/node_modules/node-gyp/bin/node-gyp rebuild \ - --python="$(PYTHON)" \ - --directory="$(shell pwd)/benchmark/napi/function_args" \ - --nodedir="$(shell pwd)" - DOCBUILDSTAMP_PREREQS = tools/doc/addon-verify.js doc/api/addons.md ifeq ($(OSTYPE),aix) @@ -470,6 +452,17 @@ test/node-api/.buildstamp: $(ADDONS_PREREQS) \ # TODO(bnoordhuis) Force rebuild after gyp or node-gyp update. build-node-api-tests: | $(NODE_EXE) test/node-api/.buildstamp +BENCHMARK_NAPI_BINDING_GYPS := $(wildcard benchmark/napi/*/binding.gyp) + +BENCHMARK_NAPI_BINDING_SOURCES := \ + $(wildcard benchmark/napi/*/*.c) \ + $(wildcard benchmark/napi/*/*.cc) \ + $(wildcard benchmark/napi/*/*.h) + +benchmark/napi/.buildstamp: $(ADDONS_PREREQS) \ + $(BENCHMARK_NAPI_BINDING_GYPS) $(BENCHMARK_NAPI_BINDING_SOURCES) + @$(call run_build_addons,"$$PWD/benchmark/napi",$@) + .PHONY: clear-stalled clear-stalled: @echo "Clean up any leftover processes but don't error if found." @@ -1163,13 +1156,12 @@ bench: bench-addons-build # Build required addons for benchmark before running it. .PHONY: bench-addons-build -bench-addons-build: benchmark/napi/function_call/build/$(BUILDTYPE)/binding.node \ - benchmark/napi/function_args/build/$(BUILDTYPE)/binding.node +bench-addons-build: | $(NODE_EXE) benchmark/napi/.buildstamp .PHONY: bench-addons-clean bench-addons-clean: - $(RM) -r benchmark/napi/function_call/build - $(RM) -r benchmark/napi/function_args/build + $(RM) -r benchmark/napi/*/build + $(RM) benchmark/napi/.buildstamp .PHONY: lint-md-rollup lint-md-rollup: diff --git a/benchmark/napi/ref/.gitignore b/benchmark/napi/ref/.gitignore new file mode 100644 index 00000000000000..567609b1234a9b --- /dev/null +++ b/benchmark/napi/ref/.gitignore @@ -0,0 +1 @@ +build/