Skip to content

Add support for embedded config file #9543

Closed

Description

@sbc100

emscripten has traditionally been configured by a config file
in the current users home directory. emsdk has an --embedded option
that puts the config file within the SDK itself. This is useful for
users who have multiple emscripten installations and/or checkout and
want to have different configuration file for each one.
We should search for .emscripten by default alongside the emscripten
source code, and use the local configuration if found. This will allow
emsdk and other packagers to ship config files inside the emscripten
directory. emsdk and other packages don't need or want a user config
file since they tend to package things in known paths.

The plan is to move towards embedded config (and cache for that matter)
in several stages:

  1. Switch emsdk --embedded to store the config in the emscripten folder
    directly rather than in the emsdk dir. This will allow a different
    config for each emscripten version.
  2. Have emscripten, by default, look for a local config file.
  3. Make --embedded the default for emsdk.
  4. Stop exporting EM_CONFIG in emsdk (since the config can be found
    automatically now).
  5. Have emscripten write the "new user" config file locally by default.
  6. Default to a local "cache" directory in emscripten.
  7. Stop supporting config files in $HOME.

Activity

  1. dschuff commented on Oct 10, 2019

    @dschuff
    Member

    Do we want to support the case where the emscripten directory is read-only? Obviously by default for most users it will be fine to e.g. have a RO image or directory with an embedded config. We could force users who want a custom config to build their own SDK directory (even if it's just by copying from a prebuilt image), or we could allow some way of overriding (I guess --em-config still works?)

  2. sbc100 commented on Oct 11, 2019

    @sbc100
    CollaboratorAuthor

    Yes, we do need to consider RO directories.

    I see three main use cases:

    1. emsdk users: they have write access the emscripten tree and always want full embedded config. Doesn't make sense to use $HOME here at all. config/cache/etc should be SDK-local.
    2. emscripten developers using git. Also have full write access. Also don't want to store config in home dir.
    3. brew/debian/other packaged users. No write access. But also SDK should come preconfigured. So embedded read-only config makes sense, but cache in $HOME.
  3. sbc100 commented on Oct 11, 2019

    @sbc100
    CollaboratorAuthor

    Did I miss any?

  4. 5 remaining items

  5. dschuff commented on May 11, 2020

    @dschuff
    Member

    There might be a 4th category, which is those who package their own SDK which includes emscripten, or manage multiple installations (e.g. on CI). they might want to support installation of emscripten itself or their own SDK to readonly directories ("installation" can be a much heavier-weight operation with something like Unity that is bigger and doesn't release as frequently as we do).
    I think this is actually probably the same as 3) though.

  6. sbc100 commented on May 11, 2020

    @sbc100
    CollaboratorAuthor

    Yeah I think all "read-only" installs come under "3"... Maybe I'm missing how would something like unity would differ from homebrew?

  7. sbc100 commented on May 21, 2020

    @sbc100
    CollaboratorAuthor

    Some positive feedback on this work from the mailing list: No environment variables or additions to the PATH variables needed, only the absolute paths to the toolchain tools. It's perfect now :)

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

Metadata

Metadata

Assignees

No one assigned

    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