Skip to content
Merged
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
8 changes: 6 additions & 2 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,12 @@ See docs/process.md for how version tagging works.

Current Trunk
-------------
- noExitRuntime is no longer a property on the Module object. Use `noExitRuntime`
instead of `Module.noExitRuntime`.
- Update minimum nodejs version from v4.1.1 for v8.10.0.
v8.10.0 is still very old but is the version included in the current ubuntu
LTS (https://packages.ubuntu.com/bionic/nodejs).
This version will allow us to use more modern JS features.
- noExitRuntime is no longer a property on the Module object. Use
`noExitRuntime` instead of `Module.noExitRuntime`.

v.1.38.42: 08/19/2019
----------------------
Expand Down
25 changes: 22 additions & 3 deletions tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,14 @@ def decorated(self, *args, **kwargs):
return decorator


def buggy_node_version():
"""Certain version of node have a crash bug with EMTERPRETIFY and PRECISE_F32"""
node_version = run_process(NODE_JS + ['--version'], stdout=PIPE).stdout.strip()
node_version = node_version.lstrip('v')
node_version = [int(v) for v in node_version.split('.')[:2]]
return node_version >= [8, 12] and node_version < [12, 0]


class TestCoreBase(RunnerCore):
def is_wasm2js(self):
return self.is_wasm_backend() and not self.get_setting('WASM')
Expand Down Expand Up @@ -304,6 +312,8 @@ def test_vararg_copy(self):

def test_llvm_fabs(self):
self.set_setting('PRECISE_F32', 1)
if self.run_name == 'asm2i' and buggy_node_version():
self.skipTest('buggy node version')
self.do_run_in_out_file_test('tests', 'core', 'test_llvm_fabs')

def test_double_varargs(self):
Expand Down Expand Up @@ -333,6 +343,8 @@ def test_double_i64_conversion(self):
self.do_run_in_out_file_test('tests', 'core', 'test_double_i64_conversion')

def test_float32_precise(self):
if self.run_name == 'asm2i' and buggy_node_version():
self.skipTest('buggy node version')
self.set_setting('PRECISE_F32', 1)
self.do_run_in_out_file_test('tests', 'core', 'test_float32_precise')

Expand Down Expand Up @@ -653,10 +665,10 @@ def test_frexp(self):
def test_rounding(self):
# needs to flush stdio streams
self.set_setting('EXIT_RUNTIME', 1)
for precise_f32 in [0, 1]:
print(precise_f32)
for precise_f32 in [1, 0]:
if precise_f32 and self.run_name == 'asm2i' and buggy_node_version():
continue
self.set_setting('PRECISE_F32', precise_f32)

self.do_run_in_out_file_test('tests', 'core', 'test_rounding')

def test_fcvt(self):
Expand Down Expand Up @@ -1464,6 +1476,8 @@ def test_mathfuncptr(self):
if self.is_emterpreter():
print('emterpreter f32')
self.set_setting('PRECISE_F32', 1)
if self.run_name == 'asm2i' and buggy_node_version():
self.skipTest('buggy node version')
self.do_run_in_out_file_test('tests', 'core', 'test_mathfuncptr')

def test_funcptrfunc(self):
Expand Down Expand Up @@ -5524,6 +5538,9 @@ def test(extra_args):
self.emcc_args = old + extra_args
for precision in [0, 1, 2]:
self.set_setting('PRECISE_F32', precision)
if precision and self.run_name == 'asm2i' and buggy_node_version():
print('buggy node version')
continue
for t in ['float', 'double']:
print(precision, t)
src = orig_src.replace('double', t)
Expand Down Expand Up @@ -5773,6 +5790,8 @@ def test_lua(self):

if self.is_emterpreter():
self.set_setting('PRECISE_F32', 1)
if self.run_name == 'asm2i' and buggy_node_version():
self.skipTest('buggy node version')

for aggro in ([0, 1] if self.get_setting('ASM_JS') and '-O2' in self.emcc_args else [0]):
self.set_setting('AGGRESSIVE_VARIABLE_ELIMINATION', aggro)
Expand Down
8 changes: 4 additions & 4 deletions tests/test_sanity.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ def test_llvm_fastcomp(self):

def test_node(self):
NODE_WARNING = 'node version appears too old'
NODE_WARNING_2 = 'cannot check node version'
NODE_WARNING_2 = 'error running node'

restore_and_set_up()

Expand All @@ -351,9 +351,9 @@ def test_node(self):

with env_modify({'EM_IGNORE_SANITY': '1'}):
for version, succeed in [('v0.8.0', False),
('v4.1.0', False),
('v4.1.1', True),
('v4.2.3-pre', True),
('v8.7.0', False),
('v8.10.0', True),
('v8.10.3-pre', True),
('cheez', False)]:
print(version, succeed)
f = open(path_from_root('tests', 'fake', 'nodejs'), 'w')
Expand Down
26 changes: 15 additions & 11 deletions tools/shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,22 +459,26 @@ def check_llvm():
return True


EXPECTED_NODE_VERSION = (4, 1, 1)
EXPECTED_NODE_VERSION = [8, 10]


def check_node_version():
jsrun.check_engine(NODE_JS)
try:
actual = run_process(NODE_JS + ['--version'], stdout=PIPE).stdout.strip()
version = tuple(map(int, actual.replace('v', '').replace('-pre', '').split('.')))
if version >= EXPECTED_NODE_VERSION:
return True
logger.warning('node version appears too old (seeing "%s", expected "%s")' % (actual, 'v' + ('.'.join(map(str, EXPECTED_NODE_VERSION)))))
return False
output = run_process(NODE_JS + ['--version'], stdout=PIPE).stdout.strip()
# Only check for major and minor version
version = [int(v) for v in output.lstrip('v').split('.')[:2]]
except Exception as e:
logger.warning('cannot check node version: %s', e)
logger.warning('error running node (%s) to check node version: %s', NODE_JS, e)
return False

if version < EXPECTED_NODE_VERSION:
expected = 'v' + '.'.join(str(v) for v in EXPECTED_NODE_VERSION)
logger.warning('node version appears too old (seeing "%s", required "%s"): %s' % (output, expected, NODE_JS))
return False

return True


def check_closure_compiler():
try:
Expand Down Expand Up @@ -576,16 +580,16 @@ def check_sanity(force=False):
force = False

# some warning, mostly not fatal checks - do them even if EM_IGNORE_SANITY is on
check_node_version()
node_ok = check_node_version()

llvm_ok = check_llvm()

if os.environ.get('EM_IGNORE_SANITY'):
logger.info('EM_IGNORE_SANITY set, ignoring sanity checks')
return

if not llvm_ok:
exit_with_error('failing sanity checks due to previous llvm failure')
if not llvm_ok or not node_ok:
exit_with_error('exiting due to sanity check failures (use EM_IGNORE_SANITY to ignore)')

perform_sanify_checks()

Expand Down