From 28bf2287aac5cf968ac3d45c5f5b41b4fa65547d Mon Sep 17 00:00:00 2001 From: Rod Vagg Date: Wed, 21 Nov 2018 22:02:54 +1100 Subject: [PATCH 1/2] build: make tar.xz creation opt-out, fail if no xz --- Makefile | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 0bd83a21ba045c..ede0681864a69f 100644 --- a/Makefile +++ b/Makefile @@ -810,13 +810,28 @@ BINARYNAME=$(TARNAME)-$(PLATFORM)-$(ARCH) endif BINARYTAR=$(BINARYNAME).tar # OSX doesn't have xz installed by default, http://macpkg.sourceforge.net/ -XZ=$(shell which xz > /dev/null 2>&1; echo $$?) +HAS_XZ ?= $(shell which xz > /dev/null 2>&1; [[ $$? = 0 ]] && echo 1 || echo 0) +# Supply SKIP_XZ=1 to explicitly skip .tar.xz creation +SKIP_XZ ?= 0 XZ_COMPRESSION ?= 9e PKG=$(TARNAME).pkg MACOSOUTDIR=out/macos +ifeq ($(SKIP_XZ), 1) +check-xz: + @echo "SKIP_XZ=1 supplied, skipping .tar.xz creation" +else +ifeq ($(HAS_XZ), 1) +check-xz: +else +check-xz: + @echo "No xz command, cannot continue" + @exit 1 +endif +endif + .PHONY: release-only -release-only: +release-only: check-xz @if [ "$(DISTTYPE)" = "release" ] && `grep -q REPLACEME doc/api/*.md`; then \ echo 'Please update REPLACEME in Added: tags in doc/api/*.md (See doc/releases.md)' ; \ exit 1 ; \ @@ -942,7 +957,7 @@ $(TARBALL): release-only $(NODE_EXE) doc tar -cf $(TARNAME).tar $(TARNAME) $(RM) -r $(TARNAME) gzip -c -f -9 $(TARNAME).tar > $(TARNAME).tar.gz -ifeq ($(XZ), 0) +ifeq ($(HAS_XZ) $(SKIP_XZ), 1 0) xz -c -f -$(XZ_COMPRESSION) $(TARNAME).tar > $(TARNAME).tar.xz endif $(RM) $(TARNAME).tar @@ -956,7 +971,7 @@ tar-upload: tar chmod 664 $(TARNAME).tar.gz scp -p $(TARNAME).tar.gz $(STAGINGSERVER):nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/$(TARNAME).tar.gz ssh $(STAGINGSERVER) "touch nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/$(TARNAME).tar.gz.done" -ifeq ($(XZ), 0) +ifeq ($(HAS_XZ) $(SKIP_XZ), 1 0) chmod 664 $(TARNAME).tar.xz scp -p $(TARNAME).tar.xz $(STAGINGSERVER):nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/$(TARNAME).tar.xz ssh $(STAGINGSERVER) "touch nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/$(TARNAME).tar.xz.done" @@ -982,7 +997,7 @@ $(TARBALL)-headers: release-only tar -cf $(TARNAME)-headers.tar $(TARNAME) $(RM) -r $(TARNAME) gzip -c -f -9 $(TARNAME)-headers.tar > $(TARNAME)-headers.tar.gz -ifeq ($(XZ), 0) +ifeq ($(HAS_XZ) $(SKIP_XZ), 1 0) xz -c -f -$(XZ_COMPRESSION) $(TARNAME)-headers.tar > $(TARNAME)-headers.tar.xz endif $(RM) $(TARNAME)-headers.tar @@ -994,7 +1009,7 @@ tar-headers-upload: tar-headers chmod 664 $(TARNAME)-headers.tar.gz scp -p $(TARNAME)-headers.tar.gz $(STAGINGSERVER):nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/$(TARNAME)-headers.tar.gz ssh $(STAGINGSERVER) "touch nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/$(TARNAME)-headers.tar.gz.done" -ifeq ($(XZ), 0) +ifeq ($(HAS_XZ) $(SKIP_XZ), 1 0) chmod 664 $(TARNAME)-headers.tar.xz scp -p $(TARNAME)-headers.tar.xz $(STAGINGSERVER):nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/$(TARNAME)-headers.tar.xz ssh $(STAGINGSERVER) "touch nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/$(TARNAME)-headers.tar.xz.done" @@ -1019,7 +1034,7 @@ endif tar -cf $(BINARYNAME).tar $(BINARYNAME) $(RM) -r $(BINARYNAME) gzip -c -f -9 $(BINARYNAME).tar > $(BINARYNAME).tar.gz -ifeq ($(XZ), 0) +ifeq ($(HAS_XZ) $(SKIP_XZ), 1 0) xz -c -f -$(XZ_COMPRESSION) $(BINARYNAME).tar > $(BINARYNAME).tar.xz endif $(RM) $(BINARYNAME).tar @@ -1034,7 +1049,7 @@ binary-upload: binary chmod 664 $(TARNAME)-$(OSTYPE)-$(ARCH).tar.gz scp -p $(TARNAME)-$(OSTYPE)-$(ARCH).tar.gz $(STAGINGSERVER):nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/$(TARNAME)-$(OSTYPE)-$(ARCH).tar.gz ssh $(STAGINGSERVER) "touch nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/$(TARNAME)-$(OSTYPE)-$(ARCH).tar.gz.done" -ifeq ($(XZ), 0) +ifeq ($(HAS_XZ) $(SKIP_XZ), 1 0) chmod 664 $(TARNAME)-$(OSTYPE)-$(ARCH).tar.xz scp -p $(TARNAME)-$(OSTYPE)-$(ARCH).tar.xz $(STAGINGSERVER):nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/$(TARNAME)-$(OSTYPE)-$(ARCH).tar.xz ssh $(STAGINGSERVER) "touch nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/$(TARNAME)-$(OSTYPE)-$(ARCH).tar.xz.done" From 8665814bf82210859e7e7fa6bf7f5006486020e5 Mon Sep 17 00:00:00 2001 From: Rod Vagg Date: Thu, 22 Nov 2018 20:49:13 +1100 Subject: [PATCH 2/2] fixup! build: make tar.xz creation opt-out, fail if no xz --- Makefile | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index ede0681864a69f..f5de5c7f606069 100644 --- a/Makefile +++ b/Makefile @@ -813,6 +813,7 @@ BINARYTAR=$(BINARYNAME).tar HAS_XZ ?= $(shell which xz > /dev/null 2>&1; [[ $$? = 0 ]] && echo 1 || echo 0) # Supply SKIP_XZ=1 to explicitly skip .tar.xz creation SKIP_XZ ?= 0 +XZ = $(shell [[ $(HAS_XZ) = 1 && $(SKIP_XZ) = 0 ]] && echo 1 || echo 0) XZ_COMPRESSION ?= 9e PKG=$(TARNAME).pkg MACOSOUTDIR=out/macos @@ -957,7 +958,7 @@ $(TARBALL): release-only $(NODE_EXE) doc tar -cf $(TARNAME).tar $(TARNAME) $(RM) -r $(TARNAME) gzip -c -f -9 $(TARNAME).tar > $(TARNAME).tar.gz -ifeq ($(HAS_XZ) $(SKIP_XZ), 1 0) +ifeq ($(XZ), 1) xz -c -f -$(XZ_COMPRESSION) $(TARNAME).tar > $(TARNAME).tar.xz endif $(RM) $(TARNAME).tar @@ -971,7 +972,7 @@ tar-upload: tar chmod 664 $(TARNAME).tar.gz scp -p $(TARNAME).tar.gz $(STAGINGSERVER):nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/$(TARNAME).tar.gz ssh $(STAGINGSERVER) "touch nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/$(TARNAME).tar.gz.done" -ifeq ($(HAS_XZ) $(SKIP_XZ), 1 0) +ifeq ($(XZ), 1) chmod 664 $(TARNAME).tar.xz scp -p $(TARNAME).tar.xz $(STAGINGSERVER):nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/$(TARNAME).tar.xz ssh $(STAGINGSERVER) "touch nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/$(TARNAME).tar.xz.done" @@ -997,7 +998,7 @@ $(TARBALL)-headers: release-only tar -cf $(TARNAME)-headers.tar $(TARNAME) $(RM) -r $(TARNAME) gzip -c -f -9 $(TARNAME)-headers.tar > $(TARNAME)-headers.tar.gz -ifeq ($(HAS_XZ) $(SKIP_XZ), 1 0) +ifeq ($(XZ), 1) xz -c -f -$(XZ_COMPRESSION) $(TARNAME)-headers.tar > $(TARNAME)-headers.tar.xz endif $(RM) $(TARNAME)-headers.tar @@ -1009,7 +1010,7 @@ tar-headers-upload: tar-headers chmod 664 $(TARNAME)-headers.tar.gz scp -p $(TARNAME)-headers.tar.gz $(STAGINGSERVER):nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/$(TARNAME)-headers.tar.gz ssh $(STAGINGSERVER) "touch nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/$(TARNAME)-headers.tar.gz.done" -ifeq ($(HAS_XZ) $(SKIP_XZ), 1 0) +ifeq ($(XZ), 1) chmod 664 $(TARNAME)-headers.tar.xz scp -p $(TARNAME)-headers.tar.xz $(STAGINGSERVER):nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/$(TARNAME)-headers.tar.xz ssh $(STAGINGSERVER) "touch nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/$(TARNAME)-headers.tar.xz.done" @@ -1034,7 +1035,7 @@ endif tar -cf $(BINARYNAME).tar $(BINARYNAME) $(RM) -r $(BINARYNAME) gzip -c -f -9 $(BINARYNAME).tar > $(BINARYNAME).tar.gz -ifeq ($(HAS_XZ) $(SKIP_XZ), 1 0) +ifeq ($(XZ), 1) xz -c -f -$(XZ_COMPRESSION) $(BINARYNAME).tar > $(BINARYNAME).tar.xz endif $(RM) $(BINARYNAME).tar @@ -1049,7 +1050,7 @@ binary-upload: binary chmod 664 $(TARNAME)-$(OSTYPE)-$(ARCH).tar.gz scp -p $(TARNAME)-$(OSTYPE)-$(ARCH).tar.gz $(STAGINGSERVER):nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/$(TARNAME)-$(OSTYPE)-$(ARCH).tar.gz ssh $(STAGINGSERVER) "touch nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/$(TARNAME)-$(OSTYPE)-$(ARCH).tar.gz.done" -ifeq ($(HAS_XZ) $(SKIP_XZ), 1 0) +ifeq ($(XZ), 1) chmod 664 $(TARNAME)-$(OSTYPE)-$(ARCH).tar.xz scp -p $(TARNAME)-$(OSTYPE)-$(ARCH).tar.xz $(STAGINGSERVER):nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/$(TARNAME)-$(OSTYPE)-$(ARCH).tar.xz ssh $(STAGINGSERVER) "touch nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/$(TARNAME)-$(OSTYPE)-$(ARCH).tar.xz.done"