Skip to content

Conversation

@sbc100
Copy link
Collaborator

@sbc100 sbc100 commented Oct 24, 2024

Fixes #22783

@sbc100 sbc100 requested review from dschuff and kripken October 25, 2024 01:05
@sbc100 sbc100 force-pushed the emscripten_runtime_keepalive_clear branch from e3107ba to 9b37362 Compare October 25, 2024 01:06
@sbc100
Copy link
Collaborator Author

sbc100 commented Oct 25, 2024

@eyebrowsoffire

self.do_other_test('test_embool.c')

def test_strict_closure(self):
self.emcc(test_file('hello_world.c'), ['-sSTRICT', '--closure=1'])
Copy link
Member

Choose a reason for hiding this comment

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

Maybe put it alongside this similar test?

emscripten/test/test_other.py

Lines 14906 to 14907 in 9e618aa

def test_arguments_global(self):
self.emcc(test_file('hello_world_argv.c'), ['-sENVIRONMENT=web', '-sSTRICT', '--closure=1', '-O2'])

Copy link
Collaborator

@eyebrowsoffire eyebrowsoffire left a comment

Choose a reason for hiding this comment

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

LGTM. Just some small suggestions, but they probably don't really matter either way.

},

#if !MINIMAL_RUNTIME
_emscripten_runtime_keepalive_clear__deps: ['$runtimeKeepaliveCounter'],
Copy link
Collaborator

Choose a reason for hiding this comment

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

Two things:

  • Perhaps $runtimeKeepaliveCounter should be removed below from the direct deps of emscripten_force_exit, since it will already get it implicitly from depending on this function.
  • I'm not 100% sure about this, but could we instead have an alternative version of _emscripten_runtime_keepalive_clear that just doesn't do anything and doesn't depend on runtimeKeepaliveCounter at all, since in that case the variable isn't otherwise used? It doesn't seem to be incremented/decremented or checked in the case I was building. Not a huge deal either way, but if the other code paths avoid using the variable when in this mode, perhaps this one could avoid using the variable as well?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

First part done, good idea.

Second part is harder. Its something I've done for noExitRuntime but this stuff is pretty tricky to get right so I'll leave that for a followup.

@sbc100 sbc100 force-pushed the emscripten_runtime_keepalive_clear branch from 9b37362 to ece2b6c Compare October 29, 2024 19:11
@sbc100 sbc100 merged commit abd465b into emscripten-core:main Oct 30, 2024
28 checks passed
@sbc100 sbc100 deleted the emscripten_runtime_keepalive_clear branch October 30, 2024 02:32
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.

ERROR - [JSC_UNDEFINED_VARIABLE] variable runtimeKeepaliveCounter is undeclared

3 participants