Skip to content

Commit 24856f0

Browse files
committed
Merge remote-tracking branch 'origin/v0.10'
Conflicts: lib/domain.js
2 parents 2e3da9b + 7f81ca2 commit 24856f0

12 files changed

Lines changed: 210 additions & 63 deletions

File tree

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
title: The Next Phase of Node.js
2+
date: Wed Jan 15 09:00:00 PST 2014
3+
author: Isaac Z. Schlueter
4+
slug: the-next-phase-of-node-js
5+
6+
Node's growth has continued and accelerated immensely over the last
7+
few years. More people are developing and sharing more code with Node
8+
and npm than I would have ever imagined. Countless companies are
9+
using Node, and npm along with it.
10+
11+
Over the last year, [TJ Fontaine](https://twitter.com/tjfontaine) has become absolutely essential to the
12+
Node.js project. He's been building releases, managing the test bots,
13+
[fixing nasty
14+
bugs](http://www.joyent.com/blog/walmart-node-js-memory-leak) and
15+
making decisions for the project with constant focus on the needs of
16+
our users. He was responsible for an update to MDB to [support
17+
running ::findjsobjects on Linux core
18+
dumps](http://www.slideshare.net/bcantrill/node-summit2013), and is
19+
working on a shim layer that will provide a stable C interface for
20+
Node binary addons. In partnership with Joyent and The Node Firm,
21+
he's helped to create a path forward for scalable issue triaging.
22+
He's become the primary point of contact keeping us all driving the
23+
project forward together.
24+
25+
Anyone who's been close to the core project knows that he's been
26+
effectively leading the project for a while now, so we're making it
27+
official. Effective immediately, TJ Fontaine is the Node.js project
28+
lead. I will remain a Node core committer, and expect to continue to
29+
contribute to the project in that role. My primary focus, however,
30+
will be npm.
31+
32+
At this point, npm needs work, and I am eager to deliver what the Node
33+
community needs from its package manager. I am starting a company,
34+
npm, Inc., to deliver new products and services related to npm. I'll
35+
be sharing many more details soon about exactly how this is going to
36+
work, and what we'll be offering. For now, suffice it to say that
37+
everything currently free will remain free, and everything currently
38+
flaky will get less flaky. Pursuing new revenue is how we can keep
39+
providing the npm registry service in a long-term sustainable way, and
40+
it has to be done very carefully so that we don't damage what we've
41+
all built together.
42+
43+
npm is what I'm most passionate about, and I am now in a position to
44+
give it my full attention. I've done more than I could have hoped to
45+
accomplish in running Node core, and it's well past time to hand the
46+
control of the project off to its next gatekeeper.
47+
48+
TJ is exactly the leader who can help us take Node.js to 1.0 and
49+
beyond. He brings professionalism, rigor, and a continued focus on
50+
inclusive community values and culture. In the coming days, TJ will
51+
spell out his plans in greater detail. I look forward to the places
52+
that Node will go with his guidance.
53+
54+
Please join me in welcoming him to this new role :)

lib/domain.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -136,14 +136,13 @@ Domain.prototype.enter = function() {
136136

137137

138138
Domain.prototype.exit = function() {
139-
if (this._disposed) return;
139+
// skip disposed domains, as usual, but also don't do anything if this
140+
// domain is not on the stack.
141+
var index = stack.lastIndexOf(this);
142+
if (this._disposed || index === -1) return;
140143

141144
// exit all domains until this one.
142-
var index = stack.lastIndexOf(this);
143-
if (index !== -1)
144-
stack.splice(index);
145-
else
146-
stack.length = 0;
145+
stack.splice(index);
147146
_domain_flag[0] = stack.length;
148147

149148
exports.active = stack[stack.length - 1];
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// Copyright Joyent, Inc. and other Node contributors.
2+
//
3+
// Permission is hereby granted, free of charge, to any person obtaining a
4+
// copy of this software and associated documentation files (the
5+
// "Software"), to deal in the Software without restriction, including
6+
// without limitation the rights to use, copy, modify, merge, publish,
7+
// distribute, sublicense, and/or sell copies of the Software, and to permit
8+
// persons to whom the Software is furnished to do so, subject to the
9+
// following conditions:
10+
//
11+
// The above copyright notice and this permission notice shall be included
12+
// in all copies or substantial portions of the Software.
13+
//
14+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15+
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16+
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
17+
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18+
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19+
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20+
// USE OR OTHER DEALINGS IN THE SOFTWARE.
21+
22+
23+
// Make sure the domain stack doesn't get clobbered by un-matched .exit()
24+
25+
var assert = require('assert');
26+
var domain = require('domain');
27+
28+
var a = domain.create();
29+
var b = domain.create();
30+
31+
a.enter(); // push
32+
b.enter(); // push
33+
assert.deepEqual(domain._stack, [a, b], 'b not pushed');
34+
35+
domain.create().exit(); // no-op
36+
assert.deepEqual(domain._stack, [a, b], 'stack mangled!');

tools/gyp/AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ Yandex LLC
77

88
Steven Knight <knight@baldmt.com>
99
Ryan Norton <rnorton10@gmail.com>
10+
David J. Sankel <david@sankelsoftware.com>
1011
Eric N. Vander Weele <ericvw@gmail.com>

tools/gyp/pylib/gyp/MSVSVersion.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,11 @@ def SetupScript(self, target_arch):
9696
else:
9797
assert target_arch == 'x64'
9898
arg = 'x86_amd64'
99-
if (os.environ.get('PROCESSOR_ARCHITECTURE') == 'AMD64' or
99+
# Use the 64-on-64 compiler if we're not using an express
100+
# edition and we're running on a 64bit OS.
101+
if self.short_name[-1] != 'e' and (
102+
os.environ.get('PROCESSOR_ARCHITECTURE') == 'AMD64' or
100103
os.environ.get('PROCESSOR_ARCHITEW6432') == 'AMD64'):
101-
# Use the 64-on-64 compiler if we can.
102104
arg = 'amd64'
103105
return [os.path.normpath(
104106
os.path.join(self.path, 'VC/vcvarsall.bat')), arg]

tools/gyp/pylib/gyp/generator/make.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1951,7 +1951,8 @@ def CalculateMakefilePath(build_file, base_name):
19511951
# We write the file in the base_path directory.
19521952
output_file = os.path.join(options.depth, base_path, base_name)
19531953
if options.generator_output:
1954-
output_file = os.path.join(options.generator_output, output_file)
1954+
output_file = os.path.join(
1955+
options.depth, options.generator_output, base_path, base_name)
19551956
base_path = gyp.common.RelativePath(os.path.dirname(build_file),
19561957
options.toplevel_dir)
19571958
return base_path, output_file
@@ -1974,7 +1975,8 @@ def CalculateMakefilePath(build_file, base_name):
19741975
makefile_path = os.path.join(options.toplevel_dir, makefile_name)
19751976
if options.generator_output:
19761977
global srcdir_prefix
1977-
makefile_path = os.path.join(options.generator_output, makefile_path)
1978+
makefile_path = os.path.join(
1979+
options.toplevel_dir, options.generator_output, makefile_name)
19781980
srcdir = gyp.common.RelativePath(srcdir, options.generator_output)
19791981
srcdir_prefix = '$(srcdir)/'
19801982

@@ -2094,7 +2096,8 @@ def CalculateMakefilePath(build_file, base_name):
20942096

20952097
this_make_global_settings = data[build_file].get('make_global_settings', [])
20962098
assert make_global_settings_array == this_make_global_settings, (
2097-
"make_global_settings needs to be the same for all targets.")
2099+
"make_global_settings needs to be the same for all targets. %s vs. %s" %
2100+
(this_make_global_settings, make_global_settings))
20982101

20992102
build_files.add(gyp.common.RelativePath(build_file, options.toplevel_dir))
21002103
included_files = data[build_file]['included_files']

tools/gyp/pylib/gyp/generator/msvs.py

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -209,13 +209,14 @@ def _FixPaths(paths):
209209

210210

211211
def _ConvertSourcesToFilterHierarchy(sources, prefix=None, excluded=None,
212-
list_excluded=True):
212+
list_excluded=True, msvs_version=None):
213213
"""Converts a list split source file paths into a vcproj folder hierarchy.
214214
215215
Arguments:
216216
sources: A list of source file paths split.
217217
prefix: A list of source file path layers meant to apply to each of sources.
218218
excluded: A set of excluded files.
219+
msvs_version: A MSVSVersion object.
219220
220221
Returns:
221222
A hierarchy of filenames and MSVSProject.Filter objects that matches the
@@ -230,6 +231,7 @@ def _ConvertSourcesToFilterHierarchy(sources, prefix=None, excluded=None,
230231
if not prefix: prefix = []
231232
result = []
232233
excluded_result = []
234+
folders = OrderedDict()
233235
# Gather files into the final result, excluded, or folders.
234236
for s in sources:
235237
if len(s) == 1:
@@ -238,17 +240,35 @@ def _ConvertSourcesToFilterHierarchy(sources, prefix=None, excluded=None,
238240
excluded_result.append(filename)
239241
else:
240242
result.append(filename)
243+
elif msvs_version and not msvs_version.UsesVcxproj():
244+
# For MSVS 2008 and earlier, we need to process all files before walking
245+
# the sub folders.
246+
if not folders.get(s[0]):
247+
folders[s[0]] = []
248+
folders[s[0]].append(s[1:])
241249
else:
242250
contents = _ConvertSourcesToFilterHierarchy([s[1:]], prefix + [s[0]],
243251
excluded=excluded,
244-
list_excluded=list_excluded)
252+
list_excluded=list_excluded,
253+
msvs_version=msvs_version)
245254
contents = MSVSProject.Filter(s[0], contents=contents)
246255
result.append(contents)
247256
# Add a folder for excluded files.
248257
if excluded_result and list_excluded:
249258
excluded_folder = MSVSProject.Filter('_excluded_files',
250259
contents=excluded_result)
251260
result.append(excluded_folder)
261+
262+
if msvs_version and msvs_version.UsesVcxproj():
263+
return result
264+
265+
# Populate all the folders.
266+
for f in folders:
267+
contents = _ConvertSourcesToFilterHierarchy(folders[f], prefix=prefix + [f],
268+
excluded=excluded,
269+
list_excluded=list_excluded)
270+
contents = MSVSProject.Filter(f, contents=contents)
271+
result.append(contents)
252272
return result
253273

254274

@@ -971,8 +991,9 @@ def _GenerateMSVSProject(project, options, version, generator_flags):
971991
actions_to_add)
972992
list_excluded = generator_flags.get('msvs_list_excluded_files', True)
973993
sources, excluded_sources, excluded_idl = (
974-
_AdjustSourcesAndConvertToFilterHierarchy(
975-
spec, options, project_dir, sources, excluded_sources, list_excluded))
994+
_AdjustSourcesAndConvertToFilterHierarchy(spec, options, project_dir,
995+
sources, excluded_sources,
996+
list_excluded, version))
976997

977998
# Add in files.
978999
missing_sources = _VerifySourcesExist(sources, project_dir)
@@ -1416,7 +1437,7 @@ def _PrepareListOfSources(spec, generator_flags, gyp_file):
14161437

14171438

14181439
def _AdjustSourcesAndConvertToFilterHierarchy(
1419-
spec, options, gyp_dir, sources, excluded_sources, list_excluded):
1440+
spec, options, gyp_dir, sources, excluded_sources, list_excluded, version):
14201441
"""Adjusts the list of sources and excluded sources.
14211442
14221443
Also converts the sets to lists.
@@ -1427,6 +1448,7 @@ def _AdjustSourcesAndConvertToFilterHierarchy(
14271448
gyp_dir: The path to the gyp file being processed.
14281449
sources: A set of sources to be included for this project.
14291450
excluded_sources: A set of sources to be excluded for this project.
1451+
version: A MSVSVersion object.
14301452
Returns:
14311453
A trio of (list of sources, list of excluded sources,
14321454
path of excluded IDL file)
@@ -1451,7 +1473,8 @@ def _AdjustSourcesAndConvertToFilterHierarchy(
14511473
# Convert to folders and the right slashes.
14521474
sources = [i.split('\\') for i in sources]
14531475
sources = _ConvertSourcesToFilterHierarchy(sources, excluded=fully_excluded,
1454-
list_excluded=list_excluded)
1476+
list_excluded=list_excluded,
1477+
msvs_version=version)
14551478

14561479
# Prune filters with a single child to flatten ugly directory structures
14571480
# such as ../../src/modules/module1 etc.
@@ -3126,7 +3149,7 @@ def _GenerateMSBuildProject(project, options, version, generator_flags):
31263149
_AdjustSourcesAndConvertToFilterHierarchy(spec, options,
31273150
project_dir, sources,
31283151
excluded_sources,
3129-
list_excluded))
3152+
list_excluded, version))
31303153

31313154
# Don't add actions if we are using an external builder like ninja.
31323155
if not spec.get('msvs_external_builder'):

tools/gyp/pylib/gyp/generator/ninja.py

Lines changed: 38 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1037,12 +1037,13 @@ def WriteLinkForArch(self, ninja_file, spec, config_name, config,
10371037
self.GypPathToNinja, arch)
10381038
ldflags = env_ldflags + ldflags
10391039
elif self.flavor == 'win':
1040-
manifest_name = self.GypPathToUniqueOutput(
1040+
manifest_base_name = self.GypPathToUniqueOutput(
10411041
self.ComputeOutputFileName(spec))
10421042
ldflags, intermediate_manifest, manifest_files = \
10431043
self.msvs_settings.GetLdflags(config_name, self.GypPathToNinja,
1044-
self.ExpandSpecial, manifest_name,
1045-
is_executable, self.toplevel_build)
1044+
self.ExpandSpecial, manifest_base_name,
1045+
output, is_executable,
1046+
self.toplevel_build)
10461047
ldflags = env_ldflags + ldflags
10471048
self.WriteVariableList(ninja_file, 'manifests', manifest_files)
10481049
implicit_deps = implicit_deps.union(manifest_files)
@@ -1095,16 +1096,27 @@ def WriteLinkForArch(self, ninja_file, spec, config_name, config,
10951096
extra_bindings.append(('lib',
10961097
gyp.common.EncodePOSIXShellArgument(output)))
10971098
if self.flavor == 'win':
1098-
extra_bindings.append(('dll', output))
1099+
extra_bindings.append(('binary', output))
10991100
if '/NOENTRY' not in ldflags:
11001101
self.target.import_lib = output + '.lib'
11011102
extra_bindings.append(('implibflag',
11021103
'/IMPLIB:%s' % self.target.import_lib))
1104+
pdbname = self.msvs_settings.GetPDBName(
1105+
config_name, self.ExpandSpecial, output + '.pdb')
11031106
output = [output, self.target.import_lib]
1107+
if pdbname:
1108+
output.append(pdbname)
11041109
elif not self.is_mac_bundle:
11051110
output = [output, output + '.TOC']
11061111
else:
11071112
command = command + '_notoc'
1113+
elif self.flavor == 'win':
1114+
extra_bindings.append(('binary', output))
1115+
pdbname = self.msvs_settings.GetPDBName(
1116+
config_name, self.ExpandSpecial, output + '.pdb')
1117+
if pdbname:
1118+
output = [output, pdbname]
1119+
11081120

11091121
if len(solibs):
11101122
extra_bindings.append(('solibs', gyp.common.EncodePOSIXShellList(solibs)))
@@ -1545,7 +1557,10 @@ class MEMORYSTATUSEX(ctypes.Structure):
15451557

15461558
mem_limit = max(1, stat.ullTotalPhys / (4 * (2 ** 30))) # total / 4GB
15471559
hard_cap = max(1, int(os.getenv('GYP_LINK_CONCURRENCY_MAX', 2**32)))
1548-
return min(mem_limit, hard_cap)
1560+
# return min(mem_limit, hard_cap)
1561+
# TODO(scottmg): Temporary speculative fix for OOM on builders
1562+
# See http://crbug.com/333000.
1563+
return 2
15491564
elif sys.platform.startswith('linux'):
15501565
with open("/proc/meminfo") as meminfo:
15511566
memtotal_re = re.compile(r'^MemTotal:\s*(\d*)\s*kB')
@@ -1591,33 +1606,35 @@ def FullLinkCommand(ldcmd, out, binary_type):
15911606
'resname': resource_name,
15921607
'embed': embed_manifest }
15931608
rule_name_suffix = _GetWinLinkRuleNameSuffix(embed_manifest)
1594-
dlldesc = 'LINK%s(DLL) $dll' % rule_name_suffix.upper()
1595-
dllcmd = ('%s gyp-win-tool link-wrapper $arch '
1596-
'$ld /nologo $implibflag /DLL /OUT:$dll '
1597-
'/PDB:$dll.pdb @$dll.rsp' % sys.executable)
1598-
dllcmd = FullLinkCommand(dllcmd, '$dll', 'dll')
1609+
use_separate_mspdbsrv = (
1610+
int(os.environ.get('GYP_USE_SEPARATE_MSPDBSRV', '0')) != 0)
1611+
dlldesc = 'LINK%s(DLL) $binary' % rule_name_suffix.upper()
1612+
dllcmd = ('%s gyp-win-tool link-wrapper $arch %s '
1613+
'$ld /nologo $implibflag /DLL /OUT:$binary '
1614+
'@$binary.rsp' % (sys.executable, use_separate_mspdbsrv))
1615+
dllcmd = FullLinkCommand(dllcmd, '$binary', 'dll')
15991616
master_ninja.rule('solink' + rule_name_suffix,
16001617
description=dlldesc, command=dllcmd,
1601-
rspfile='$dll.rsp',
1618+
rspfile='$binary.rsp',
16021619
rspfile_content='$libs $in_newline $ldflags',
16031620
restat=True,
16041621
pool='link_pool')
16051622
master_ninja.rule('solink_module' + rule_name_suffix,
16061623
description=dlldesc, command=dllcmd,
1607-
rspfile='$dll.rsp',
1624+
rspfile='$binary.rsp',
16081625
rspfile_content='$libs $in_newline $ldflags',
16091626
restat=True,
16101627
pool='link_pool')
16111628
# Note that ldflags goes at the end so that it has the option of
16121629
# overriding default settings earlier in the command line.
1613-
exe_cmd = ('%s gyp-win-tool link-wrapper $arch '
1614-
'$ld /nologo /OUT:$out /PDB:$out.pdb @$out.rsp' %
1615-
sys.executable)
1616-
exe_cmd = FullLinkCommand(exe_cmd, '$out', 'exe')
1630+
exe_cmd = ('%s gyp-win-tool link-wrapper $arch %s '
1631+
'$ld /nologo /OUT:$binary @$binary.rsp' %
1632+
(sys.executable, use_separate_mspdbsrv))
1633+
exe_cmd = FullLinkCommand(exe_cmd, '$binary', 'exe')
16171634
master_ninja.rule('link' + rule_name_suffix,
1618-
description='LINK%s $out' % rule_name_suffix.upper(),
1635+
description='LINK%s $binary' % rule_name_suffix.upper(),
16191636
command=exe_cmd,
1620-
rspfile='$out.rsp',
1637+
rspfile='$binary.rsp',
16211638
rspfile_content='$in_newline $libs $ldflags',
16221639
pool='link_pool')
16231640

@@ -1877,7 +1894,7 @@ def GenerateOutputForConfig(target_list, target_dicts, data, params,
18771894
master_ninja.rule(
18781895
'alink',
18791896
description='LIB $out',
1880-
command=('%s gyp-win-tool link-wrapper $arch '
1897+
command=('%s gyp-win-tool link-wrapper $arch False '
18811898
'$ar /nologo /ignore:4221 /OUT:$out @$out.rsp' %
18821899
sys.executable),
18831900
rspfile='$out.rsp',
@@ -2027,7 +2044,8 @@ def GenerateOutputForConfig(target_list, target_dicts, data, params,
20272044

20282045
this_make_global_settings = data[build_file].get('make_global_settings', [])
20292046
assert make_global_settings == this_make_global_settings, (
2030-
"make_global_settings needs to be the same for all targets.")
2047+
"make_global_settings needs to be the same for all targets. %s vs. %s" %
2048+
(this_make_global_settings, make_global_settings))
20312049

20322050
spec = target_dicts[qualified_target]
20332051
if flavor == 'mac':

0 commit comments

Comments
 (0)