Skip to content

Remove JS_ENGINES and COMPILER_ENGINE from config file - #1354

Merged
sbc100 merged 1 commit into
mainfrom
remove_JS_ENGINES
Mar 14, 2024
Merged

Remove JS_ENGINES and COMPILER_ENGINE from config file#1354
sbc100 merged 1 commit into
mainfrom
remove_JS_ENGINES

Conversation

@sbc100

@sbc100 sbc100 commented Mar 13, 2024

Copy link
Copy Markdown
Collaborator

COMPILER_ENGINE was completely removed from emscripten in emscripten-core/emscripten#9469.

JS_ENGINES is only used/needed for testing and is no longer needed as of emscripten-core/emscripten#9542.

@sbc100
sbc100 requested a review from kripken March 13, 2024 16:16

@kripken kripken left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm otherwise, versions look right.

Comment thread emsdk.py Outdated
cfg += 'COMPILER_ENGINE = NODE_JS\n'
# See https://github.com/emscripten-core/emscripten/pull/9542
if version < [1, 38, 48]:
cfg += 'JS_ENGINES = [NODE_JS]\n'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is in a loop - is it not possible that we get these more than once? Or do we guarantee that EMSCRIPTEN_ROOT appears exactly once in a single activated config?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose we could have more than one version of emscripten installed? But in that case the desired behaviour is that the config file should be a super-set of all the settings required I think.

The exact same pattern is used here:

emsdk/emsdk.py

Lines 2490 to 2494 in 7815dca

for tool in tools_to_activate:
config = tool.activated_config()
if 'EMSCRIPTEN_ROOT' in config:
# For older emscripten versions that don't use an embedded cache by
# default we need to export EM_CACHE.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The superset makes sense, but I think the current code can end up with duplication? That is,

JS_ENGINES = [NODE_JS]
JS_ENGINES = [NODE_JS]
JS_ENGINES = [NODE_JS]

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But I don't think it matters because you can't really have more than one version of emscripten installed can you?

Also, those repeated keys would be harmless if you somehow did mange to activate more than one emscripten install at once

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But I don't think it matters because you can't really have more than one version of emscripten installed can you?

Yeah, I think only one can be active at once, but just wanted to check that my understanding was the same as yours. However, reading the code I can't easily confirm that, as in the manifest file EMSCRIPTEN_ROOT appears in things with id "releases" and also id "emscripten". I think a release contains emscripten among other things, so that suggests we use that field in more than one active thing?

Also, those repeated keys would be harmless if you somehow did mange to activate more than one emscripten install at once

I agree, it should not break anything, but would just look weird.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What solution would your propose here?

Remember this only effects very old version of emscripten. So in order to see this "wierd" duplication one would need to:

  1. Somehow install more than one version of emscripten (I'm pretty sure this is not support and/or would never work)
  2. Both version of emscripten would need to be these very old versions.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps we could in the loop set a boolean "need legacy vars", and then outside of it if that is set then we add those two? That doesn't seem much more complex, and it seems safer to me.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But there is no safety issue so I'm not sure adding complexity here is worth it. Have those duplicate keys would be a very minor cosmetic issue (more folks are not going to look at this config file ever).

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I refactored and added find_emscripten_root() which returns the currently active emscripten root.

@sbc100
sbc100 force-pushed the remove_JS_ENGINES branch 2 times, most recently from afc0b36 to e68a0c2 Compare March 13, 2024 20:20
@sbc100
sbc100 requested a review from kripken March 13, 2024 20:21
@sbc100
sbc100 force-pushed the remove_JS_ENGINES branch from e68a0c2 to 60d1d75 Compare March 13, 2024 20:26

@kripken kripken left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm % comments

Comment thread emsdk.py Outdated
Comment thread emsdk.py
@sbc100
sbc100 force-pushed the remove_JS_ENGINES branch 2 times, most recently from d3c08df to 97ffb86 Compare March 13, 2024 23:17
`COMPILER_ENGINE` was completely removed from emscripten in
emscripten-core/emscripten#9469.

`JS_ENGINES` is only used/needed for testing and is no longer needed
as of emscripten-core/emscripten#9542.
@sbc100
sbc100 force-pushed the remove_JS_ENGINES branch from 97ffb86 to 6ffa04d Compare March 14, 2024 00:34
@sbc100
sbc100 merged commit 5726ccc into main Mar 14, 2024
@sbc100
sbc100 deleted the remove_JS_ENGINES branch March 14, 2024 00:54
mmorel-35 pushed a commit to mmorel-35/emsdk that referenced this pull request Feb 3, 2026
…re#1354)

`COMPILER_ENGINE` was completely removed from emscripten in
emscripten-core/emscripten#9469.

`JS_ENGINES` is only used/needed for testing and is no longer needed
as of emscripten-core/emscripten#9542.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants