Skip to content

Commit 17cbd29

Browse files
authored
Avoid space after -s when for command line settings. NFC (#16025)
We still have a test for the form that does include the space but we want to encourage folks to use the one without the space. Its more concise, and less prone to issues such as the once where cmake re-orders link flags in some cases.
1 parent 86ba16e commit 17cbd29

19 files changed

+1066
-1068
lines changed

tests/benchmark_sse.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def run_benchmark(benchmark_file, results_file, build_args):
4646

4747
# Run emscripten build
4848
out_file = os.path.join(temp_dir, 'benchmark_sse_html.js')
49-
cmd = [EMCC, benchmark_file, '-O3', '-s', 'TOTAL_MEMORY=536870912', '-o', out_file] + build_args
49+
cmd = [EMCC, benchmark_file, '-O3', '-sTOTAL_MEMORY=536870912', '-o', out_file] + build_args
5050
print('Building Emscripten version of the benchmark:')
5151
print(' '.join(cmd))
5252
run_process(cmd)

tests/common.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -963,7 +963,7 @@ def _test_dylink_dso_needed(self, do_run):
963963
so = '.wasm' if self.is_wasm() else '.js'
964964

965965
def ccshared(src, linkto=[]):
966-
cmdv = [EMCC, src, '-o', shared.unsuffixed(src) + so, '-s', 'SIDE_MODULE'] + self.get_emcc_args()
966+
cmdv = [EMCC, src, '-o', shared.unsuffixed(src) + so, '-sSIDE_MODULE'] + self.get_emcc_args()
967967
cmdv += linkto
968968
self.run_process(cmdv)
969969

@@ -1542,7 +1542,7 @@ def compile_btest(self, args, reporting=Reporting.FULL):
15421542
# use REPORT_RESULT, and also adds a cpp file to be compiled alongside the testcase, which
15431543
# contains the implementation of REPORT_RESULT (we can't just include that implementation in
15441544
# the header as there may be multiple files being compiled here).
1545-
args += ['-s', 'IN_TEST_HARNESS']
1545+
args += ['-sIN_TEST_HARNESS']
15461546
if reporting != Reporting.NONE:
15471547
# For basic reporting we inject JS helper funtions to report result back to server.
15481548
args += ['-DEMTEST_PORT_NUMBER=%d' % self.port,
@@ -1589,7 +1589,7 @@ def btest(self, filename, expected=None, reference=None,
15891589
expected = [str(i) for i in range(0, reference_slack + 1)]
15901590
self.reftest(test_file(reference), manually_trigger=manually_trigger_reftest)
15911591
if not manual_reference:
1592-
args += ['--pre-js', 'reftest.js', '-s', 'GL_TESTING']
1592+
args += ['--pre-js', 'reftest.js', '-sGL_TESTING']
15931593
outfile = 'test.html'
15941594
args += [filename, '-o', outfile]
15951595
# print('all args:', args)
@@ -1612,7 +1612,7 @@ def btest(self, filename, expected=None, reference=None,
16121612
if 'WASM=0' not in original_args and (also_wasm2js or self.also_wasm2js):
16131613
print('WASM=0')
16141614
self.btest(filename, expected, reference, reference_slack, manual_reference, post_build,
1615-
original_args + ['-s', 'WASM=0'], message, also_proxied=False, timeout=timeout)
1615+
original_args + ['-sWASM=0'], message, also_proxied=False, timeout=timeout)
16161616

16171617
if also_proxied:
16181618
print('proxied...')
@@ -1623,7 +1623,7 @@ def btest(self, filename, expected=None, reference=None,
16231623
post_build = self.post_manual_reftest
16241624
# run proxied
16251625
self.btest(filename, expected, reference, reference_slack, manual_reference, post_build,
1626-
original_args + ['--proxy-to-worker', '-s', 'GL_TESTING'], message, timeout=timeout)
1626+
original_args + ['--proxy-to-worker', '-sGL_TESTING'], message, timeout=timeout)
16271627

16281628

16291629
###################################################################################################

tests/test_benchmark.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -203,9 +203,9 @@ def build(self, parent, filename, args, shared_args, emcc_args, native_args, nat
203203
cmd = [
204204
EMCC, filename,
205205
OPTIMIZATIONS,
206-
'-s', 'INITIAL_MEMORY=256MB',
207-
'-s', 'ENVIRONMENT=node,shell',
208-
'-s', 'BENCHMARK=%d' % (1 if IGNORE_COMPILATION and not has_output_parser else 0),
206+
'-sINITIAL_MEMORY=256MB',
207+
'-sENVIRONMENT=node,shell',
208+
'-sBENCHMARK=%d' % (1 if IGNORE_COMPILATION and not has_output_parser else 0),
209209
'-o', final
210210
] + shared_args + LLVM_FEATURE_FLAGS
211211
if common.EMTEST_FORCE64:
@@ -216,7 +216,7 @@ def build(self, parent, filename, args, shared_args, emcc_args, native_args, nat
216216
# above, such as minimal runtime
217217
cmd += emcc_args + self.extra_args
218218
if 'FORCE_FILESYSTEM' not in cmd:
219-
cmd += ['-s', 'FILESYSTEM=0']
219+
cmd += ['-sFILESYSTEM=0']
220220
if PROFILING:
221221
cmd += ['--profiling-funcs']
222222
self.cmd = cmd
@@ -253,9 +253,9 @@ def build(self, parent, filename, args, shared_args, emcc_args, native_args, nat
253253
# wasm2c doesn't want minimal runtime which the normal emscripten
254254
# benchmarker defaults to, as we don't have any JS anyhow
255255
emcc_args = emcc_args + [
256-
'-s', 'STANDALONE_WASM',
257-
'-s', 'MINIMAL_RUNTIME=0',
258-
'-s', 'WASM2C'
256+
'-sSTANDALONE_WASM',
257+
'-sMINIMAL_RUNTIME=0',
258+
'-sWASM2C'
259259
]
260260

261261
global LLVM_FEATURE_FLAGS
@@ -971,7 +971,7 @@ def lib_builder(name, native, env_init):
971971

972972
self.do_benchmark('lua_' + benchmark, '', expected,
973973
force_c=True, args=[benchmark + '.lua', DEFAULT_ARG],
974-
emcc_args=['--embed-file', benchmark + '.lua', '-s', 'FORCE_FILESYSTEM', '-s', 'MINIMAL_RUNTIME=0'], # not minimal because of files
974+
emcc_args=['--embed-file', benchmark + '.lua', '-sFORCE_FILESYSTEM', '-sMINIMAL_RUNTIME=0'], # not minimal because of files
975975
lib_builder=lib_builder, native_exec=os.path.join('building', 'third_party', 'lua_native', 'src', 'lua'),
976976
output_parser=output_parser, args_processor=args_processor)
977977

@@ -1048,7 +1048,7 @@ def lib_builder(name, native, env_init):
10481048
def test_zzz_sqlite(self):
10491049
src = read_file(test_file('third_party/sqlite/sqlite3.c')) + read_file(test_file('sqlite/speedtest1.c'))
10501050
self.do_benchmark('sqlite', src, 'TOTAL...', native_args=['-ldl', '-pthread'], shared_args=['-I' + test_file('third_party', 'sqlite')],
1051-
emcc_args=['-s', 'FILESYSTEM', '-s', 'MINIMAL_RUNTIME=0'], # not minimal because of files
1051+
emcc_args=['-sFILESYSTEM', '-sMINIMAL_RUNTIME=0'], # not minimal because of files
10521052
force_c=True)
10531053

10541054
def test_zzz_poppler(self):
@@ -1097,7 +1097,7 @@ def lib_builder(name, native, env_init):
10971097
# TODO: Fix poppler native build and remove skip_native=True
10981098
self.do_benchmark('poppler', '', 'hashed printout',
10991099
shared_args=['-I' + test_file('poppler', 'include'), '-I' + test_file('freetype', 'include')],
1100-
emcc_args=['-s', 'FILESYSTEM', '--pre-js', 'pre.js', '--embed-file',
1101-
test_file('poppler', 'emscripten_html5.pdf') + '@input.pdf', '-s', 'ERROR_ON_UNDEFINED_SYMBOLS=0',
1102-
'-s', 'MINIMAL_RUNTIME=0'], # not minimal because of files
1100+
emcc_args=['-sFILESYSTEM', '--pre-js', 'pre.js', '--embed-file',
1101+
test_file('poppler', 'emscripten_html5.pdf') + '@input.pdf', '-sERROR_ON_UNDEFINED_SYMBOLS=0',
1102+
'-sMINIMAL_RUNTIME=0'], # not minimal because of files
11031103
lib_builder=lib_builder, skip_native=True)

0 commit comments

Comments
 (0)