Skip to content

Reduce/manage the number of settings in settings.js #8257

Closed

Description

@sbc100

tldr; I'd like to try to reduce the number of user-visible settings in settings.js

There are currently over 230 settings values in settings.js.

These settings service many difference purposes. Some are internal-only settings for communicating between python and js code. Some effect the generated code. Some effect library code.

All these settings a modifiable by the user via command line and visible to the user in via the JS "pre-processor". (Are they visible in any other way other than this ifdef system in pre-processor)?

Many of these settings can take more than just 2 values so that combinatorial effect of this is enormous. There is simply no way we can test even a tiny subset of this space.

Some immediate things we can do:

  1. Remove any orphaned settings (settings that are no longer used anywhere)
  2. Find a way to distinguish between user-visible settings and non-user-visible settings
    • Which settings can come from the command line?
    • Which settings are internal-only?
    • Which setttings are visible to user-JS code?
  3. Raise that bar for adding new settings. At least user-visible ones.
  4. Look for opportunities to retire settings.

We've already kind of been doing this but I wanted to create an issue to track this.

Activity

  1. jgravelle-google commented on Mar 11, 2019

    @jgravelle-google
    Contributor

    This is overall a big +1 from me.

    I believe non-user-visible settings are still visible via the command line though, because emcc can call sub-invocations of emcc with different, internal-only arguments. (e.g., here

    cmd = [shared.PYTHON, shared.EMCC] + cpp_opts + ['-o', js_file[1], src_file[1], '-s', 'BOOTSTRAPPING_STRUCT_INFO=1', '-s', 'WARN_ON_UNDEFINED_SYMBOLS=0', '-Oz', '--js-opts', '0', '--memory-init-file', '0', '-s', 'SINGLE_FILE=1', '-s', 'WASM=0', '-Wno-format']
    )
    I'd like to say we should disallow those settings via command-line, but then we'd need to have some other mechanism for forwarding that information.
    A simple immediate solution might be to move them to an internal_settings.js file, and for those arguments change -s into -s-internal.

    Another observation is that because the emscripten driver should be the only user of these internal flags, whatever mechanism we use can be more verbose than if it were user-facing.

  2. stale commented on Mar 10, 2020

    @stale

    This issue has been automatically marked as stale because there has been no activity in the past year. It will be closed automatically if no further activity occurs in the next 7 days. Feel free to re-open at any time if this issue is still relevant.

  3. sbc100 commented on Mar 23, 2020

    @sbc100
    CollaboratorAuthor

    I feel like we've done a pretty good job on this. Lets call it closed for now/

  4. sbc100 commented on Mar 23, 2020

    @sbc100
    CollaboratorAuthor

    Sorry "we've" done a pretty good job

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