Skip to content

Commit

Permalink
Improve error message on invalid legacy settings. NFC. (emscripten-co…
Browse files Browse the repository at this point in the history
  • Loading branch information
sbc100 authored Dec 8, 2023
1 parent 7ca8b40 commit c85f1b1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -2132,8 +2132,8 @@ var LEGACY_SETTINGS = [
['BINARYEN_MEM_MAX', 'MAXIMUM_MEMORY'],
['BINARYEN_PASSES', [''], 'Use BINARYEN_EXTRA_PASSES to add additional passes'],
['SWAPPABLE_ASM_MODULE', [0], 'Fully swappable asm modules are no longer supported'],
['ASM_JS', [1], 'asm.js output is not supported any more'],
['FINALIZE_ASM_JS', [0, 1], 'asm.js output is not supported any more'],
['ASM_JS', [1], 'asm.js output is not supported anymore'],
['FINALIZE_ASM_JS', [0, 1], 'asm.js output is not supported anymore'],
['ASYNCIFY_WHITELIST', 'ASYNCIFY_ONLY'],
['ASYNCIFY_BLACKLIST', 'ASYNCIFY_REMOVE'],
['EXCEPTION_CATCHING_WHITELIST', 'EXCEPTION_CATCHING_ALLOWED'],
Expand Down
2 changes: 1 addition & 1 deletion test/test_other.py
Original file line number Diff line number Diff line change
Expand Up @@ -10635,7 +10635,7 @@ def test_c_preprocessor(self):
# Test that legacy settings that have been fixed to a specific value and their value can no longer be changed,
def test_legacy_settings_forbidden_to_change(self):
stderr = self.expect_fail([EMCC, '-sMEMFS_APPEND_TO_TYPED_ARRAYS=0', test_file('hello_world.c')])
self.assertContained('MEMFS_APPEND_TO_TYPED_ARRAYS=0 is no longer supported', stderr)
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)

self.run_process([EMCC, '-sMEMFS_APPEND_TO_TYPED_ARRAYS', test_file('hello_world.c')])
self.run_process([EMCC, '-sPRECISE_I64_MATH=2', test_file('hello_world.c')])
Expand Down
2 changes: 1 addition & 1 deletion tools/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ def __setattr__(self, name, value):
exit_with_error('legacy setting used in strict mode: %s', name)
fixed_values, error_message = self.legacy_settings[name]
if fixed_values and value not in fixed_values:
exit_with_error('Invalid command line option -s ' + name + '=' + str(value) + ': ' + error_message)
exit_with_error(f'invalid command line setting `-s{name}={value}`: {error_message}')
diagnostics.warning('legacy-settings', 'use of legacy setting: %s (%s)', name, error_message)

if name in self.alt_names:
Expand Down

0 comments on commit c85f1b1

Please sign in to comment.