Skip to content

Commit 5387178

Browse files
authored
Merge branch 'main' into nullish-coalescing
2 parents 00b1ff5 + 06561ee commit 5387178

File tree

7 files changed

+62
-43
lines changed

7 files changed

+62
-43
lines changed

.circleci/config.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -731,7 +731,7 @@ jobs:
731731
- install-emsdk
732732
- install-node-canary
733733
- run-tests:
734-
title: "selected subset"
734+
title: "node (canary)"
735735
test_targets: "
736736
other.test_deterministic
737737
other.test_gen_struct_info
@@ -747,7 +747,7 @@ jobs:
747747
- install-node-version:
748748
node_version: "10.19.0"
749749
- run-tests:
750-
title: "selected subset"
750+
title: "node (oldest / 10.19.0)"
751751
test_targets: "
752752
other.test_gen_struct_info
753753
other.test_native_call_before_init
@@ -761,7 +761,7 @@ jobs:
761761
- run-tests:
762762
# Run tests that on older versions of node would require flags, but
763763
# those flags should not be injected on newer versions.
764-
title: "selected subset"
764+
title: "node (latest)"
765765
test_targets: "-v
766766
other.test_gen_struct_info
767767
other.test_native_call_before_init
@@ -802,6 +802,7 @@ jobs:
802802
test_targets: "
803803
browser64
804804
skip:browser64.test_4gb_fail
805+
browser64_4gb.test_async_*
805806
browser64_4gb.test_emscripten_log
806807
"
807808
test-browser-firefox:

emrun.py

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1533,6 +1533,14 @@ def parse_args():
15331533
help='Launches the page in a browser of an Android '
15341534
'device connected to an USB on the local system. (via adb)')
15351535

1536+
parser.add_argument('--android_tunnel', action='store_true',
1537+
help='Expose the port directly to the Android device '
1538+
'and connect to it as localhost, establishing '
1539+
'cross origin isolation. Implies --android. A '
1540+
'reverse socket connection is created by adb '
1541+
'reverse, and remains after emrun terminates (it '
1542+
'can be removed by adb reverse --remove).')
1543+
15361544
parser.add_argument('--system_info', action='store_true',
15371545
help='Prints information about the current system at startup.')
15381546

@@ -1567,6 +1575,9 @@ def run():
15671575

15681576
options = emrun_options = parse_args()
15691577

1578+
if options.android_tunnel:
1579+
options.android = True
1580+
15701581
if options.android:
15711582
global ADB
15721583
ADB = which('adb')
@@ -1636,7 +1647,12 @@ def run():
16361647
if not file_to_serve_is_url:
16371648
if len(options.cmdlineparams):
16381649
url += '?' + '&'.join(options.cmdlineparams)
1639-
hostname = socket.gethostbyname(socket.gethostname()) if options.android else options.hostname
1650+
if options.android_tunnel:
1651+
hostname = 'localhost'
1652+
elif options.android:
1653+
hostname = socket.gethostbyname(socket.gethostname())
1654+
else:
1655+
hostname = options.hostname
16401656
# create url for browser after opening the server so we have the final port number in case we are binding to port 0
16411657
url = 'http://' + hostname + ':' + str(options.port) + '/' + url
16421658

@@ -1671,6 +1687,9 @@ def run():
16711687
# 4. Type 'aapt d xmltree <packagename>.apk AndroidManifest.xml > manifest.txt' to extract the manifest from the package.
16721688
# 5. Locate the name of the main activity for the browser in manifest.txt and add an entry to above list in form 'appname/mainactivityname'
16731689

1690+
if options.android_tunnel:
1691+
subprocess.check_call([ADB, 'reverse', 'tcp:' + str(options.port), 'tcp:' + str(options.port)])
1692+
16741693
url = url.replace('&', '\\&')
16751694
browser = [ADB, 'shell', 'am', 'start', '-a', 'android.intent.action.VIEW', '-n', browser_app, '-d', url]
16761695
processname_killed_atexit = browser_app[:browser_app.find('/')]

test/common.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,37 @@ def decorated(f):
199199
return decorated
200200

201201

202+
def no_2gb(note):
203+
assert not callable(note)
204+
205+
def decorator(f):
206+
assert callable(f)
207+
208+
@wraps(f)
209+
def decorated(self, *args, **kwargs):
210+
# 2200mb is the value used by the core_2gb test mode
211+
if self.get_setting('INITIAL_MEMORY') == '2200mb':
212+
self.skipTest(note)
213+
f(self, *args, **kwargs)
214+
return decorated
215+
return decorator
216+
217+
218+
def no_4gb(note):
219+
assert not callable(note)
220+
221+
def decorator(f):
222+
assert callable(f)
223+
224+
@wraps(f)
225+
def decorated(self, *args, **kwargs):
226+
if self.get_setting('INITIAL_MEMORY') == '4200mb':
227+
self.skipTest(note)
228+
f(self, *args, **kwargs)
229+
return decorated
230+
return decorator
231+
232+
202233
def only_windows(note=''):
203234
assert not callable(note)
204235
if not WINDOWS:

test/test_browser.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
from common import BrowserCore, RunnerCore, path_from_root, has_browser, EMTEST_BROWSER, Reporting
2525
from common import create_file, parameterized, ensure_dir, disabled, test_file, WEBIDL_BINDER
26-
from common import read_file, also_with_minimal_runtime, EMRUN, no_wasm64
26+
from common import read_file, also_with_minimal_runtime, EMRUN, no_wasm64, no_4gb
2727
from tools import shared
2828
from tools import ports
2929
from tools import utils
@@ -5559,6 +5559,7 @@ def test_wasm_worker_proxied_function(self):
55595559
self.btest('wasm_worker/proxied_function.c', expected='0', args=['--js-library', test_file('wasm_worker/proxied_function.js'), '-sWASM_WORKERS', '-sASSERTIONS=0'])
55605560

55615561
@no_firefox('no 4GB support yet')
5562+
@no_4gb('uses MAXIMUM_MEMORY')
55625563
def test_4gb(self):
55635564
# TODO Convert to an actual browser test when it reaches stable.
55645565
# For now, keep this in browser as this suite runs serially, which
@@ -5654,6 +5655,7 @@ def test_emmalloc_memgrowth(self, *args):
56545655
self.btest('emmalloc_memgrowth.cpp', expected='0', args=['-sMALLOC=emmalloc', '-sALLOW_MEMORY_GROWTH=1', '-sABORTING_MALLOC=0', '-sASSERTIONS=2', '-sMINIMAL_RUNTIME=1', '-sMAXIMUM_MEMORY=4GB'])
56555656

56565657
@no_firefox('no 4GB support yet')
5658+
@no_4gb('uses MAXIMUM_MEMORY')
56575659
def test_2gb_fail(self):
56585660
# TODO Convert to an actual browser test when it reaches stable.
56595661
# For now, keep this in browser as this suite runs serially, which
@@ -5667,6 +5669,7 @@ def test_2gb_fail(self):
56675669
self.do_run_in_out_file_test('browser/test_2GB_fail.cpp')
56685670

56695671
@no_firefox('no 4GB support yet')
5672+
@no_4gb('uses MAXIMUM_MEMORY')
56705673
def test_4gb_fail(self):
56715674
# TODO Convert to an actual browser test when it reaches stable.
56725675
# For now, keep this in browser as this suite runs serially, which

test/test_core.py

Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
from common import RunnerCore, path_from_root, requires_native_clang, test_file, create_file
2828
from common import skip_if, needs_dylink, no_windows, no_mac, is_slow_test, parameterized
2929
from common import env_modify, with_env_modify, disabled, flaky, node_pthreads, also_with_wasm_bigint
30-
from common import read_file, read_binary, requires_v8, requires_node, requires_node_canary, compiler_for, crossplatform
30+
from common import read_file, read_binary, requires_v8, requires_node, requires_node_canary
31+
from common import compiler_for, crossplatform, no_4gb, no_2gb
3132
from common import with_both_sjlj, also_with_standalone_wasm, can_do_standalone, no_wasm64
3233
from common import NON_ZERO, WEBIDL_BINDER, EMBUILDER, PYTHON
3334
import clang_native
@@ -258,37 +259,6 @@ def decorated(self, *args, **kwargs):
258259
return decorator
259260

260261

261-
def no_4gb(note):
262-
assert not callable(note)
263-
264-
def decorator(f):
265-
assert callable(f)
266-
267-
@wraps(f)
268-
def decorated(self, *args, **kwargs):
269-
if self.get_setting('INITIAL_MEMORY') == '4200mb':
270-
self.skipTest(note)
271-
f(self, *args, **kwargs)
272-
return decorated
273-
return decorator
274-
275-
276-
def no_2gb(note):
277-
assert not callable(note)
278-
279-
def decorator(f):
280-
assert callable(f)
281-
282-
@wraps(f)
283-
def decorated(self, *args, **kwargs):
284-
# 2200mb is the value used by the core_2gb test mode
285-
if self.get_setting('INITIAL_MEMORY') == '2200mb':
286-
self.skipTest(note)
287-
f(self, *args, **kwargs)
288-
return decorated
289-
return decorator
290-
291-
292262
def no_ubsan(note):
293263
assert not callable(note)
294264

tools/js_optimizer.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -329,11 +329,6 @@ def write_chunk(chunk, i):
329329
if not os.environ.get('EMCC_NO_OPT_SORT'):
330330
funcs.sort(key=lambda x: (len(x[1]), x[0]), reverse=True)
331331

332-
if 'last' in passes and len(funcs):
333-
count = funcs[0][1].count('\n')
334-
if count > 3000:
335-
print('warning: Output contains some very large functions (%s lines in %s), consider building source files with -Os or -Oz)' % (count, funcs[0][0]), file=sys.stderr)
336-
337332
for func in funcs:
338333
f.write(func[1])
339334
funcs = None

tools/link.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1146,7 +1146,7 @@ def phase_linker_setup(options, state, newargs):
11461146
settings.MIN_IE_VERSION != 0x7FFFFFFF)
11471147

11481148
if options.use_closure_compiler is None and settings.TRANSPILE_TO_ES5:
1149-
diagnostics.warning('transpile', 'enabling transpilation via closure due to browser version settings. This warning can be suppressed by passing `--closure=1` or `--closure=0` to opt into our explicitly.')
1149+
diagnostics.warning('transpile', 'enabling transpilation via closure due to browser version settings. This warning can be suppressed by passing `--closure=1` or `--closure=0` to opt into this explicitly.')
11501150

11511151
# https://caniuse.com/class: EDGE:13 FF:45 CHROME:49 SAFARI:9
11521152
supports_es6_classes = (settings.MIN_EDGE_VERSION >= 13 and

0 commit comments

Comments
 (0)