From 7cbc472ed58d361f00f5124f777165bbf8376fdc Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Tue, 18 Jan 2022 19:05:06 +0100 Subject: [PATCH] tools: add missing `.PHONY` and `.NOTPARALLEL` targets in `Makefile` PR-URL: https://github.com/nodejs/node/pull/41515 Reviewed-By: Richard Lau Reviewed-By: Darshan Sen Reviewed-By: James M Snell Reviewed-By: Yash Ladha --- Makefile | 46 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 688ebc550e9d66..313abefc90b12b 100644 --- a/Makefile +++ b/Makefile @@ -171,6 +171,7 @@ uninstall: ## Uninstalls node from $PREFIX (default=/usr/local). $(PYTHON) tools/install.py $@ '$(DESTDIR)' '$(PREFIX)' .PHONY: clean +.NOTPARALLEL: clean clean: ## Remove build artifacts. $(RM) -r out/Makefile $(NODE_EXE) $(NODE_G_EXE) out/$(BUILDTYPE)/$(NODE_EXE) \ out/$(BUILDTYPE)/node.exp @@ -183,12 +184,14 @@ clean: ## Remove build artifacts. $(MAKE) bench-addons-clean .PHONY: testclean +.NOTPARALLEL: testclean testclean: # Next one is legacy remove this at some point $(RM) -r test/tmp* $(RM) -r test/.tmp* .PHONY: distclean +.NOTPARALLEL: distclean distclean: $(RM) -r out $(RM) config.gypi icu_config.gypi config_fips.gypi @@ -203,6 +206,7 @@ distclean: check: test .PHONY: coverage-clean +.NOTPARALLEL: coverage-clean # Remove files generated by running coverage, put the non-instrumented lib back # in place coverage-clean: @@ -316,6 +320,7 @@ test-only: all ## For a quick test, does not run linter or build docs. $(MAKE) tooltest # Used by `make coverage-test` +.PHONY: test-cov test-cov: all $(MAKE) build-addons $(MAKE) build-js-native-api-tests @@ -323,12 +328,15 @@ test-cov: all $(MAKE) cctest CI_SKIP_TESTS=$(COV_SKIP_TESTS) $(MAKE) jstest +.PHONY: test-parallel test-parallel: all $(PYTHON) tools/test.py $(PARALLEL_ARGS) --mode=$(BUILDTYPE_LOWER) parallel +.PHONY: test-valgrind test-valgrind: all $(PYTHON) tools/test.py $(PARALLEL_ARGS) --mode=$(BUILDTYPE_LOWER) --valgrind sequential parallel message +.PHONY: test-check-deopts test-check-deopts: all $(PYTHON) tools/test.py $(PARALLEL_ARGS) --mode=$(BUILDTYPE_LOWER) --check-deopts parallel sequential @@ -457,16 +465,20 @@ clear-stalled: echo $${PS_OUT} | xargs kill -9; \ fi +.PHONY: test-build test-build: | all build-addons build-js-native-api-tests build-node-api-tests +.PHONY: test-build-js-native-api test-build-js-native-api: all build-js-native-api-tests +.PHONY: test-build-node-api test-build-node-api: all build-node-api-tests .PHONY: test-all test-all: test-build ## Run default tests with both Debug and Release builds. $(PYTHON) tools/test.py $(PARALLEL_ARGS) --mode=debug,release +.PHONY: test-all-valgrind test-all-valgrind: test-build $(PYTHON) tools/test.py $(PARALLEL_ARGS) --mode=debug,release --valgrind @@ -544,30 +556,39 @@ build-ci: run-ci: build-ci $(MAKE) test-ci -j1 +.PHONY: test-release test-release: test-build $(PYTHON) tools/test.py $(PARALLEL_ARGS) --mode=$(BUILDTYPE_LOWER) +.PHONY: test-debug test-debug: test-build $(PYTHON) tools/test.py $(PARALLEL_ARGS) --mode=debug +.PHONY: test-message test-message: test-build $(PYTHON) tools/test.py $(PARALLEL_ARGS) message +.PHONY: test-wpt test-wpt: all $(PYTHON) tools/test.py $(PARALLEL_ARGS) wpt +.PHONY: test-simple test-simple: | cctest # Depends on 'all'. $(PYTHON) tools/test.py $(PARALLEL_ARGS) parallel sequential +.PHONY: test-pummel test-pummel: all $(PYTHON) tools/test.py $(PARALLEL_ARGS) pummel +.PHONY: test-internet test-internet: all $(PYTHON) tools/test.py $(PARALLEL_ARGS) internet +.PHONY: test-benchmark test-benchmark: | bench-addons-build $(PYTHON) tools/test.py $(PARALLEL_ARGS) benchmark +.PHONY: test-tick-processor test-tick-processor: all $(PYTHON) tools/test.py $(PARALLEL_ARGS) tick-processor @@ -588,13 +609,16 @@ test-doc: doc-only lint-md ## Builds, lints, and verifies the docs. test-doc-ci: doc-only $(PYTHON) tools/test.py --shell $(NODE) $(TEST_CI_ARGS) $(PARALLEL_ARGS) doctool +.PHONY: test-known-issues test-known-issues: all $(PYTHON) tools/test.py $(PARALLEL_ARGS) known_issues # Related CI job: node-test-npm +.PHONY: test-npm test-npm: $(NODE_EXE) ## Run the npm test suite on deps/npm. $(NODE) tools/test-npm-package --install --logfile=test-npm.tap deps/npm test +.PHONY: test-npm-publish test-npm-publish: $(NODE_EXE) npm_package_config_publishtest=true $(NODE) deps/npm/test/run.js @@ -603,6 +627,7 @@ test-js-native-api: test-build-js-native-api $(PYTHON) tools/test.py $(PARALLEL_ARGS) --mode=$(BUILDTYPE_LOWER) js-native-api .PHONY: test-js-native-api-clean +.NOTPARALLEL: test-js-native-api-clean test-js-native-api-clean: $(RM) -r test/js-native-api/*/build $(RM) test/js-native-api/.buildstamp @@ -612,6 +637,7 @@ test-node-api: test-build-node-api $(PYTHON) tools/test.py $(PARALLEL_ARGS) --mode=$(BUILDTYPE_LOWER) node-api .PHONY: test-node-api-clean +.NOTPARALLEL: test-node-api-clean test-node-api-clean: $(RM) -r test/node-api/*/build $(RM) test/node-api/.buildstamp @@ -621,6 +647,7 @@ test-addons: test-build test-js-native-api test-node-api $(PYTHON) tools/test.py $(PARALLEL_ARGS) --mode=$(BUILDTYPE_LOWER) addons .PHONY: test-addons-clean +.NOTPARALLEL: test-addons-clean test-addons-clean: $(RM) -r test/addons/??_*/ $(RM) -r test/addons/*/build @@ -628,9 +655,11 @@ test-addons-clean: $(MAKE) test-js-native-api-clean $(MAKE) test-node-api-clean +.PHONY: test-async-hooks test-async-hooks: $(PYTHON) tools/test.py $(PARALLEL_ARGS) --mode=$(BUILDTYPE_LOWER) async-hooks +.PHONY: test-with-async-hooks test-with-async-hooks: $(MAKE) build-addons $(MAKE) build-js-native-api-tests @@ -783,6 +812,7 @@ docserve: $(apidocs_html) $(apiassets) @$(PYTHON) -m http.server 8000 --bind 127.0.0.1 --directory out/doc/api .PHONY: docclean +.NOTPARALLEL: docclean docclean: $(RM) -r out/doc $(RM) "$(VERSIONS_DATA)" @@ -951,6 +981,7 @@ XZ_COMPRESSION ?= 9e PKG=$(TARNAME).pkg MACOSOUTDIR=out/macos +.PHONY: check-xz ifeq ($(SKIP_XZ), 1) check-xz: $(info SKIP_XZ=1 supplied, skipping .tar.xz creation) @@ -1086,6 +1117,7 @@ endif # Builds the macOS installer for releases. pkg: $(PKG) +.PHONY: corepack-update corepack-update: rm -rf /tmp/node-corepack-clone git clone 'https://github.com/nodejs/corepack.git' /tmp/node-corepack-clone @@ -1094,6 +1126,7 @@ corepack-update: cd deps/corepack && tar xf /tmp/node-corepack-clone/package.tgz --strip-components=1 chmod +x deps/corepack/shims/* +.PHONY: pkg-upload # Note: this is strictly for release builds on release machines only. pkg-upload: pkg ssh $(STAGINGSERVER) "mkdir -p nodejs/$(DISTTYPEDIR)/$(FULLVERSION)" @@ -1142,6 +1175,7 @@ endif .PHONY: tar tar: $(TARBALL) ## Create a source tarball. +.PHONY: tar-upload # Note: this is strictly for release builds on release machines only. tar-upload: tar ssh $(STAGINGSERVER) "mkdir -p nodejs/$(DISTTYPEDIR)/$(FULLVERSION)" @@ -1154,6 +1188,7 @@ ifeq ($(XZ), 1) ssh $(STAGINGSERVER) "touch nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/$(TARNAME).tar.xz.done" endif +.PHONY: doc-upload # Note: this is strictly for release builds on release machines only. doc-upload: doc ssh $(STAGINGSERVER) "mkdir -p nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/docs/" @@ -1179,8 +1214,10 @@ ifeq ($(XZ), 1) endif $(RM) $(TARNAME)-headers.tar +.PHONY: tar-headers tar-headers: $(TARBALL)-headers ## Build the node header tarball. +.PHONY: tar-headers-upload tar-headers-upload: tar-headers ssh $(STAGINGSERVER) "mkdir -p nodejs/$(DISTTYPEDIR)/$(FULLVERSION)" chmod 664 $(TARNAME)-headers.tar.gz @@ -1224,6 +1261,7 @@ endif # This requires NODE_VERSION_IS_RELEASE defined as 1 in src/node_version.h. binary: $(BINARYTAR) ## Build release binary tarballs. +.PHONY: binary-upload # Note: this is strictly for release builds on release machines only. binary-upload: binary ssh $(STAGINGSERVER) "mkdir -p nodejs/$(DISTTYPEDIR)/$(FULLVERSION)" @@ -1246,6 +1284,7 @@ bench bench-all: bench-addons-build bench-addons-build: | $(NODE_EXE) benchmark/napi/.buildstamp .PHONY: bench-addons-clean +.NOTPARALLEL: bench-addons-clean bench-addons-clean: $(RM) -r benchmark/napi/*/build $(RM) benchmark/napi/.buildstamp @@ -1256,6 +1295,7 @@ lint-md-rollup: cd tools/lint-md && npm ci && npm run build .PHONY: lint-md-clean +.NOTPARALLEL: lint-md-clean lint-md-clean: $(RM) -r tools/lint-md/node_modules $(RM) tools/.*mdlintstamp @@ -1372,9 +1412,12 @@ LINT_CPP_FILES = $(filter-out $(LINT_CPP_EXCLUDE), $(wildcard \ # and the actual filename is generated so it won't match header guards ADDON_DOC_LINT_FLAGS=-whitespace/ending_newline,-build/header_guard +.PHONY: format-cpp-build format-cpp-build: cd tools/clang-format && $(call available-node,$(run-npm-ci)) +.PHONY: format-cpp-clean +.NOTPARALLEL: format-cpp-clean format-cpp-clean: $(RM) -r tools/clang-format/node_modules @@ -1434,8 +1477,8 @@ lint-py-build: $(PYTHON) -m pip install --no-user --upgrade -t tools/pip/site-packages flake8 || \ $(PYTHON) -m pip install --no-user --upgrade --system -t tools/pip/site-packages flake8 -ifneq ("","$(wildcard tools/pip/site-packages/flake8)") .PHONY: lint-py +ifneq ("","$(wildcard tools/pip/site-packages/flake8)") # Lints the Python code with flake8. # Flag the build if there are Python syntax errors or undefined names lint-py: @@ -1500,6 +1543,7 @@ lint-clean: HAS_DOCKER ?= $(shell command -v docker > /dev/null 2>&1; [ $$? -eq 0 ] && echo 1 || echo 0) +.PHONY: gen-openssl ifeq ($(HAS_DOCKER), 1) DOCKER_COMMAND ?= docker run -it -v $(PWD):/node IS_IN_WORKTREE = $(shell grep '^gitdir: ' $(PWD)/.git 2>/dev/null)