Skip to content

Commit c85f1b1

Browse files
authored
Improve error message on invalid legacy settings. NFC. (emscripten-core#20882)
1 parent 7ca8b40 commit c85f1b1

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/settings.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2132,8 +2132,8 @@ var LEGACY_SETTINGS = [
21322132
['BINARYEN_MEM_MAX', 'MAXIMUM_MEMORY'],
21332133
['BINARYEN_PASSES', [''], 'Use BINARYEN_EXTRA_PASSES to add additional passes'],
21342134
['SWAPPABLE_ASM_MODULE', [0], 'Fully swappable asm modules are no longer supported'],
2135-
['ASM_JS', [1], 'asm.js output is not supported any more'],
2136-
['FINALIZE_ASM_JS', [0, 1], 'asm.js output is not supported any more'],
2135+
['ASM_JS', [1], 'asm.js output is not supported anymore'],
2136+
['FINALIZE_ASM_JS', [0, 1], 'asm.js output is not supported anymore'],
21372137
['ASYNCIFY_WHITELIST', 'ASYNCIFY_ONLY'],
21382138
['ASYNCIFY_BLACKLIST', 'ASYNCIFY_REMOVE'],
21392139
['EXCEPTION_CATCHING_WHITELIST', 'EXCEPTION_CATCHING_ALLOWED'],

test/test_other.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10635,7 +10635,7 @@ def test_c_preprocessor(self):
1063510635
# Test that legacy settings that have been fixed to a specific value and their value can no longer be changed,
1063610636
def test_legacy_settings_forbidden_to_change(self):
1063710637
stderr = self.expect_fail([EMCC, '-sMEMFS_APPEND_TO_TYPED_ARRAYS=0', test_file('hello_world.c')])
10638-
self.assertContained('MEMFS_APPEND_TO_TYPED_ARRAYS=0 is no longer supported', stderr)
10638+
self.assertContained('emcc: error: invalid command line setting `-sMEMFS_APPEND_TO_TYPED_ARRAYS=0`: Starting from Emscripten 1.38.26, MEMFS_APPEND_TO_TYPED_ARRAYS=0 is no longer supported', stderr)
1063910639

1064010640
self.run_process([EMCC, '-sMEMFS_APPEND_TO_TYPED_ARRAYS', test_file('hello_world.c')])
1064110641
self.run_process([EMCC, '-sPRECISE_I64_MATH=2', test_file('hello_world.c')])

tools/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ def __setattr__(self, name, value):
207207
exit_with_error('legacy setting used in strict mode: %s', name)
208208
fixed_values, error_message = self.legacy_settings[name]
209209
if fixed_values and value not in fixed_values:
210-
exit_with_error('Invalid command line option -s ' + name + '=' + str(value) + ': ' + error_message)
210+
exit_with_error(f'invalid command line setting `-s{name}={value}`: {error_message}')
211211
diagnostics.warning('legacy-settings', 'use of legacy setting: %s (%s)', name, error_message)
212212

213213
if name in self.alt_names:

0 commit comments

Comments
 (0)