You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Replacement for deprecated EMMAKEN_COMPILER? #12340
With 2.0.4, emcc is complaining that EMMAKEN_COMPILER is deprecated. We had been using that to point to a little script snippet that forces Emscripten to invoke a (defined) clang together with gomacc to speed up compilation via goma. Given that EMMAKEN_COMPILER is deprecated now, it's unclear how we can achieve this? Maybe we could have goma officially supported in Emscripten instead?
However I guess one problem is that distributing just llvm to the build nodes in a distcc/gomacc farm is a lot easier that distributing the whole emscripten? Is that essentially the problem?
I would be more comfortable bringing back EMMAKEN_COMPILER as EM_COMPILER_WRAPPER or EM_COMPILER_LAUNCHER that added an executable to beginning on the clang invocation, but otherwise didn't change the actual clang/llvm being used. We have EM_LLVM_ROOT for the latter already.
EM_COMPILER_LAUNCHER sounds like an excellent solution.
Wrapping the emcc call is possible, but the compiler farm would have to have lots of emcc versions available. Wrapping just the clang calls is so much easier because everything is already in place for that.
I'm curious about how goma works in situations like this... do you have to get the goma farm to install a new version of llvm for each emsdk version... or do you end up using just a "close-enough" version and hope for the best?
@pfaffe and I had been looking into various options. gomacc emcc didn't work at least in summer, we had to pass clang to gomacc. Having an Emscripten replacement for CMAKE_C_COMPILER_LAUNCHER would be awesome, that's what we're using to hook up gomacc with the native build right now.
I'll implement EM_COMPILER_LAUNCHER today (hopefully). Are you ok with suppressing the deprecation warning for now (-Wno-error=deprecate should do it)?
@sbc100 It turns out what we need is actually a command line flag for emcc instead of an environment variable. Can you add a -sCOMPILER_WRAPPER=... as well? That way we can make this work with cmake, gomacc and autoninja.
There is already a config file setting called COMPILER_WRAPPER that can be used to set this globally in the config file. Would that work for your use case?
We're aware of the config option, but a command line flag has a bunch of advantages:
It's visible in logs and in the ninja build rules. The former avoids hidden state, in that I can copy-paste build commands to rerun them. The second helps with tools such as autoninja which check the build rules for gomacc calls.
It can be configured by build generators such as gn or CMake. I can configure multiple repos with different gomacc versions for example. The config file is (conceptually at least) part of the emscripten distribution, whereas goma is not.
Activity
vadimkantorov commentedon Sep 25, 2020
Related (but more about a snippet for wrapping of the target emcc compiler): #12256
sbc100 commentedon Sep 25, 2020
@bmeurer interesting. Thanks for filing this.
Ideally I would hope that things like
distccandccacheandgomacccould be wrapped around the outside ofemcc? e.g.CC=cache emccorCC=gomacc emcc.The way cmake would do this for example is with CMAKE_C_COMPILER_LAUNCHER: https://cmake.org/cmake/help/latest/prop_tgt/LANG_COMPILER_LAUNCHER.html
However I guess one problem is that distributing just llvm to the build nodes in a distcc/gomacc farm is a lot easier that distributing the whole emscripten? Is that essentially the problem?
I would be more comfortable bringing back
EMMAKEN_COMPILERasEM_COMPILER_WRAPPERorEM_COMPILER_LAUNCHERthat added an executable to beginning on the clang invocation, but otherwise didn't change the actual clang/llvm being used. We have EM_LLVM_ROOT for the latter already.Would that be an acceptable solution?
pfaffe commentedon Sep 25, 2020
EM_COMPILER_LAUNCHERsounds like an excellent solution.Wrapping the
emcccall is possible, but the compiler farm would have to have lots of emcc versions available. Wrapping just the clang calls is so much easier because everything is already in place for that.sbc100 commentedon Sep 25, 2020
I'm curious about how goma works in situations like this... do you have to get the goma farm to install a new version of llvm for each emsdk version... or do you end up using just a "close-enough" version and hope for the best?
bmeurer commentedon Sep 30, 2020
@pfaffe and I had been looking into various options.
gomacc emccdidn't work at least in summer, we had to pass clang togomacc. Having an Emscripten replacement forCMAKE_C_COMPILER_LAUNCHERwould be awesome, that's what we're using to hook upgomaccwith the native build right now.sbc100 commentedon Sep 30, 2020
I'll implement EM_COMPILER_LAUNCHER today (hopefully). Are you ok with suppressing the deprecation warning for now (
-Wno-error=deprecateshould do it)?Add EM_COMPILER_WRAPPER as replacement for EMMAKEN_COMPILER
Add EM_COMPILER_WRAPPER as replacement for EMMAKEN_COMPILER
Add EM_COMPILER_WRAPPER as replacement for EMMAKEN_COMPILER (#12380)
bmeurer commentedon Oct 23, 2020
@sbc100 It turns out what we need is actually a command line flag for
emccinstead of an environment variable. Can you add a-sCOMPILER_WRAPPER=...as well? That way we can make this work withcmake,gomaccandautoninja.sbc100 commentedon Oct 23, 2020
Sure, sounds reasonable.
sbc100 commentedon Oct 23, 2020
There is already a config file setting called
COMPILER_WRAPPERthat can be used to set this globally in the config file. Would that work for your use case?pfaffe commentedon Oct 26, 2020
We're aware of the config option, but a command line flag has a bunch of advantages:
sbc100 commentedon Oct 26, 2020
OK sounds good. In that case think I might event a way to set arbirary config options on the command line.
Then there will 3 ways to set each config option
Minor refactor of `-s` command line parsing. NFC.
Minor refactor of `-s` command line parsing. NFC.
Allow setting of individual config settings via `-s` flags
Minor refactor of `-s` command line parsing. NFC. (#12607)
Allow setting of individual config settings via `-s` flags
Add --compiler-wrapper command line flag
Add --compiler-wrapper command line flag (#12662)