pulumi/pkg/resource/deploy/providers
Thomas Gummerer d51c0bdd87
implement the engine bits for debugging support (#17072)
We want to introduce dubugging support for Pulumi programs. This PR
implements the engine changes necessary for that. Namely, we pass the
information whether we expect a debugger to be started to the language
runtime, and introduce a way for the language runtime plugins to report
to the engine that we're waiting for a debugger to attach. The language
runtime is expected to include the information relevant for the user to
be able to attach to the debugger, as well as a shortened message.

The idea is that the configuration can be picked up by an IDE, and the
debugger can attach automatically. Meanwhile the short message should
contain enough information to be able to attach a debugger manually,
while being short enough to be displayed to the user in the CLI output.
(this will commonly be either the port of the debugger, or the PID of
the process being debugged).

The implementation of the CLI flags and each of the language runtimes
will follow in subsequent PRs.

I tried adding a test to this, but I'm not sure it's possible with our
current testing infrastructure. To do this properly, we'd need to make a
RPC call to the engine, but we don't have that available in the
lifecycletests (? please let me know if I'm missing something). Once
more of the feature is implemented we might be able to implement an
integration test for it. (Not straightforward either, as we'll have to
tell the debugger to continue, but that should be more doable).

Another thing that's not clear to me is that @EronWright mentions this
could be used for MLC/provider debugging as well. However I'm not seeing
how that's going to work, as MLCs/providers are being run as a binary
plugin, which we don't compile from pulumi/pulumi, and thus wouldn't
necessarily even know which debugger to launch it under without a bunch
of additional configuration, that might be better in a shim around the
program (or just keeping the debugging the way we're currently doing,
launching the program and then letting the engine attach to it).

---------

Co-authored-by: Eron Wright <eron@pulumi.com>
Co-authored-by: Julien <julien@caffeine.lu>
2024-08-30 10:31:28 +00:00
..
doc.go Document Go packages (#6009) 2021-01-11 11:07:59 -07:00
provider.go Package versions are required for parameterized packages (#16875) 2024-08-05 16:01:28 +00:00
provider_test.go Extend the TestReplacementParameterizedProvider test (#16644) 2024-07-15 08:33:36 +00:00
reference.go Allow anything in resource names (#14107) 2023-11-20 08:59:00 +00:00
reference_test.go ci: radical idea - what if slow tests & no stdout makes GH consider runner dead? 2022-03-06 14:52:13 -08:00
registry.go Package versions are required for parameterized packages (#16875) 2024-08-05 16:01:28 +00:00
registry_test.go implement the engine bits for debugging support (#17072) 2024-08-30 10:31:28 +00:00