add starlark debug server address flag#29377
add starlark debug server address flag#293771seal wants to merge 2 commits intobazelbuild:masterfrom
Conversation
hvadehra
left a comment
There was a problem hiding this comment.
While this is a reasonable change, it is a breaking one. That should be fine for Bazel, since this will go live only with Bazel 10. But will almost certainly end up being an issue internally where that will happen in O(days), and I strongly suspect tools / services have come to rely on this working across machines.
What I would suggest is we first introduce the flag with the default being the old/existing behavior. We can then update things internally to prepare for changing the default in a followup change (hopefully in just a week or two).
| @VisibleForTesting | ||
| static ServerSocket createServerSocket(int port, @Nullable String listenAddress) | ||
| throws IOException { | ||
| InetAddress address = |
There was a problem hiding this comment.
The docs for InetAddress.getName say the method already behaves exactly this way for null or empty inputs, so this is unnecessary.
Summary
--experimental_skylark_debug_server_addresswhile preserving the existing default bind behaviorWhy
This introduces the configuration knob first without breaking existing cross-machine debugger workflows. Users and internal tools can opt into a specific address now, and callers that need remote debugger access can explicitly set a non-loopback address before any future default change.
User impact
there is no behavior change by default.
users who want local-only debugger access can pass
--experimental_skylark_debug_server_address=localhostor another loopback address.users who intentionally attach from another host can continue relying on the current default for now, or set the required listen address explicitly.
Validation
git diff --check/tmp/bazelisk test --test_output=errors //src/test/java/com/google/devtools/build/lib/starlarkdebug/server:StarlarkDebugServerTest //src/test/java/com/google/devtools/build/lib/starlarkdebug/server:StarlarkDebugIntegrationTest