Skip to content

Commit 2e02efc

Browse files
authored
Fix symbol list caching for local development. NFC (#25927)
The generated symbol list can also depend on the JS compiler code itself. This only really effect emscripten developers but I ran into a strange issue recently where I had stale symbol lists when moving between local branches.
1 parent 666966f commit 2e02efc

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

tools/link.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -276,9 +276,10 @@ def get_js_sym_info():
276276
skip_settings = {'PRE_JS_FILES', 'POST_JS_FILES'}
277277
input_files = [json.dumps(settings.external_dict(skip_keys=skip_settings), sort_keys=True, indent=2)]
278278
jslibs = glob.glob(utils.path_from_root('src/lib') + '/lib*.js')
279-
assert jslibs
280-
input_files.extend(read_file(jslib) for jslib in sorted(jslibs))
281-
for jslib in settings.JS_LIBRARIES:
279+
# Also, include the js compiler code itself, in case it gets locally modified.
280+
jslibs += glob.glob(utils.path_from_root('src/*.mjs'))
281+
jslibs = sorted(jslibs) + settings.JS_LIBRARIES
282+
for jslib in jslibs:
282283
input_files.append(read_file(jslib))
283284
content = '\n'.join(input_files)
284285
content_hash = hashlib.sha1(content.encode('utf-8')).hexdigest()

0 commit comments

Comments
 (0)