From 66c8d37d23ddcb6ee987258955f1e9ba92d453ba Mon Sep 17 00:00:00 2001 From: Ray Donnelly Date: Sat, 30 Aug 2014 23:51:20 +0100 Subject: [PATCH 1/5] Win32: Update NODE_NET_SOCKET_{READ,WRITE}() macros They both take 4 arguments, not 2. --- src/node_win32_etw_provider.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/node_win32_etw_provider.h b/src/node_win32_etw_provider.h index 8d7cedd73be..69f20a2b18d 100644 --- a/src/node_win32_etw_provider.h +++ b/src/node_win32_etw_provider.h @@ -92,8 +92,8 @@ INLINE bool NODE_NET_SOCKET_READ_ENABLED(); INLINE bool NODE_NET_SOCKET_WRITE_ENABLED(); INLINE bool NODE_V8SYMBOL_ENABLED(); -#define NODE_NET_SOCKET_READ(arg0, arg1) -#define NODE_NET_SOCKET_WRITE(arg0, arg1) +#define NODE_NET_SOCKET_READ(arg0, arg1, arg2, arg3) +#define NODE_NET_SOCKET_WRITE(arg0, arg1, arg2, arg3) } // namespace node #endif // SRC_NODE_WIN32_ETW_PROVIDER_H_ From b31558d52f750c217d2e861853c4cfed5d33c46a Mon Sep 17 00:00:00 2001 From: Ray Donnelly Date: Sat, 30 Aug 2014 23:52:59 +0100 Subject: [PATCH 2/5] Win32: Update NODE_COUNT_GC_PERCENTTIME() macro It takes a single argument. --- src/node_counters.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node_counters.h b/src/node_counters.h index 8340ffcbd21..9a15bd889ae 100644 --- a/src/node_counters.h +++ b/src/node_counters.h @@ -37,7 +37,7 @@ #define NODE_COUNT_NET_BYTES_SENT(bytes) #define NODE_COUNT_NET_BYTES_RECV(bytes) #define NODE_COUNT_GET_GC_RAWTIME() -#define NODE_COUNT_GC_PERCENTTIME() +#define NODE_COUNT_GC_PERCENTTIME(percent) #define NODE_COUNT_PIPE_BYTES_SENT(bytes) #define NODE_COUNT_PIPE_BYTES_RECV(bytes) #endif From fc912c7b53e6c40a737b5c4663514b8ec4c0ba78 Mon Sep 17 00:00:00 2001 From: Ray Donnelly Date: Sat, 30 Aug 2014 23:56:53 +0100 Subject: [PATCH 3/5] Win32 etw: Use INT_PTR instead of INT32 in pointer casts --- src/node_win32_etw_provider-inl.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/node_win32_etw_provider-inl.h b/src/node_win32_etw_provider-inl.h index dc860e3e685..02743bc846e 100644 --- a/src/node_win32_etw_provider-inl.h +++ b/src/node_win32_etw_provider-inl.h @@ -25,6 +25,12 @@ #include "node_win32_etw_provider.h" #include "node_etw_provider.h" +#if defined(_WIN64) +# define ETW_WRITE_INTPTR_DATA ETW_WRITE_INT64_DATA +#else +# define ETW_WRITE_INTPTR_DATA ETW_WRITE_INT32_DATA +#endif + namespace node { // From node_win32_etw_provider.cc @@ -92,7 +98,7 @@ extern int events_enabled; ETW_WRITE_ADDRESS_DATA(descriptors, &context); \ ETW_WRITE_ADDRESS_DATA(descriptors + 1, &startAddr); \ ETW_WRITE_INT64_DATA(descriptors + 2, &size); \ - ETW_WRITE_INT32_DATA(descriptors + 3, &id); \ + ETW_WRITE_INTPTR_DATA(descriptors + 3, &id); \ ETW_WRITE_INT16_DATA(descriptors + 4, &flags); \ ETW_WRITE_INT16_DATA(descriptors + 5, &rangeId); \ ETW_WRITE_INT64_DATA(descriptors + 6, &sourceId); \ @@ -241,7 +247,7 @@ void NODE_V8SYMBOL_ADD(LPCSTR symbol, } void* context = NULL; INT64 size = (INT64)len; - INT32 id = (INT32)addr1; + INT_PTR id = (INT_PTR)addr1; INT16 flags = 0; INT16 rangeid = 1; INT32 col = 1; From b2768609c44b76474acbe95cfde226f464b22780 Mon Sep 17 00:00:00 2001 From: Ray Donnelly Date: Sat, 30 Aug 2014 23:59:05 +0100 Subject: [PATCH 4/5] Win32: Determine and use EXEEXT --- Makefile | 65 ++++++++++++++++++++++++++---------------------- tools/install.py | 4 ++- 2 files changed, 38 insertions(+), 31 deletions(-) diff --git a/Makefile b/Makefile index 11304e118f3..8bd5e089f5d 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,12 @@ DESTDIR ?= SIGN ?= PREFIX ?= /usr/local -NODE ?= ./node +# Determine EXEEXT +EXEEXT=$(shell $(PYTHON) -c "import sysconfig; print(sysconfig.get_config_var('EXE'))") + +NODE ?= ./node$(EXEEXT) +NODE_EXE = node$(EXEEXT) +NODE_G_EXE = node_g$(EXEEXT) # Default to verbose builds. # To do quiet/pretty builds, run `make V=` to set V to an empty string, @@ -23,31 +28,31 @@ endif # BUILDTYPE=Debug builds both release and debug builds. If you want to compile # just the debug build, run `make -C out BUILDTYPE=Debug` instead. ifeq ($(BUILDTYPE),Release) -all: out/Makefile node +all: out/Makefile $(NODE_EXE) else -all: out/Makefile node node_g +all: out/Makefile $(NODE_EXE) $(NODE_G_EXE) endif # The .PHONY is needed to ensure that we recursively use the out/Makefile # to check for changes. -.PHONY: node node_g +.PHONY: $(NODE_EXE) $(NODE_G_EXE) ifeq ($(USE_NINJA),1) -node: config.gypi +$(NODE_EXE): config.gypi $(NINJA) -C out/Release/ - ln -fs out/Release/node node + ln -fs out/Release/$(NODE_EXE) $@ -node_g: config.gypi +$(NODE_G_EXE): config.gypi $(NINJA) -C out/Debug/ - ln -fs out/Debug/node $@ + ln -fs out/Debug/$(NODE_EXE) $@ else -node: config.gypi out/Makefile +$(NODE_EXE): config.gypi out/Makefile $(MAKE) -C out BUILDTYPE=Release V=$(V) - ln -fs out/Release/node node + ln -fs out/Release/$(NODE_EXE) $@ -node_g: config.gypi out/Makefile +$(NODE_G_EXE): config.gypi out/Makefile $(MAKE) -C out BUILDTYPE=Debug V=$(V) - ln -fs out/Debug/node $@ + ln -fs out/Debug/$(NODE_EXE) $@ endif out/Makefile: common.gypi deps/uv/uv.gyp deps/http_parser/http_parser.gyp deps/zlib/zlib.gyp deps/v8/build/toolchain.gypi deps/v8/build/features.gypi deps/v8/tools/gyp/v8.gyp node.gyp config.gypi @@ -72,7 +77,7 @@ uninstall: $(PYTHON) tools/install.py $@ '$(DESTDIR)' '$(PREFIX)' clean: - -rm -rf out/Makefile node node_g out/$(BUILDTYPE)/node blog.html email.md + -rm -rf out/Makefile $(NODE_EXE) $(NODE_G_EXE) out/$(BUILDTYPE)/$(NODE_EXE) blog.html email.md -find out/ -name '*.o' -o -name '*.a' | xargs rm -rf -rm -rf node_modules @@ -80,7 +85,7 @@ distclean: -rm -rf out -rm -f config.gypi -rm -f config.mk - -rm -rf node node_g blog.html email.md + -rm -rf $(NODE_EXE) $(NODE_G_EXE) blog.html email.md -rm -rf node_modules test: all @@ -95,8 +100,8 @@ test-valgrind: all $(PYTHON) tools/test.py --mode=release --valgrind simple message test/gc/node_modules/weak/build/Release/weakref.node: - @if [ ! -f node ]; then make all; fi - ./node deps/npm/node_modules/node-gyp/bin/node-gyp rebuild \ + @if [ ! -f $(NODE_EXE) ]; then make all; fi + ./$(NODE_EXE) deps/npm/node_modules/node-gyp/bin/node-gyp rebuild \ --directory="$(shell pwd)/test/gc/node_modules/weak" \ --nodedir="$(shell pwd)" @@ -146,11 +151,11 @@ test-internet: all test-debugger: all $(PYTHON) tools/test.py debugger -test-npm: node - ./node deps/npm/test/run.js +test-npm: $(NODE_EXE) + ./$(NODE_EXE) deps/npm/test/run.js -test-npm-publish: node - npm_package_config_publishtest=true ./node deps/npm/test/run.js +test-npm-publish: $(NODE_EXE) + npm_package_config_publishtest=true ./$(NODE_EXE) deps/npm/test/run.js test-addons: test-build $(PYTHON) tools/test.py --mode=release addons @@ -174,7 +179,7 @@ website_files = \ out/doc/sh_main.js \ out/doc/sh_javascript.min.js -doc: $(apidoc_dirs) $(website_files) $(apiassets) $(apidocs) tools/doc/ out/doc/changelog.html node +doc: $(apidoc_dirs) $(website_files) $(apiassets) $(apidocs) tools/doc/ out/doc/changelog.html $(NODE_EXE) $(apidoc_dirs): mkdir -p $@ @@ -182,24 +187,24 @@ $(apidoc_dirs): out/doc/api/assets/%: doc/api_assets/% out/doc/api/assets/ cp $< $@ -out/doc/changelog.html: ChangeLog doc/changelog-head.html doc/changelog-foot.html tools/build-changelog.sh node +out/doc/changelog.html: ChangeLog doc/changelog-head.html doc/changelog-foot.html tools/build-changelog.sh $(NODE_EXE) bash tools/build-changelog.sh out/doc/%: doc/% cp -r $< $@ -out/doc/api/%.json: doc/api/%.markdown node - out/Release/node tools/doc/generate.js --format=json $< > $@ +out/doc/api/%.json: doc/api/%.markdown $(NODE_EXE) + out/Release/$(NODE_EXE) tools/doc/generate.js --format=json $< > $@ -out/doc/api/%.html: doc/api/%.markdown node - out/Release/node tools/doc/generate.js --format=html --template=doc/template.html $< > $@ +out/doc/api/%.html: doc/api/%.markdown $(NODE_EXE) + out/Release/$(NODE_EXE) tools/doc/generate.js --format=html --template=doc/template.html $< > $@ email.md: ChangeLog tools/email-footer.md bash tools/changelog-head.sh | sed 's|^\* #|* \\#|g' > $@ cat tools/email-footer.md | sed -e 's|__VERSION__|'$(VERSION)'|g' >> $@ blog.html: email.md - cat $< | ./node tools/doc/node_modules/.bin/marked > $@ + cat $< | ./$(NODE_EXE) tools/doc/node_modules/.bin/marked > $@ website-upload: doc rsync -r out/doc/ node@nodejs.org:~/web/nodejs.org/ @@ -300,7 +305,7 @@ $(PKG): release-only --out $(PKG) SIGN="$(INT_SIGN)" PKG="$(PKG)" bash tools/osx-productsign.sh -$(TARBALL): release-only node doc +$(TARBALL): release-only $(NODE_EXE) doc git archive --format=tar --prefix=$(TARNAME)/ HEAD | tar xf - mkdir -p $(TARNAME)/doc/api cp doc/node.1 $(TARNAME)/doc/node.1 @@ -387,9 +392,9 @@ bench-http-simple: benchmark/http_simple_bench.sh bench-idle: - ./node benchmark/idle_server.js & + ./$(NODE_EXE) benchmark/idle_server.js & sleep 1 - ./node benchmark/idle_clients.js & + ./$(NODE_EXE) benchmark/idle_clients.js & jslintfix: PYTHONPATH=tools/closure_linter/ $(PYTHON) tools/closure_linter/closure_linter/fixjsstyle.py --strict --nojsdoc -r lib/ -r src/ --exclude_files lib/punycode.js diff --git a/tools/install.py b/tools/install.py index 67f72ea027c..14342354d13 100755 --- a/tools/install.py +++ b/tools/install.py @@ -11,6 +11,7 @@ import re import shutil import sys +import sysconfig # set at init time node_prefix = '/usr/local' # PREFIX variable from Makefile @@ -127,7 +128,8 @@ def subdir_files(path, dest, action): action(files, subdir + '/') def files(action): - action(['out/Release/node'], 'bin/node') + exeext=sysconfig.get_config_var('EXE') + action(['out/Release/node' + exeext], 'bin/node' + exeext) if 'true' == variables.get('node_use_dtrace'): action(['out/Release/node.d'], 'lib/dtrace/node.d') From 0ece2fec011197ba67a2515c89296c062a64d16a Mon Sep 17 00:00:00 2001 From: Ray Donnelly Date: Sun, 31 Aug 2014 00:01:19 +0100 Subject: [PATCH 5/5] Win32 gyp: If sys.platform is 'msys' use make, not msvs --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index 2e085832546..cc5bf53dd31 100755 --- a/configure +++ b/configure @@ -760,7 +760,7 @@ if options.use_ninja: gyp_args += ['-f', 'ninja-' + flavor] elif options.use_xcode: gyp_args += ['-f', 'xcode'] -elif flavor == 'win': +elif flavor == 'win' and sys.platform != 'msys': gyp_args += ['-f', 'msvs', '-G', 'msvs_version=auto'] else: gyp_args += ['-f', 'make-' + flavor]