Skip to content

Replacement for deprecated EMMAKEN_COMPILER? #12340

Description

@bmeurer

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?

cc @pfaffe @natorion

Activity

  1. vadimkantorov commented on Sep 25, 2020

    @vadimkantorov

    Related (but more about a snippet for wrapping of the target emcc compiler): #12256

  2. sbc100 commented on Sep 25, 2020

    @sbc100
    Collaborator

    @bmeurer interesting. Thanks for filing this.

    Ideally I would hope that things like distcc and ccache and gomacc could be wrapped around the outside of emcc? e.g. CC=cache emcc or CC=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_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.

    Would that be an acceptable solution?

  3. pfaffe commented on Sep 25, 2020

    @pfaffe
    Collaborator

    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.

  4. sbc100 commented on Sep 25, 2020

    @sbc100
    Collaborator

    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?

  5. bmeurer commented on Sep 30, 2020

    @bmeurer
    ContributorAuthor

    @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.

  6. sbc100 commented on Sep 30, 2020

    @sbc100
    Collaborator

    I'll implement EM_COMPILER_LAUNCHER today (hopefully). Are you ok with suppressing the deprecation warning for now (-Wno-error=deprecate should do it)?

  7. added 2 commits that reference this issue on Sep 30, 2020
    dd66ca1
    a888f12
  8. added a commit that references this issue on Sep 30, 2020
    8c78ffb
  9. bmeurer commented on Oct 23, 2020

    @bmeurer
    ContributorAuthor

    @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.

  10. sbc100 commented on Oct 23, 2020

    @sbc100
    Collaborator

    Sure, sounds reasonable.

  11. sbc100 commented on Oct 23, 2020

    @sbc100
    Collaborator

    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?

  12. pfaffe commented on Oct 26, 2020

    @pfaffe
    Collaborator

    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.
  13. sbc100 commented on Oct 26, 2020

    @sbc100
    Collaborator

    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

    1. config file
    2. env var
    3. command line.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions