Skip to content

Commit d5ef693

Browse files
authored
Fix cache repopulation within emconfigure (#16986)
When `emcc` is called within `emconfigure` and also needs to build a cache from scratch, it incorrectly retains the `EMMAKEN_JUST_CONFIGURE` variable for the cache build, causing errors.
1 parent 2b1b813 commit d5ef693

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

tests/test_other.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5526,6 +5526,11 @@ def check(what, args, fail=True, expect=''):
55265526
''')
55275527
check(EMCONFIGURE, [PYTHON, 'test.py'], expect=shared.LLVM_NM, fail=False)
55285528

5529+
create_file('test.c', 'int main() { return 0; }')
5530+
os.mkdir('test_cache')
5531+
with env_modify({'EM_CACHE': os.path.abspath('test_cache')}):
5532+
check(EMCONFIGURE, [EMCC, 'test.c'], fail=False)
5533+
55295534
def test_emmake_python(self):
55305535
# simulates a configure/make script that looks for things like CC, AR, etc., and which we should
55315536
# not confuse by setting those vars to something containing `python X` as the script checks for

tools/system_libs.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ def clean_env():
6262
for opt in ['CFLAGS', 'CXXFLAGS', 'LDFLAGS',
6363
'EMCC_CFLAGS',
6464
'EMCC_FORCE_STDLIBS',
65-
'EMCC_ONLY_FORCED_STDLIBS']:
65+
'EMCC_ONLY_FORCED_STDLIBS',
66+
'EMMAKEN_JUST_CONFIGURE']:
6667
if opt in safe_env:
6768
del safe_env[opt]
6869
return safe_env

0 commit comments

Comments
 (0)