Skip to content

Add support for embedded config file #9543

@sbc100

Description

@sbc100
Collaborator

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

added a commit that references this issue on Sep 30, 2019
added a commit that references this issue on Sep 30, 2019
dschuff

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?)

sbc100

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

sbc100 commented on Oct 11, 2019

@sbc100
CollaboratorAuthor

Did I miss any?

added a commit that references this issue on Apr 15, 2020

30 remaining items

Loading
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

        Participants

        @sbc100@dschuff

        Issue actions

          Add support for embedded config file · Issue #9543 · emscripten-core/emscripten