Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update build components of v1.x #2101

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
172 changes: 119 additions & 53 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ PYTHON ?= python
DESTDIR ?=
SIGN ?=
PREFIX ?= /usr/local
STAGINGSERVER ?= iojs-www

OSTYPE := $(shell uname -s | tr '[A-Z]' '[a-z]')

# Determine EXEEXT
EXEEXT := $(shell $(PYTHON) -c \
Expand Down Expand Up @@ -56,15 +59,15 @@ uninstall:
$(PYTHON) tools/install.py $@ '$(DESTDIR)' '$(PREFIX)'

clean:
-rm -rf out/Makefile $(NODE_EXE) $(NODE_G_EXE) out/$(BUILDTYPE)/$(NODE_EXE) blog.html email.md
-rm -rf out/Makefile $(NODE_EXE) $(NODE_G_EXE) out/$(BUILDTYPE)/$(NODE_EXE)
@if [ -d out ]; then find out/ -name '*.o' -o -name '*.a' | xargs rm -rf; fi
-rm -rf node_modules

distclean:
-rm -rf out
-rm -f config.gypi icu_config.gypi
-rm -f config.mk
-rm -rf $(NODE_EXE) $(NODE_G_EXE) blog.html email.md
-rm -rf $(NODE_EXE) $(NODE_G_EXE)
-rm -rf node_modules
-rm -rf deps/icu
-rm -rf deps/icu4c*.tgz deps/icu4c*.zip deps/icu-tmp
Expand All @@ -87,16 +90,16 @@ test-valgrind: all
$(PYTHON) tools/test.py --mode=release --valgrind sequential parallel message

test/gc/node_modules/weak/build/Release/weakref.node: $(NODE_EXE)
./$(NODE_EXE) deps/npm/node_modules/node-gyp/bin/node-gyp rebuild \
$(NODE) deps/npm/node_modules/node-gyp/bin/node-gyp rebuild \
--directory="$(shell pwd)/test/gc/node_modules/weak" \
--nodedir="$(shell pwd)"

build-addons: $(NODE_EXE)
rm -rf test/addons/doc-*/
./$(NODE_EXE) tools/doc/addon-verify.js
$(NODE) tools/doc/addon-verify.js
$(foreach dir, \
$(sort $(dir $(wildcard test/addons/*/*.gyp))), \
./$(NODE_EXE) deps/npm/node_modules/node-gyp/bin/node-gyp rebuild \
$(NODE) deps/npm/node_modules/node-gyp/bin/node-gyp rebuild \
--directory="$(shell pwd)/$(dir)" \
--nodedir="$(shell pwd)" && ) echo "build done"

Expand All @@ -113,8 +116,6 @@ test-all-valgrind: test-build

test-ci:
$(PYTHON) tools/test.py -p tap --logfile test.tap --mode=release message parallel sequential
$(MAKE) jslint
$(MAKE) cpplint

test-release: test-build
$(PYTHON) tools/test.py --mode=release
Expand Down Expand Up @@ -153,7 +154,7 @@ test-npm: $(NODE_EXE)
rm -rf npm-cache npm-tmp npm-prefix

test-npm-publish: $(NODE_EXE)
npm_package_config_publishtest=true ./$(NODE_EXE) deps/npm/test/run.js
npm_package_config_publishtest=true $(NODE) deps/npm/test/run.js

test-addons: test-build
$(PYTHON) tools/test.py --mode=release addons
Expand Down Expand Up @@ -185,10 +186,10 @@ out/doc/%: doc/%
cp -r $< $@

out/doc/api/%.json: doc/api/%.markdown $(NODE_EXE)
out/Release/$(NODE_EXE) tools/doc/generate.js --format=json $< > $@
$(NODE) tools/doc/generate.js --format=json $< > $@

out/doc/api/%.html: doc/api/%.markdown $(NODE_EXE)
out/Release/$(NODE_EXE) tools/doc/generate.js --format=html --template=doc/template.html $< > $@
$(NODE) tools/doc/generate.js --format=html --template=doc/template.html $< > $@

docopen: out/doc/api/all.html
-google-chrome out/doc/api/all.html
Expand All @@ -198,14 +199,49 @@ docclean:

RAWVER=$(shell $(PYTHON) tools/getnodeversion.py)
VERSION=v$(RAWVER)

# For nightly builds, you must set DISTTYPE to "nightly", "next-nightly" or
# "custom". For the nightly and next-nightly case, you need to set DATESTRING
# and COMMIT in order to properly name the build.
# For the rc case you need to set CUSTOMTAG to an appropriate CUSTOMTAG number

ifndef DISTTYPE
DISTTYPE=release
endif
ifeq ($(DISTTYPE),release)
FULLVERSION=$(VERSION)
else # ifeq ($(DISTTYPE),release)
ifeq ($(DISTTYPE),custom)
ifndef CUSTOMTAG
$(error CUSTOMTAG is not set for DISTTYPE=custom)
endif # ifndef CUSTOMTAG
TAG=$(CUSTOMTAG)
else # ifeq ($(DISTTYPE),custom)
ifndef DATESTRING
$(error DATESTRING is not set for nightly)
endif # ifndef DATESTRING
ifndef COMMIT
$(error COMMIT is not set for nightly)
endif # ifndef COMMIT
ifneq ($(DISTTYPE),nightly)
ifneq ($(DISTTYPE),next-nightly)
$(error DISTTYPE is not release, custom, nightly or next-nightly)
endif # ifneq ($(DISTTYPE),next-nightly)
endif # ifneq ($(DISTTYPE),nightly)
TAG=$(DISTTYPE)$(DATESTRING)$(COMMIT)
endif # ifeq ($(DISTTYPE),custom)
FULLVERSION=$(VERSION)-$(TAG)
endif # ifeq ($(DISTTYPE),release)

DISTTYPEDIR ?= $(DISTTYPE)
RELEASE=$(shell sed -ne 's/\#define NODE_VERSION_IS_RELEASE \([01]\)/\1/p' src/node_version.h)
PLATFORM=$(shell uname | tr '[:upper:]' '[:lower:]')
NPMVERSION=v$(shell cat deps/npm/package.json | grep '"version"' | sed 's/^[^:]*: "\([^"]*\)",.*/\1/')

ifeq ($(findstring x86_64,$(shell uname -m)),x86_64)
DESTCPU ?= x64
else
DESTCPU ?= ia32
DESTCPU ?= x86
endif
ifeq ($(DESTCPU),x64)
ARCH=x64
Expand All @@ -216,26 +252,24 @@ else
ARCH=x86
endif
endif
ifdef NIGHTLY
TAG = nightly-$(NIGHTLY)
FULLVERSION=$(VERSION)-$(TAG)

# enforce "x86" over "ia32" as the generally accepted way of referring to 32-bit intel
ifeq ($(ARCH),ia32)
override ARCH=x86
endif
ifeq ($(DESTCPU),ia32)
override DESTCPU=x86
endif

TARNAME=iojs-$(FULLVERSION)
TARBALL=$(TARNAME).tar
BINARYNAME=$(TARNAME)-$(PLATFORM)-$(ARCH)
BINARYTAR=$(BINARYNAME).tar
# OSX doesn't have xz installed by default, http://macpkg.sourceforge.net/
XZ=$(shell which xz > /dev/null 2>&1; echo $$?)
XZ_COMPRESSION ?= 9
PKG=out/$(TARNAME).pkg
PKG=$(TARNAME).pkg
PACKAGEMAKER ?= /Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker

PKGSRC=iojs-$(DESTCPU)-$(RAWVER).tgz
ifdef NIGHTLY
PKGSRC=iojs-$(DESTCPU)-$(RAWVER)-$(TAG).tgz
endif

dist: doc $(TARBALL) $(PKG)

PKGDIR=out/dist-osx

release-only:
Expand All @@ -250,7 +284,7 @@ release-only:
echo "" >&2 ; \
exit 1 ; \
fi
@if [ "$(NIGHTLY)" != "" -o "$(RELEASE)" = "1" ]; then \
@if [ "$(DISTTYPE)" != "release" -o "$(RELEASE)" = "1" ]; then \
exit 0; \
else \
echo "" >&2 ; \
Expand All @@ -260,29 +294,28 @@ release-only:
exit 1 ; \
fi

pkg: $(PKG)

$(PKG): release-only
rm -rf $(PKGDIR)
rm -rf out/deps out/Release
$(PYTHON) ./configure --dest-cpu=ia32 --tag=$(TAG)
$(MAKE) install V=$(V) DESTDIR=$(PKGDIR)/32
rm -rf out/deps out/Release
$(PYTHON) ./configure --dest-cpu=x64 --tag=$(TAG)
$(MAKE) install V=$(V) DESTDIR=$(PKGDIR)
SIGN="$(APP_SIGN)" PKGDIR="$(PKGDIR)" bash tools/osx-codesign.sh
lipo $(PKGDIR)/32/usr/local/bin/iojs \
$(PKGDIR)/usr/local/bin/iojs \
-output $(PKGDIR)/usr/local/bin/iojs-universal \
-create
mv $(PKGDIR)/usr/local/bin/iojs-universal $(PKGDIR)/usr/local/bin/iojs
rm -rf $(PKGDIR)/32
cat tools/osx-pkg.pmdoc/index.xml.tmpl | sed -e 's|__iojsversion__|'$(FULLVERSION)'|g' | sed -e 's|__npmversion__|'$(NPMVERSION)'|g' > tools/osx-pkg.pmdoc/index.xml
SIGN="$(CODESIGN_CERT)" PKGDIR="$(PKGDIR)" bash tools/osx-codesign.sh
cat tools/osx-pkg.pmdoc/index.xml.tmpl \
| sed -E "s/\\{iojsversion\\}/$(FULLVERSION)/g" \
| sed -E "s/\\{npmversion\\}/$(NPMVERSION)/g" \
> tools/osx-pkg.pmdoc/index.xml
$(PACKAGEMAKER) \
--id "org.nodejs.Node" \
--id "org.iojs.pkg" \
--doc tools/osx-pkg.pmdoc \
--out $(PKG)
SIGN="$(INT_SIGN)" PKG="$(PKG)" bash tools/osx-productsign.sh
SIGN="$(PRODUCTSIGN_CERT)" PKG="$(PKG)" bash tools/osx-productsign.sh

pkg: $(PKG)

pkg-upload: pkg
ssh $(STAGINGSERVER) "mkdir -p staging/$(DISTTYPEDIR)/$(FULLVERSION)"
scp -p iojs-$(FULLVERSION).pkg $(STAGINGSERVER):staging/$(DISTTYPEDIR)/$(FULLVERSION)/iojs-$(FULLVERSION).pkg
ssh $(STAGINGSERVER) "touch staging/$(DISTTYPEDIR)/$(FULLVERSION)/iojs-$(FULLVERSION).pkg.done"

$(TARBALL): release-only $(NODE_EXE) doc
git checkout-index -a -f --prefix=$(TARNAME)/
Expand All @@ -305,6 +338,43 @@ endif

tar: $(TARBALL)

tar-upload: tar
ssh $(STAGINGSERVER) "mkdir -p staging/$(DISTTYPEDIR)/$(FULLVERSION)"
scp -p iojs-$(FULLVERSION).tar.gz $(STAGINGSERVER):staging/$(DISTTYPEDIR)/$(FULLVERSION)/iojs-$(FULLVERSION).tar.gz
ssh $(STAGINGSERVER) "touch staging/$(DISTTYPEDIR)/$(FULLVERSION)/iojs-$(FULLVERSION).tar.gz.done"
ifeq ($(XZ), 0)
scp -p iojs-$(FULLVERSION).tar.xz $(STAGINGSERVER):staging/$(DISTTYPEDIR)/$(FULLVERSION)/iojs-$(FULLVERSION).tar.xz
ssh $(STAGINGSERVER) "touch staging/$(DISTTYPEDIR)/$(FULLVERSION)/iojs-$(FULLVERSION).tar.xz.done"
endif

doc-upload: tar
ssh $(STAGINGSERVER) "mkdir -p staging/$(DISTTYPEDIR)/$(FULLVERSION)"
scp -r out/doc/ $(STAGINGSERVER):staging/$(DISTTYPEDIR)/$(FULLVERSION)/
ssh $(STAGINGSERVER) "touch staging/$(DISTTYPEDIR)/$(FULLVERSION)/doc.done"

$(TARBALL)-headers: config.gypi release-only
$(PYTHON) ./configure --prefix=/ --dest-cpu=$(DESTCPU) --tag=$(TAG) $(CONFIG_FLAGS)
HEADERS_ONLY=1 $(PYTHON) tools/install.py install '$(TARNAME)' '$(PREFIX)'
find $(TARNAME)/ -type l | xargs rm # annoying on windows
tar -cf $(TARNAME)-headers.tar $(TARNAME)
rm -rf $(TARNAME)
gzip -c -f -9 $(TARNAME)-headers.tar > $(TARNAME)-headers.tar.gz
ifeq ($(XZ), 0)
xz -c -f -$(XZ_COMPRESSION) $(TARNAME)-headers.tar > $(TARNAME)-headers.tar.xz
endif
rm $(TARNAME)-headers.tar

tar-headers: $(TARBALL)-headers

tar-headers-upload: tar-headers
ssh $(STAGINGSERVER) "mkdir -p staging/$(DISTTYPEDIR)/$(FULLVERSION)"
scp -p $(TARNAME)-headers.tar.gz $(STAGINGSERVER):staging/$(DISTTYPEDIR)/$(FULLVERSION)/$(TARNAME)-headers.tar.gz
ssh $(STAGINGSERVER) "touch staging/$(DISTTYPEDIR)/$(FULLVERSION)/$(TARNAME)-headers.tar.gz.done"
ifeq ($(XZ), 0)
scp -p $(TARNAME)-headers.tar.xz $(STAGINGSERVER):staging/$(DISTTYPEDIR)/$(FULLVERSION)/$(TARNAME)-headers.tar.xz
ssh $(STAGINGSERVER) "touch staging/$(DISTTYPEDIR)/$(FULLVERSION)/$(TARNAME)-headers.tar.xz.done"
endif

$(BINARYTAR): release-only
rm -rf $(BINARYNAME)
rm -rf out/deps out/Release
Expand All @@ -323,18 +393,14 @@ endif

binary: $(BINARYTAR)

$(PKGSRC): release-only
rm -rf dist out
$(PYTHON) configure --prefix=/ \
--dest-cpu=$(DESTCPU) --tag=$(TAG) $(CONFIG_FLAGS)
$(MAKE) install DESTDIR=dist
(cd dist; find * -type f | sort) > packlist
pkg_info -X pkg_install | \
egrep '^(MACHINE_ARCH|OPSYS|OS_VERSION|PKGTOOLS_VERSION)' > build-info
pkg_create -B build-info -c tools/pkgsrc/comment -d tools/pkgsrc/description \
-f packlist -I /opt/local -p dist -U $(PKGSRC)

pkgsrc: $(PKGSRC)
binary-upload: binary
ssh $(STAGINGSERVER) "mkdir -p staging/$(DISTTYPEDIR)/$(FULLVERSION)"
scp -p iojs-$(FULLVERSION)-$(OSTYPE)-$(ARCH).tar.gz $(STAGINGSERVER):staging/$(DISTTYPEDIR)/$(FULLVERSION)/iojs-$(FULLVERSION)-$(OSTYPE)-$(ARCH).tar.gz
ssh $(STAGINGSERVER) "touch staging/$(DISTTYPEDIR)/$(FULLVERSION)/iojs-$(FULLVERSION)-$(OSTYPE)-$(ARCH).tar.gz.done"
ifeq ($(XZ), 0)
scp -p iojs-$(FULLVERSION)-$(OSTYPE)-$(ARCH).tar.xz $(STAGINGSERVER):staging/$(DISTTYPEDIR)/$(FULLVERSION)/iojs-$(FULLVERSION)-$(OSTYPE)-$(ARCH).tar.xz
ssh $(STAGINGSERVER) "touch staging/$(DISTTYPEDIR)/$(FULLVERSION)/iojs-$(FULLVERSION)-$(OSTYPE)-$(ARCH).tar.xz.done"
endif

haswrk=$(shell which wrk > /dev/null 2>&1; echo $$?)
wrk:
Expand Down Expand Up @@ -382,9 +448,9 @@ bench-http-simple:
benchmark/http_simple_bench.sh

bench-idle:
./$(NODE_EXE) benchmark/idle_server.js &
$(NODE) benchmark/idle_server.js &
sleep 1
./$(NODE_EXE) benchmark/idle_clients.js &
$(NODE) benchmark/idle_clients.js &

jslintfix:
PYTHONPATH=tools/closure_linter/:tools/gflags/ $(PYTHON) tools/closure_linter/closure_linter/fixjsstyle.py --strict --nojsdoc -r lib/ -r src/ --exclude_files lib/punycode.js
Expand Down
6 changes: 5 additions & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import nodedownload
parser = optparse.OptionParser()

valid_os = ('win', 'mac', 'solaris', 'freebsd', 'openbsd', 'linux', 'android')
valid_arch = ('arm', 'arm64', 'ia32', 'mips', 'mipsel', 'x32', 'x64')
valid_arch = ('arm', 'arm64', 'ia32', 'mips', 'mipsel', 'x32', 'x64', 'x86')
valid_arm_float_abi = ('soft', 'softfp', 'hard')
valid_mips_arch = ('loongson', 'r1', 'r2', 'r6', 'rx')
valid_mips_fpu = ('fp32', 'fp64', 'fpxx')
Expand Down Expand Up @@ -584,6 +584,10 @@ def configure_node(o):

host_arch = host_arch_win() if os.name == 'nt' else host_arch_cc()
target_arch = options.dest_cpu or host_arch
# ia32 is preferred by the build tools (GYP) over x86 even if we prefer the latter
# the Makefile resets this to x86 afterward
if target_arch == 'x86':
target_arch = 'ia32'
o['variables']['host_arch'] = host_arch
o['variables']['target_arch'] = target_arch

Expand Down
9 changes: 4 additions & 5 deletions deps/openssl/doc/UPGRADING.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,10 @@ There are three kinds of private patches to be applied in openssl-1.0.2c.
### 3. Replace openssl header files in `deps/openssl/openssl/include/openssl`
all header files in `deps/openssl/openssl/include/openssl/*.h` are
symbolic links in the distributed release tar.gz. They cause issues in
Windows. They are replaced into the files to include a real header
file such as
````
#include "../../crypto/aes/aes.h"
````
Windows. They are copied from the real files of symlink origin into
the include directory. During installation, they also copied into
`PREFIX/node/include` by tools/install.py.

### 4. Change `opensslconf.h` so as to fit each platform.
No change.

Expand Down
Loading