Skip to content

Conversation

@sbc100
Copy link
Collaborator

@sbc100 sbc100 commented Oct 14, 2024

When this code was added in #20909 it broke users who were doing EM_COMPILER_WRAPPER=cache since it was not using PATH to find the executable (unlike the subprocess module).

Fixes: #22736

@sbc100 sbc100 requested a review from kripken October 14, 2024 23:11
@kripken
Copy link
Member

kripken commented Oct 14, 2024

(do we have ccache on the CI machines?)

@sbc100
Copy link
Collaborator Author

sbc100 commented Oct 14, 2024

(do we have ccache on the CI machines?)

Probably not.. so I guess we can expect to see this file on test-other. Lets see. I'll add it once that is confirmed.

When this code was added in emscripten-core#20909 it broke users who were doing
`EM_COMPILER_WRAPPER=cache` since it was not using PATH to find the
executable (unlike the subprocess module).

Fixes: emscripten-core#22736
@sbc100 sbc100 merged commit 9c9b764 into emscripten-core:main Oct 15, 2024
@sbc100 sbc100 deleted the exec_cache branch October 15, 2024 02:18
@kleisauke
Copy link
Collaborator

Just wondering, is EM_COMPILER_WRAPPER=ccache recommended over _EMCC_CCACHE=1? I've been using the latter (internal) setting for a while now:
https://github.com/kleisauke/wasm-vips/blob/v0.0.10/Dockerfile#L45-L47

@sbc100
Copy link
Collaborator Author

sbc100 commented Oct 15, 2024

Just wondering, is EM_COMPILER_WRAPPER=ccache recommended over _EMCC_CCACHE=1? I've been using the latter (internal) setting for a while now: https://github.com/kleisauke/wasm-vips/blob/v0.0.10/Dockerfile#L45-L47

Hmm.. I can't remember exactly that EMCC_CCACHE was needed, but it works slightly differently. EM_COMPILER_WRAPPER can be used to inject any compiler wrapper, not just ccache. It gets injected inside the python driver and it adds the wrapper to the internal clang calls.

_EMCC_CCACHE inject explicitly cache only and it works in the shell/bat files and adds the wrapper before emcc rather than clang. So if you you use _EMCC_CCACHE then ccache itself will see emcc as the compiler but if you use EM_COMPILER_WRAPPER then ccache will see clang as the compiler. I think _EMCC_CCACHE might require a patched version of ccache?

@kleisauke
Copy link
Collaborator

Thanks for the information!

I think _EMCC_CCACHE might require a patched version of ccache?

It seems to work without any patches, though I haven't tested it extensively. emsdk also provides a patched version of ccache through the ccache-git-emscripten-64bit target.
https://github.com/emscripten-core/emsdk/blob/3.1.69/emsdk_manifest.json#L678-L688

(the same question was raised in #13498 (comment))

@sbc100
Copy link
Collaborator Author

sbc100 commented Oct 16, 2024

Sounds like performance is that reason to prefer _EMCC_CCACHE. I do wonder if the difference is still as significant these days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

EM_COMPILER_WRAPPER broken from 3.1.51

3 participants