diff --git a/.circleci/config.yml b/.circleci/config.yml index 5db4671115737..98ea13c618157 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -787,7 +787,7 @@ jobs: EMTEST_SKIP_NODE_CANARY: "1" EMTEST_SKIP_WASM64: "1" steps: - - run: apt-get install -q -y ninja-build scons + - run: apt-get install -q -y ninja-build scons ccache - run-tests-linux: # some native-dependent tests fail because of the lack of native # headers on emsdk-bundled clang diff --git a/test/test_other.py b/test/test_other.py index 8fbd99a940658..f8ee4f1281f2d 100644 --- a/test/test_other.py +++ b/test/test_other.py @@ -154,6 +154,18 @@ def decorated(self, *args, **kwargs): return decorated +def requires_ccache(func): + assert callable(func) + + @wraps(func) + def decorated(self, *args, **kwargs): + if not shutil.which('ccache'): + self.fail('test requires ccache to be installed (available in PATH)') + return func(self, *args, **kwargs) + + return decorated + + def requires_scons(func): assert callable(func) @@ -12554,6 +12566,11 @@ def test_compiler_wrapper(self): self.assertContained('wrapping compiler call: ', stdout) self.assertExists('test_hello_world.o') + @requires_ccache + @with_env_modify({'EM_COMPILER_WRAPPER': 'ccache'}) + def test_compiler_wrapper_ccache(self): + self.do_runf('hello_world.c', 'hello, world!') + def test_llvm_option_dash_o(self): # emcc used to interpret -mllvm's option value as the output file if it # began with -o diff --git a/tools/shared.py b/tools/shared.py index a249d975bdbca..88b8544b83df3 100644 --- a/tools/shared.py +++ b/tools/shared.py @@ -249,7 +249,7 @@ def exec_process(cmd): else: sys.stdout.flush() sys.stderr.flush() - os.execv(cmd[0], cmd) + os.execvp(cmd[0], cmd) def run_js_tool(filename, jsargs=[], node_args=[], **kw): # noqa: mutable default args