From 57f785151aa68b1d01c6ca1b08be379fc5e8b538 Mon Sep 17 00:00:00 2001 From: Nathan Rajlich Date: Sat, 4 Aug 2012 00:10:58 -0700 Subject: [PATCH 01/11] install: install the "wafadmin" files into the correct directory Before they were just being copied into "lib/node/". Now they go into "lib/node/wafadmin/". --- tools/install.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/install.py b/tools/install.py index d03aae9d1c8..2ee9903824e 100755 --- a/tools/install.py +++ b/tools/install.py @@ -125,7 +125,7 @@ def waf_files(action): 'tools/wafadmin/Tools/xlc.py', 'tools/wafadmin/Tools/xlcxx.py', 'tools/wafadmin/Utils.py'], - 'lib/node/') + 'lib/node/wafadmin/') def update_shebang(path, shebang): print 'updating shebang of %s' % path From 3254caceefda268247826cd9bb8178725a9f0b08 Mon Sep 17 00:00:00 2001 From: Nathan Rajlich Date: Sat, 4 Aug 2012 00:12:52 -0700 Subject: [PATCH 02/11] install: use os.path.join() to create the npm shebang Prettier formatting for the shebang if the "prefix" ends with a / --- tools/install.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/install.py b/tools/install.py index 2ee9903824e..988626f2038 100755 --- a/tools/install.py +++ b/tools/install.py @@ -128,7 +128,7 @@ def waf_files(action): 'lib/node/wafadmin/') def update_shebang(path, shebang): - print 'updating shebang of %s' % path + print 'updating shebang of %s to %s' % (path, shebang) s = open(path, 'r').read() s = re.sub(r'#!.*\n', '#!' + shebang + '\n', s) open(path, 'w').write(s) @@ -153,7 +153,8 @@ def npm_files(action): action([link_path], 'bin/npm') elif action == install: try_symlink('../lib/node_modules/npm/bin/npm-cli.js', link_path) - update_shebang(link_path, node_prefix + '/bin/node') + shebang = os.path.join(node_prefix, 'bin/node') + update_shebang(link_path, shebang) else: assert(0) # unhandled action type From 6bdd4d0205a86ad40f78d3140144eebb83f703ca Mon Sep 17 00:00:00 2001 From: Nathan Rajlich Date: Sat, 4 Aug 2012 11:06:14 -0700 Subject: [PATCH 03/11] install: install the "wafadmin/Tools" files into the correct dir Previously they were going into just "wafadmin" and node-waf wasn't working. --- tools/install.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/install.py b/tools/install.py index 988626f2038..d11d281a861 100755 --- a/tools/install.py +++ b/tools/install.py @@ -91,7 +91,9 @@ def waf_files(action): 'tools/wafadmin/Scripting.py', 'tools/wafadmin/TaskGen.py', 'tools/wafadmin/Task.py', - 'tools/wafadmin/Tools/ar.py', + 'tools/wafadmin/Utils.py'], + 'lib/node/wafadmin/') + action(['tools/wafadmin/Tools/ar.py', 'tools/wafadmin/Tools/cc.py', 'tools/wafadmin/Tools/ccroot.py', 'tools/wafadmin/Tools/compiler_cc.py', @@ -123,9 +125,8 @@ def waf_files(action): 'tools/wafadmin/Tools/unittestw.py', 'tools/wafadmin/Tools/winres.py', 'tools/wafadmin/Tools/xlc.py', - 'tools/wafadmin/Tools/xlcxx.py', - 'tools/wafadmin/Utils.py'], - 'lib/node/wafadmin/') + 'tools/wafadmin/Tools/xlcxx.py'], + 'lib/node/wafadmin/Tools/') def update_shebang(path, shebang): print 'updating shebang of %s to %s' % (path, shebang) From 7a9db6cfb139a6cb5941b2ae09ab5671e474e160 Mon Sep 17 00:00:00 2001 From: Nathan Rajlich Date: Mon, 6 Aug 2012 10:18:27 -0700 Subject: [PATCH 04/11] install: add a "portable" mode to the shebang-rewriting logic This "portable" mode rewrites the npm shebang to use the "node" executable in the same directory relative to the "npm" script. This makes the "npm" script "just work" even when "node" is not in the user's $PATH. This mode is necessary for the precompiled binary packages that may potentially be extracted to anywhere. The regular shebang-rewriting logic would normally set the npm script's shebang to "/bin/node" which will not be present on anyone's machine. In the end, we want the precompiled packages to be as user-friendly as possible. --- tools/install.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tools/install.py b/tools/install.py index d11d281a861..1dd039a8653 100755 --- a/tools/install.py +++ b/tools/install.py @@ -154,7 +154,15 @@ def npm_files(action): action([link_path], 'bin/npm') elif action == install: try_symlink('../lib/node_modules/npm/bin/npm-cli.js', link_path) - shebang = os.path.join(node_prefix, 'bin/node') + if os.environ['PORTABLE']: + # This crazy hack is necessary to make the shebang execute the copy + # of node relative to the same directory as the npm script. The precompiled + # binary tarballs use a prefix of "/" which gets translated to "/bin/node" + # in the regular shebang modifying logic, which is incorrect since the + # precompiled bundle should be able to be extracted anywhere and "just work" + shebang = '/bin/sh\n// 2>/dev/null; exec "`dirname "$0"`/node" "$0" "$@"' + else: + shebang = os.path.join(node_prefix, 'bin/node') update_shebang(link_path, shebang) else: assert(0) # unhandled action type From 42aac41b9399dbdb14e3f250f358c14ec13ee5e4 Mon Sep 17 00:00:00 2001 From: Nathan Rajlich Date: Sat, 4 Aug 2012 12:07:17 -0700 Subject: [PATCH 05/11] Makefile: add target for precompiled binary tarballs This target compiles node with "/" as the prefix and installs into a directory like: "node-v0.8.6-darwin-x86_64". Then it creates a gzipped-tarball of that directory, called something like: "node-v0.8.6-darwin-x86_64.tar.gz". --- Makefile | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Makefile b/Makefile index 869eafac9a1..826cd89feef 100644 --- a/Makefile +++ b/Makefile @@ -192,8 +192,12 @@ docclean: -rm -rf out/doc VERSION=v$(shell $(PYTHON) tools/getnodeversion.py) +PLATFORM=$(shell uname | tr '[:upper:]' '[:lower:]') +ARCH=$(shell uname -m) TARNAME=node-$(VERSION) TARBALL=$(TARNAME).tar.gz +BINARYNAME=$(TARNAME)-$(PLATFORM)-$(ARCH) +BINARYTAR=$(BINARYNAME).tar.gz PKG=out/$(TARNAME).pkg packagemaker=/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker @@ -256,6 +260,18 @@ $(TARBALL): node doc rm -rf $(TARNAME) gzip -f -9 $(TARNAME).tar +$(BINARYTAR): + rm -rf $(BINARYNAME) + rm -rf out/deps out/Release + ./configure --prefix=/ --without-snapshot + $(MAKE) install DESTDIR=$(BINARYNAME) V=$(V) PORTABLE=1 + cp README.md $(BINARYNAME) + cp LICENSE $(BINARYNAME) + cp ChangeLog $(BINARYNAME) + tar -cf $(BINARYNAME).tar $(BINARYNAME) + rm -rf $(BINARYNAME) + gzip -f -9 $(BINARYNAME).tar + dist-upload: $(TARBALL) $(PKG) ssh node@nodejs.org mkdir -p web/nodejs.org/dist/$(VERSION) scp $(TARBALL) node@nodejs.org:~/web/nodejs.org/dist/$(VERSION)/$(TARBALL) From bd10bf44181909ce3aca8c312117482dcc14d066 Mon Sep 17 00:00:00 2001 From: Nathan Rajlich Date: Sat, 4 Aug 2012 12:12:22 -0700 Subject: [PATCH 06/11] Makefile: add `make tar` helper target --- Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 826cd89feef..d1b2492511b 100644 --- a/Makefile +++ b/Makefile @@ -260,6 +260,8 @@ $(TARBALL): node doc rm -rf $(TARNAME) gzip -f -9 $(TARNAME).tar +tar: $(TARBALL) + $(BINARYTAR): rm -rf $(BINARYNAME) rm -rf out/deps out/Release @@ -296,4 +298,4 @@ cpplint: lint: jslint cpplint -.PHONY: lint cpplint jslint bench clean docopen docclean doc dist distclean check uninstall install install-includes install-bin all staticlib dynamiclib test test-all website-upload pkg blog blogclean +.PHONY: lint cpplint jslint bench clean docopen docclean doc dist distclean check uninstall install install-includes install-bin all staticlib dynamiclib test test-all website-upload pkg blog blogclean tar From eadc2ec5c8d1f3697d22515d7808ca583ea43f45 Mon Sep 17 00:00:00 2001 From: Nathan Rajlich Date: Sat, 4 Aug 2012 12:12:37 -0700 Subject: [PATCH 07/11] Makefile: add `make binary` helper target --- Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index d1b2492511b..b0f8f027231 100644 --- a/Makefile +++ b/Makefile @@ -274,6 +274,8 @@ $(BINARYTAR): rm -rf $(BINARYNAME) gzip -f -9 $(BINARYNAME).tar +binary: $(BINARYTAR) + dist-upload: $(TARBALL) $(PKG) ssh node@nodejs.org mkdir -p web/nodejs.org/dist/$(VERSION) scp $(TARBALL) node@nodejs.org:~/web/nodejs.org/dist/$(VERSION)/$(TARBALL) @@ -298,4 +300,4 @@ cpplint: lint: jslint cpplint -.PHONY: lint cpplint jslint bench clean docopen docclean doc dist distclean check uninstall install install-includes install-bin all staticlib dynamiclib test test-all website-upload pkg blog blogclean tar +.PHONY: lint cpplint jslint bench clean docopen docclean doc dist distclean check uninstall install install-includes install-bin all staticlib dynamiclib test test-all website-upload pkg blog blogclean tar binary From dc9ae01ef7a6fcafd82b306d80b9f715d72ed670 Mon Sep 17 00:00:00 2001 From: Nathan Rajlich Date: Sat, 4 Aug 2012 12:24:34 -0700 Subject: [PATCH 08/11] Makefile: allow the dest-cpu to be specified for `make binary` Needed for 64-bit Solaris, and 32-bit OS X --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index b0f8f027231..004d074f42a 100644 --- a/Makefile +++ b/Makefile @@ -265,7 +265,7 @@ tar: $(TARBALL) $(BINARYTAR): rm -rf $(BINARYNAME) rm -rf out/deps out/Release - ./configure --prefix=/ --without-snapshot + ./configure --prefix=/ --without-snapshot --dest-cpu=$(DESTCPU) $(MAKE) install DESTDIR=$(BINARYNAME) V=$(V) PORTABLE=1 cp README.md $(BINARYNAME) cp LICENSE $(BINARYNAME) From 8b11f29cf3881cdc0e1e1a553c543f561128daed Mon Sep 17 00:00:00 2001 From: Nathan Rajlich Date: Sat, 4 Aug 2012 12:39:54 -0700 Subject: [PATCH 09/11] Makefile: properly set the ARCH variable when forcing a DESTCPU --- Makefile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Makefile b/Makefile index 004d074f42a..da076378130 100644 --- a/Makefile +++ b/Makefile @@ -193,7 +193,15 @@ docclean: VERSION=v$(shell $(PYTHON) tools/getnodeversion.py) PLATFORM=$(shell uname | tr '[:upper:]' '[:lower:]') +ifeq ($(DESTCPU),x64) +ARCH=x86_64 +else +ifeq ($(DESTCPU),ia32) +ARCH=i386 +else ARCH=$(shell uname -m) +endif +endif TARNAME=node-$(VERSION) TARBALL=$(TARNAME).tar.gz BINARYNAME=$(TARNAME)-$(PLATFORM)-$(ARCH) From dc818135a573fa35a502417322e811f20e488e4c Mon Sep 17 00:00:00 2001 From: Nathan Rajlich Date: Sat, 4 Aug 2012 15:34:04 -0700 Subject: [PATCH 10/11] Makefile: move the release verification logic into a `make release-only` target --- Makefile | 54 ++++++++++++++++++++++++++++-------------------------- 1 file changed, 28 insertions(+), 26 deletions(-) diff --git a/Makefile b/Makefile index da076378130..31a2dde7351 100644 --- a/Makefile +++ b/Makefile @@ -213,30 +213,7 @@ dist: doc $(TARBALL) $(PKG) PKGDIR=out/dist-osx -pkg: $(PKG) - -$(PKG): - rm -rf $(PKGDIR) - rm -rf out/deps out/Release - ./configure --prefix=$(PKGDIR)/32/usr/local --without-snapshot --dest-cpu=ia32 - $(MAKE) install V=$(V) - rm -rf out/deps out/Release - ./configure --prefix=$(PKGDIR)/usr/local --without-snapshot --dest-cpu=x64 - $(MAKE) install V=$(V) - SIGN="$(SIGN)" PKGDIR="$(PKGDIR)" bash tools/osx-codesign.sh - lipo $(PKGDIR)/32/usr/local/bin/node \ - $(PKGDIR)/usr/local/bin/node \ - -output $(PKGDIR)/usr/local/bin/node-universal \ - -create - mv $(PKGDIR)/usr/local/bin/node-universal $(PKGDIR)/usr/local/bin/node - rm -rf $(PKGDIR)/32 - $(packagemaker) \ - --id "org.nodejs.Node" \ - --doc tools/osx-pkg.pmdoc \ - --out $(PKG) - SIGN="$(SIGN)" PKG="$(PKG)" bash tools/osx-productsign.sh - -$(TARBALL): node doc +release-only: @if [ "$(shell git status --porcelain | egrep -v '^\?\? ')" = "" ]; then \ exit 0 ; \ else \ @@ -257,6 +234,31 @@ $(TARBALL): node doc echo "" >&2 ; \ exit 1 ; \ fi + +pkg: $(PKG) + +$(PKG): release-only + rm -rf $(PKGDIR) + rm -rf out/deps out/Release + ./configure --prefix=$(PKGDIR)/32/usr/local --without-snapshot --dest-cpu=ia32 + $(MAKE) install V=$(V) + rm -rf out/deps out/Release + ./configure --prefix=$(PKGDIR)/usr/local --without-snapshot --dest-cpu=x64 + $(MAKE) install V=$(V) + SIGN="$(SIGN)" PKGDIR="$(PKGDIR)" bash tools/osx-codesign.sh + lipo $(PKGDIR)/32/usr/local/bin/node \ + $(PKGDIR)/usr/local/bin/node \ + -output $(PKGDIR)/usr/local/bin/node-universal \ + -create + mv $(PKGDIR)/usr/local/bin/node-universal $(PKGDIR)/usr/local/bin/node + rm -rf $(PKGDIR)/32 + $(packagemaker) \ + --id "org.nodejs.Node" \ + --doc tools/osx-pkg.pmdoc \ + --out $(PKG) + SIGN="$(SIGN)" PKG="$(PKG)" bash tools/osx-productsign.sh + +$(TARBALL): release-only node doc git archive --format=tar --prefix=$(TARNAME)/ HEAD | tar xf - mkdir -p $(TARNAME)/doc/api cp doc/node.1 $(TARNAME)/doc/node.1 @@ -270,7 +272,7 @@ $(TARBALL): node doc tar: $(TARBALL) -$(BINARYTAR): +$(BINARYTAR): release-only rm -rf $(BINARYNAME) rm -rf out/deps out/Release ./configure --prefix=/ --without-snapshot --dest-cpu=$(DESTCPU) @@ -308,4 +310,4 @@ cpplint: lint: jslint cpplint -.PHONY: lint cpplint jslint bench clean docopen docclean doc dist distclean check uninstall install install-includes install-bin all staticlib dynamiclib test test-all website-upload pkg blog blogclean tar binary +.PHONY: lint cpplint jslint bench clean docopen docclean doc dist distclean check uninstall install install-includes install-bin all staticlib dynamiclib test test-all website-upload pkg blog blogclean tar binary release-only From cc6034ac862e058ee9faa5306f240d11150f960e Mon Sep 17 00:00:00 2001 From: Nathan Rajlich Date: Mon, 6 Aug 2012 11:57:47 -0700 Subject: [PATCH 11/11] email-footer: add links to the expected common binary packages We can do other OSs like 32 and 64-bit OS X, but we should encourage users to use the installer on OS X so we'll omit it here. --- tools/email-footer.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tools/email-footer.md b/tools/email-footer.md index e6115c9dd5d..d25580f6460 100644 --- a/tools/email-footer.md +++ b/tools/email-footer.md @@ -8,6 +8,14 @@ Windows x64 Installer: http://nodejs.org/dist/__VERSION__/x64/node-__VERSION__-x Windows x64 Files: http://nodejs.org/dist/__VERSION__/x64/ +Linux 32-bit Binary Package: http://nodejs.org/dist/__VERSION__/node-__VERSION__-linux-i686.tar.gz + +Linux 64-bit Binary Package: http://nodejs.org/dist/__VERSION__/node-__VERSION__-linux-x86_64.tar.gz + +Solaris 32-bit Binary Package: http://nodejs.org/dist/__VERSION__/node-__VERSION__-sunos-i386.tar.gz + +Solaris 64-bit Binary Package: http://nodejs.org/dist/__VERSION__/node-__VERSION__-sunos-x86_64.tar.gz + Other release files: http://nodejs.org/dist/__VERSION__/ Website: http://nodejs.org/docs/__VERSION__/