GeezerVison is showing github.com — src: introduce process.release object · nodejs/node@04fd4fa
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: Makefile +23-9Lines changed: 23 additions & 9 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -156,7 +156,7 @@ test-timers-clean: | 156 | 156 |
| 157 | 157 | apidoc_sources = $(wildcard doc/api/*.markdown) | 158 | 158 | apidocs = $(addprefix out/,$(apidoc_sources:.markdown=.html)) \ | 159 | | - $(addprefix out/,$(apidoc_sources:.markdown=.json)) | | 159 | + $(addprefix out/,$(apidoc_sources:.markdown=.json)) | 160 | 160 |
| 161 | 161 | apidoc_dirs = out/doc out/doc/api/ out/doc/api/assets | 162 | 162 |
| @@ -269,7 +269,7 @@ release-only: | 269 | 269 | @if [ "$(shell git status --porcelain | egrep -v '^\?\? ')" = "" ]; then \ | 270 | 270 | exit 0 ; \ | 271 | 271 | else \ | 272 | | - echo "" >&2 ; \ | | 272 | + echo "" >&2 ; \ | 273 | 273 | echo "The git repository is not clean." >&2 ; \ | 274 | 274 | echo "Please commit changes before building release tarball." >&2 ; \ | 275 | 275 | echo "" >&2 ; \ | @@ -280,17 +280,21 @@ release-only: | 280 | 280 | @if [ "$(DISTTYPE)" != "release" -o "$(RELEASE)" = "1" ]; then \ | 281 | 281 | exit 0; \ | 282 | 282 | else \ | 283 | | - echo "" >&2 ; \ | | 283 | + echo "" >&2 ; \ | 284 | 284 | echo "#NODE_VERSION_IS_RELEASE is set to $(RELEASE)." >&2 ; \ | 285 | | - echo "Did you remember to update src/node_version.h?" >&2 ; \ | 286 | | - echo "" >&2 ; \ | | 285 | + echo "Did you remember to update src/node_version.h?" >&2 ; \ | | 286 | + echo "" >&2 ; \ | 287 | 287 | exit 1 ; \ | 288 | 288 | fi | 289 | 289 |
| 290 | 290 | $(PKG): release-only | 291 | 291 | rm -rf $(PKGDIR) | 292 | 292 | rm -rf out/deps out/Release | 293 | | - $(PYTHON) ./configure --dest-cpu=x64 --tag=$(TAG) | | 293 | + $(PYTHON) ./configure \ | | 294 | + --dest-cpu=x64 \ | | 295 | + --tag=$(TAG) \ | | 296 | + --release-urlbase=$(RELEASE_URLBASE) \ | | 297 | + $(CONFIG_FLAGS) | 294 | 298 | $(MAKE) install V=$(V) DESTDIR=$(PKGDIR) | 295 | 299 | SIGN="$(CODESIGN_CERT)" PKGDIR="$(PKGDIR)" bash tools/osx-codesign.sh | 296 | 300 | cat tools/osx-pkg.pmdoc/index.xml.tmpl \ | @@ -346,7 +350,12 @@ doc-upload: tar | 346 | 350 | ssh $(STAGINGSERVER) "touch staging/$(DISTTYPEDIR)/$(FULLVERSION)/doc.done" | 347 | 351 |
| 348 | 352 | $(TARBALL)-headers: config.gypi release-only | 349 | | - $(PYTHON) ./configure --prefix=/ --dest-cpu=$(DESTCPU) --tag=$(TAG) $(CONFIG_FLAGS) | | 353 | + $(PYTHON) ./configure \ | | 354 | + --prefix=/ \ | | 355 | + --dest-cpu=$(DESTCPU) \ | | 356 | + --tag=$(TAG) \ | | 357 | + --release-urlbase=$(RELEASE_URLBASE) \ | | 358 | + $(CONFIG_FLAGS) | 350 | 359 | HEADERS_ONLY=1 $(PYTHON) tools/install.py install '$(TARNAME)' '/' | 351 | 360 | find $(TARNAME)/ -type l | xargs rm # annoying on windows | 352 | 361 | tar -cf $(TARNAME)-headers.tar $(TARNAME) | @@ -371,7 +380,12 @@ endif | 371 | 380 | $(BINARYTAR): release-only | 372 | 381 | rm -rf $(BINARYNAME) | 373 | 382 | rm -rf out/deps out/Release | 374 | | - $(PYTHON) ./configure --prefix=/ --dest-cpu=$(DESTCPU) --tag=$(TAG) $(CONFIG_FLAGS) | | 383 | + $(PYTHON) ./configure \ | | 384 | + --prefix=/ \ | | 385 | + --dest-cpu=$(DESTCPU) \ | | 386 | + --tag=$(TAG) \ | | 387 | + --release-urlbase=$(RELEASE_URLBASE) \ | | 388 | + $(CONFIG_FLAGS) | 375 | 389 | $(MAKE) install DESTDIR=$(BINARYNAME) V=$(V) PORTABLE=1 | 376 | 390 | cp README.md $(BINARYNAME) | 377 | 391 | cp LICENSE $(BINARYNAME) | @@ -438,7 +452,7 @@ bench-all: bench bench-misc bench-array bench-buffer bench-url bench-events | 438 | 452 | bench: bench-net bench-http bench-fs bench-tls | 439 | 453 |
| 440 | 454 | bench-http-simple: | 441 | | - benchmark/http_simple_bench.sh | | 455 | + benchmark/http_simple_bench.sh | 442 | 456 |
| 443 | 457 | bench-idle: | 444 | 458 | $(NODE) benchmark/idle_server.js & | |
Collapse file Copy file name to clipboardExpand all lines: configure +9Lines changed: 9 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -191,6 +191,13 @@ parser.add_option('--tag', | 191 | 191 | dest='tag', | 192 | 192 | help='custom build tag') | 193 | 193 |
| | 194 | +parser.add_option('--release-urlbase', | | 195 | + action='store', | | 196 | + dest='release_urlbase', | | 197 | + help='Provide a custom URL prefix for the `process.release` properties ' | | 198 | + '`sourceUrl` and `headersUrl`. When compiling a release build, this ' | | 199 | + 'will default to https://iojs.org/download/release/') | | 200 | + | 194 | 201 | parser.add_option('--v8-options', | 195 | 202 | action='store', | 196 | 203 | dest='v8_options', | @@ -675,6 +682,8 @@ def configure_node(o): | 675 | 682 | else: | 676 | 683 | o['variables']['node_tag'] = '' | 677 | 684 |
| | 685 | + o['variables']['node_release_urlbase'] = options.release_urlbase or '' | | 686 | + | 678 | 687 | if options.v8_options: | 679 | 688 | o['variables']['node_v8_options'] = options.v8_options.replace('"', '\\"') | 680 | 689 |
| |
Collapse file Copy file name to clipboardExpand all lines: doc/api/process.markdown +30Lines changed: 30 additions & 0 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -672,6 +672,36 @@ An example of the possible output looks like: | 672 | 672 | target_arch: 'x64', | 673 | 673 | v8_use_snapshot: 'true' } } | 674 | 674 |
| | 675 | +## process.release | | 676 | + | | 677 | +An Object containing metadata related to the current release, including URLs | | 678 | +for the source tarball and headers-only tarball. | | 679 | + | | 680 | +`process.release` contains the following properties: | | 681 | + | | 682 | +* `name`: a string with a value that will always be `"io.js"` for io.js. | | 683 | +* `sourceUrl`: a complete URL pointing to a _.tar.gz_ file containing the | | 684 | + source of the current release. | | 685 | +* `headersUrl`: a complete URL pointing to a _.tar.gz_ file containing only | | 686 | + the header files for the current release. This file is significantly smaller | | 687 | + than the full source file and can be used for compiling add-ons against | | 688 | + io.js. | | 689 | +* `libUrl`: a complete URL pointing to an _iojs.lib_ file matching the | | 690 | + architecture and version of the current release. This file is used for | | 691 | + compiling add-ons against io.js. _This property is only present on Windows | | 692 | + builds of io.js and will be missing on all other platforms._ | | 693 | + | | 694 | +e.g. | | 695 | + | | 696 | + { name: 'io.js', | | 697 | + sourceUrl: 'https://iojs.org/download/release/v2.3.5/iojs-v2.3.5.tar.gz', | | 698 | + headersUrl: 'https://iojs.org/download/release/v2.3.5/iojs-v2.3.5-headers.tar.gz', | | 699 | + libUrl: 'https://iojs.org/download/release/v2.3.5/win-x64/iojs.lib' } | | 700 | + | | 701 | +In custom builds from non-release versions of the source tree, only the | | 702 | +`name` property may be present. The additional properties should not be | | 703 | +relied upon to exist. | | 704 | + | 675 | 705 | ## process.kill(pid[, signal]) | 676 | 706 |
| 677 | 707 | Send a signal to a process. `pid` is the process id and `signal` is the | |
Collapse file Copy file name to clipboardExpand all lines: node.gyp +5Lines changed: 5 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 194 | 194 | 'src/node_main.cc', | 195 | 195 | ], | 196 | 196 | }], | | 197 | + [ 'node_release_urlbase!=""', { | | 198 | + 'defines': [ | | 199 | + 'NODE_RELEASE_URLBASE="<(node_release_urlbase)"', | | 200 | + ] | | 201 | + }], | 197 | 202 | [ 'v8_enable_i18n_support==1', { | 198 | 203 | 'defines': [ 'NODE_HAVE_I18N_SUPPORT=1' ], | 199 | 204 | 'dependencies': [ | |
Collapse file Copy file name to clipboardExpand all lines: src/node.cc +33Lines changed: 33 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -2760,6 +2760,39 @@ void SetupProcessObject(Environment* env, | 2760 | 2760 | "platform", | 2761 | 2761 | OneByteString(env->isolate(), NODE_PLATFORM)); | 2762 | 2762 |
| | 2763 | + // process.release | | 2764 | + Local<Object> release = Object::New(env->isolate()); | | 2765 | + READONLY_PROPERTY(process, "release", release); | | 2766 | + READONLY_PROPERTY(release, "name", OneByteString(env->isolate(), "io.js")); | | 2767 | + | | 2768 | +// if this is a release build and no explicit base has been set | | 2769 | +// substitute the standard release download URL | | 2770 | +#ifndef NODE_RELEASE_URLBASE | | 2771 | +# if NODE_VERSION_IS_RELEASE | | 2772 | +# define NODE_RELEASE_URLBASE "https://iojs.org/download/release/" | | 2773 | +# endif | | 2774 | +#endif | | 2775 | + | | 2776 | +#if defined(NODE_RELEASE_URLBASE) | | 2777 | +# define _RELEASE_URLPFX NODE_RELEASE_URLBASE "v" NODE_VERSION_STRING "/" | | 2778 | +# define _RELEASE_URLFPFX _RELEASE_URLPFX "iojs-v" NODE_VERSION_STRING | | 2779 | + | | 2780 | + READONLY_PROPERTY(release, | | 2781 | + "sourceUrl", | | 2782 | + OneByteString(env->isolate(), | | 2783 | + _RELEASE_URLFPFX ".tar.gz")); | | 2784 | + READONLY_PROPERTY(release, | | 2785 | + "headersUrl", | | 2786 | + OneByteString(env->isolate(), | | 2787 | + _RELEASE_URLFPFX "-headers.tar.gz")); | | 2788 | +# ifdef _WIN32 | | 2789 | + READONLY_PROPERTY(release, | | 2790 | + "libUrl", | | 2791 | + OneByteString(env->isolate(), | | 2792 | + _RELEASE_URLPFX "win-" NODE_ARCH "/iojs.lib")); | | 2793 | +# endif | | 2794 | +#endif | | 2795 | + | 2763 | 2796 | // process.argv | 2764 | 2797 | Local<Array> arguments = Array::New(env->isolate(), argc); | 2765 | 2798 | for (int i = 0; i < argc; ++i) { | |
Collapse file Copy file name to clipboardExpand all lines: vcbuild.bat +2Lines changed: 2 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -35,6 +35,7 @@ set noperfctr_arg= | 35 | 35 | set noperfctr_msi_arg= | 36 | 36 | set i18n_arg= | 37 | 37 | set download_arg= | | 38 | +set release_urls_arg= | 38 | 39 |
| 39 | 40 | :next-arg | 40 | 41 | if "%1"=="" goto args-done | @@ -79,6 +80,7 @@ if "%config%"=="Debug" set debug_arg=--debug | 79 | 80 | if defined nosnapshot set snapshot_arg=--without-snapshot | 80 | 81 | if defined noetw set noetw_arg=--without-etw& set noetw_msi_arg=/p:NoETW=1 | 81 | 82 | if defined noperfctr set noperfctr_arg=--without-perfctr& set noperfctr_msi_arg=/p:NoPerfCtr=1 | | 83 | +if defined RELEASE_URLBASE set release_urlbase_arg=--release-urlbase=%RELEASE_URLBASE% | 82 | 84 |
| 83 | 85 | if "%i18n_arg%"=="full-icu" set i18n_arg=--with-intl=full-icu | 84 | 86 | if "%i18n_arg%"=="small-icu" set i18n_arg=--with-intl=small-icu | |
|