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

test: don't assume broadcast traffic is unfiltered #220

Closed
wants to merge 23 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
4dc660e
build: do not generate support for libuv's probes
Dec 3, 2014
20a7088
deps: update libuv to 1.0.2
saghul Dec 9, 2014
8708c7a
test: mark more tests as flaky
orangemocha Dec 10, 2014
946cec7
lib,src: fix spawnSync ignoring its 'env' option
juamedgod Oct 14, 2014
4bba870
test: add test for spawnSync() env option
cjihrig Dec 9, 2014
5b9e5bd
doc: clarify create{Read,Write}Stream fd option
benjamincburns Jul 26, 2014
6f6a979
zlib: support concatenated gzip files
eendeego Sep 9, 2014
e93ff4f
debugger: fix unhandled error in setBreakpoint
bajtos Nov 4, 2013
93533e9
src: fix windows build error
bnoordhuis Nov 11, 2014
9158666
stream: switch _writableState.buffer to queue
chrisdickinson Dec 4, 2014
890baa0
doc: add details for http res/req end callback
JacksonTian Dec 10, 2014
6a03fce
url: improve parsing speed
CGavrila Oct 28, 2014
d8586ea
lib: introduce process module
Dec 30, 2014
8b04161
doc: util: document --trace-deprecation
bnoordhuis Dec 21, 2014
d5c7a97
doc: added TC meeting minutes 2014-12-17
rvagg Dec 17, 2014
a308395
build: i18n: add icu config options
srl295 Nov 13, 2014
261706e
doc: added TC meeting minutes 2014-12-30
rvagg Jan 2, 2015
8cfbeed
docs: update to authors file
srl295 Jan 3, 2015
b636ba8
net: make connect() input validation synchronous
cjihrig Jan 3, 2015
372a2f5
smalloc: fix bad assert for zero length data
trevnorris Jan 5, 2015
94e1475
Merge remote-tracking branch 'joyent/v0.12' into v1.x
bnoordhuis Jan 5, 2015
eaed2a1
deps: update libuv to 1.2.0
bnoordhuis Jan 5, 2015
52e600a
test: don't assume broadcast traffic is unfiltered
bnoordhuis Dec 29, 2014
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ ipch/
email.md
deps/v8-*
deps/icu
deps/icu*.zip
deps/icu*.tgz
deps/icu-tmp
./node_modules
.svn/

Expand Down
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -568,3 +568,4 @@ Kevin Simper <[email protected]>
Jackson Tian <[email protected]>
Tristan Berger <[email protected]>
Mathias Schreck <[email protected]>
Steven R. Loomis <[email protected]>
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,12 @@ clean:

distclean:
-rm -rf out
-rm -f config.gypi
-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_modules
-rm -rf deps/icu
-rm -rf deps/icu4c*.tgz deps/icu4c*.zip deps/icu-tmp

