Skip to content

Commit 590bb31

Browse files
authored
Ensure EM_CONFIG is set before config parsing (emscripten-core#12751)
emsdk was broken by emscripten-core#12699 because it was assuming that EM_CONFIG is available in the environment at the point when the config was bring parsed.
1 parent 412bf20 commit 590bb31

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

tools/config.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,4 +280,9 @@ def generate_config(path, first_time=False):
280280
if not os.path.exists(config_file):
281281
exit_with_error('emscripten config file not found: ' + config_file)
282282

283+
# Emscripten compiler spawns other processes, which can reimport shared.py, so
284+
# make sure that those child processes get the same configuration file by
285+
# setting it to the currently active environment.
286+
os.environ['EM_CONFIG'] = EM_CONFIG
287+
283288
parse_config_file()

tools/shared.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -970,11 +970,6 @@ def read_and_preprocess(filename, expand_macros=False):
970970
# file. TODO(sbc): We should try to reduce that amount we do here and instead
971971
# have consumers explicitly call initialization functions.
972972

973-
# Emscripten compiler spawns other processes, which can reimport shared.py, so
974-
# make sure that those child processes get the same configuration file by
975-
# setting it to the currently active environment.
976-
os.environ['EM_CONFIG'] = config.EM_CONFIG
977-
978973
# Verbosity level control for any intermediate subprocess spawns from the compiler. Useful for internal debugging.
979974
# 0: disabled.
980975
# 1: Log stderr of subprocess spawns.

0 commit comments

Comments
 (0)