Skip to content

Conversation

@andreiltd
Copy link
Member

This patch includes various fixes for how the debugger feature is enabled at compile time.

  • Provide stub implementation of content_debugger for builds where ENABLE_JS_DEBUGGER is not defined
  • Move __wasilibc_initialize_environ to debugger initialization to avoid implicit wasi/environment dependency.

There are currently 3 entry points where the content debugger can be initialized:

  1. http/handler -- debugger initialization is now explicitly called in the StarlingMonkey fetch event: here
  2. cli/run -- debugger initialization should be called on engine initialization: here
  3. componentize-js defined exports -- through componentize-js builtins on first call to exported function: feat: initialize debugger on first call ComponentizeJS#237

This patch includes various fixes for how the debugger feature is
enabled at compile time.

- Provide stub implementation of `content_debugger` for builds where
  `ENABLE_JS_DEBUGGER` is not defined
- Move `__wasilibc_initialize_environ` to debugger initialization to
  avoid implicit `wasi/environment` dependency.

There are currently 3 entry points where the content debugger can be
initialized:

1. `http/handler` -- debugger initialization is now explicitly called in
   the StarlingMonkey fetch event
2. `cli/run` -- debugger initialization should be called on engine
   initialization
3. `componentize-js` defined exports -- through componentize-js builtins
   on first call to exported function
Copy link
Member

@tschneidereit tschneidereit left a comment

Choose a reason for hiding this comment

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

Thank you, this is a great improvement!

@andreiltd
Copy link
Member Author

https://http-me.glitch.me that we use in some tests is unreliable. I think we should use local server for all the tests.

The only problem with that is that it must use randomized port for parallel tests to work. We would need to pass the dynamic port somehow to the test component. Ideally we can use wasmtime --env but I don't think we have any builtins that could read that.

Copy link
Member

@tschneidereit tschneidereit left a comment

Choose a reason for hiding this comment

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

LGTM!

@tschneidereit tschneidereit merged commit eecc00c into bytecodealliance:main Jul 11, 2025
5 checks passed
@github-actions github-actions bot mentioned this pull request Oct 16, 2025
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