test: all
$(PYTHON) tools/test.py --mode=release message parallel sequential -J
Expand Down
91 changes: 82 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,31 +99,104 @@ make doc
man doc/node.1
```

### To build `Intl` (ECMA-402) support:
### `Intl` (ECMA-402) support:

*Note:* more docs, including how to reduce disk footprint, are on
[Intl](https://github.com/joyent/node/wiki/Intl) support is not
enabled by default.

#### "small" (English only) support

This option will build with "small" (English only) support, but
the full `Intl` (ECMA-402) APIs. With `--download=all` it will
download the ICU library as needed.

Unix/Macintosh:

```sh
./configure --with-intl=small-icu --download=all
```

Windows:

```sh
vcbuild small-icu download-all
```

The `small-icu` mode builds
with English-only data. You can add full data at runtime.

*Note:* more docs are on
[the wiki](https://github.com/joyent/node/wiki/Intl).

#### Use existing installed ICU (Unix/Macintosh only):
#### Build with full ICU support (all locales supported by ICU):

With the `--download=all`, this may download ICU if you don't
have an ICU in `deps/icu`.

Unix/Macintosh:

```sh
pkg-config --modversion icu-i18n && ./configure --with-intl=system-icu
./configure --with-intl=full-icu --download=all
```

#### Build ICU from source:
Windows:

First: Unpack latest ICU
[icu4c-**##.#**-src.tgz](http://icu-project.org/download) (or `.zip`)
as `deps/icu` (You'll have: `deps/icu/source/...`)
```sh
vcbuild full-icu download-all
```

#### Build with no Intl support `:-(`

The `Intl` object will not be available.
This is the default at present, so this option is not normally needed.

Unix/Macintosh:

```sh
./configure --with-intl=full-icu
./configure --with-intl=none
```

Windows:

```sh
vcbuild intl-none
```

#### Use existing installed ICU (Unix/Macintosh only):

```sh
pkg-config --modversion icu-i18n && ./configure --with-intl=system-icu
```

#### Build with a specific ICU:

You can find other ICU releases at
[the ICU homepage](http://icu-project.org/download).
Download the file named something like `icu4c-**##.#**-src.tgz` (or
`.zip`).

Unix/Macintosh: from an already-unpacked ICU

```sh
./configure --with-intl=[small-icu,full-icu] --with-icu-source=/path/to/icu
```

Unix/Macintosh: from a local ICU tarball

```sh
./configure --with-intl=[small-icu,full-icu] --with-icu-source=/path/to/icu.tgz
```

Unix/Macintosh: from a tarball URL

```sh
./configure --with-intl=full-icu --with-icu-source=http://url/to/icu.tgz
```

Windows: first unpack latest ICU to `deps/icu`
[icu4c-**##.#**-src.tgz](http://icu-project.org/download) (or `.zip`)
as `deps/icu` (You'll have: `deps/icu/source/...`)

```sh
vcbuild full-icu
```
Expand Down
137 changes: 130 additions & 7 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,19 @@ import re
import shlex
import subprocess
import sys
import shutil
import string

CC = os.environ.get('CC', 'cc')

root_dir = os.path.dirname(__file__)
sys.path.insert(0, os.path.join(root_dir, 'tools', 'gyp', 'pylib'))
from gyp.common import GetFlavor

# imports in tools/configure.d
sys.path.insert(0, os.path.join(root_dir, 'tools', 'configure.d'))
import nodedownload

# parse our options
parser = optparse.OptionParser()

Expand Down Expand Up @@ -216,16 +222,31 @@ parser.add_option('--with-etw',
dest='with_etw',
help='build with ETW (default is true on Windows)')

parser.add_option('--download',
action='store',
dest='download_list',
help=nodedownload.help())

parser.add_option('--with-icu-path',
action='store',
dest='with_icu_path',
help='Path to icu.gyp (ICU i18n, Chromium version only.)')

parser.add_option('--with-icu-locales',
action='store',
dest='with_icu_locales',
help='Comma-separated list of locales for "small-icu". Default: "root,en". "root" is assumed.')

parser.add_option('--with-intl',
action='store',
dest='with_intl',
help='Intl mode: none, full-icu, small-icu (default is none)')

parser.add_option('--with-icu-source',
action='store',
dest='with_icu_source',
help='Intl mode: optional local path to icu/ dir, or path/URL of icu source archive.')

parser.add_option('--with-perfctr',
action='store_true',
dest='with_perfctr',
Expand Down Expand Up @@ -274,6 +295,8 @@ parser.add_option('--xcode',

(options, args) = parser.parse_args()

# set up auto-download list
auto_downloads = nodedownload.parse(options.download_list)

def b(value):
"""Returns the string 'true' if value is truthy, 'false' otherwise."""
Expand Down Expand Up @@ -632,6 +655,35 @@ def glob_to_var(dir_base, dir_sub):
return list

def configure_intl(o):
icus = [
{
'url': 'http://download.icu-project.org/files/icu4c/54.1/icu4c-54_1-src.zip',
# from https://ssl.icu-project.org/files/icu4c/54.1/icu4c-src-54_1.md5:
'md5': '6b89d60e2f0e140898ae4d7f72323bca',
},
]
def icu_download(path):
# download ICU, if needed
for icu in icus:
url = icu['url']
md5 = icu['md5']
local = url.split('/')[-1]
targetfile = os.path.join(root_dir, 'deps', local)
if not os.path.isfile(targetfile):
if nodedownload.candownload(auto_downloads, "icu"):
nodedownload.retrievefile(url, targetfile)
else:
print ' Re-using existing %s' % targetfile
if os.path.isfile(targetfile):
sys.stdout.write(' Checking file integrity with MD5:\r')
gotmd5 = nodedownload.md5sum(targetfile)
print ' MD5: %s %s' % (gotmd5, targetfile)
if (md5 == gotmd5):
return targetfile
else:
print ' Expected: %s *MISMATCH*' % md5
print '\n ** Corrupted ZIP? Delete %s to retry download.\n' % targetfile
return None
icu_config = {
'variables': {}
}
Expand All @@ -643,11 +695,11 @@ def configure_intl(o):
write(icu_config_name, do_not_edit +
pprint.pformat(icu_config, indent=2) + '\n')

# small ICU is off by default.
# always set icu_small, node.gyp depends on it being defined.
o['variables']['icu_small'] = b(False)

with_intl = options.with_intl
with_icu_source = options.with_icu_source
have_icu_path = bool(options.with_icu_path)
if have_icu_path and with_intl:
print 'Error: Cannot specify both --with-icu-path and --with-intl'
Expand All @@ -659,13 +711,26 @@ def configure_intl(o):
o['variables']['icu_gyp_path'] = options.with_icu_path
return
# --with-intl=<with_intl>
# set the default
if with_intl is None:
with_intl = 'none' # The default mode of Intl
# sanity check localelist
if options.with_icu_locales and (with_intl != 'small-icu'):
print 'Error: --with-icu-locales only makes sense with --with-intl=small-icu'
sys.exit(1)
if with_intl == 'none' or with_intl is None:
o['variables']['v8_enable_i18n_support'] = 0
return # no Intl
elif with_intl == 'small-icu':
# small ICU (English only)
o['variables']['v8_enable_i18n_support'] = 1
o['variables']['icu_small'] = b(True)
with_icu_locales = options.with_icu_locales
if not with_icu_locales:
with_icu_locales = 'root,en'
locs = set(with_icu_locales.split(','))
locs.add('root') # must have root
o['variables']['icu_locales'] = string.join(locs,',')
elif with_intl == 'full-icu':
# full ICU
o['variables']['v8_enable_i18n_support'] = 1
Expand All @@ -689,20 +754,78 @@ def configure_intl(o):
# Note: non-ICU implementations could use other 'with_intl'
# values.

# this is just the 'deps' dir. Used for unpacking.
icu_parent_path = os.path.join(root_dir, 'deps')

# The full path to the ICU source directory.
icu_full_path = os.path.join(icu_parent_path, 'icu')

# icu-tmp is used to download and unpack the ICU tarball.
icu_tmp_path = os.path.join(icu_parent_path, 'icu-tmp')

# --with-icu-source processing
# first, check that they didn't pass --with-icu-source=deps/icu
if with_icu_source and os.path.abspath(icu_full_path) == os.path.abspath(with_icu_source):
print 'Ignoring redundant --with-icu-source=%s' % (with_icu_source)
with_icu_source = None
# if with_icu_source is still set, try to use it.
if with_icu_source:
if os.path.isdir(icu_full_path):
print 'Deleting old ICU source: %s' % (icu_full_path)
shutil.rmtree(icu_full_path)
# now, what path was given?
if os.path.isdir(with_icu_source):
# it's a path. Copy it.
print '%s -> %s' % (with_icu_source, icu_full_path)
shutil.copytree(with_icu_source, icu_full_path)
else:
# could be file or URL.
# Set up temporary area
if os.path.isdir(icu_tmp_path):
shutil.rmtree(icu_tmp_path)
os.mkdir(icu_tmp_path)
icu_tarball = None
if os.path.isfile(with_icu_source):
# it's a file. Try to unpack it.
icu_tarball = with_icu_source
else:
# Can we download it?
local = os.path.join(icu_tmp_path, with_icu_source.split('/')[-1]) # local part
icu_tarball = nodedownload.retrievefile(with_icu_source, local)
# continue with "icu_tarball"
nodedownload.unpack(icu_tarball, icu_tmp_path)
# Did it unpack correctly? Should contain 'icu'
tmp_icu = os.path.join(icu_tmp_path, 'icu')
if os.path.isdir(tmp_icu):
os.rename(tmp_icu, icu_full_path)
shutil.rmtree(icu_tmp_path)
else:
print ' Error: --with-icu-source=%s did not result in an "icu" dir.' % with_icu_source
shutil.rmtree(icu_tmp_path)
sys.exit(1)

# ICU mode. (icu-generic.gyp)
byteorder = sys.byteorder
o['variables']['icu_gyp_path'] = 'tools/icu/icu-generic.gyp'
# ICU source dir relative to root
icu_full_path = os.path.join(root_dir, 'deps/icu')
o['variables']['icu_path'] = icu_full_path
if not os.path.isdir(icu_full_path):
print 'Error: ICU path is not a directory: %s' % (icu_full_path)
print '* ECMA-402 (Intl) support didn\'t find ICU in %s..' % (icu_full_path)
# can we download (or find) a zipfile?
localzip = icu_download(icu_full_path)
if localzip:
nodedownload.unpack(localzip, icu_parent_path)
if not os.path.isdir(icu_full_path):
print ' Cannot build Intl without ICU in %s.' % (icu_full_path)
print ' (Fix, or disable with "--with-intl=none" )'
sys.exit(1)
else:
print '* Using ICU in %s' % (icu_full_path)
# Now, what version of ICU is it? We just need the "major", such as 54.
# uvernum.h contains it as a #define.
uvernum_h = os.path.join(icu_full_path, 'source/common/unicode/uvernum.h')
if not os.path.isfile(uvernum_h):
print 'Error: could not load %s - is ICU installed?' % uvernum_h
print ' Error: could not load %s - is ICU installed?' % uvernum_h
sys.exit(1)
icu_ver_major = None
matchVerExp = r'^\s*#define\s+U_ICU_VERSION_SHORT\s+"([^"]*)".*'
Expand All @@ -712,7 +835,7 @@ def configure_intl(o):
if m:
icu_ver_major = m.group(1)
if not icu_ver_major:
print 'Could not read U_ICU_VERSION_SHORT version from %s' % uvernum_h
print ' Could not read U_ICU_VERSION_SHORT version from %s' % uvernum_h
sys.exit(1)
icu_endianness = sys.byteorder[0]; # TODO(srl295): EBCDIC should be 'e'
o['variables']['icu_ver_major'] = icu_ver_major
Expand All @@ -739,8 +862,8 @@ def configure_intl(o):
# this is the icudt*.dat file which node will be using (platform endianness)
o['variables']['icu_data_file'] = icu_data_file
if not os.path.isfile(icu_data_path):
print 'Error: ICU prebuilt data file %s does not exist.' % icu_data_path
print 'See the README.md.'
print ' Error: ICU prebuilt data file %s does not exist.' % icu_data_path
print ' See the README.md.'
# .. and we're not about to build it from .gyp!
sys.exit(1)
# map from variable name to subdirs
Expand Down
Loading