mirror of https://github.com/pulumi/pulumi.git
d51c0bdd87
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> |
||
---|---|---|
.. | ||
doc.go | ||
provider.go | ||
provider_test.go | ||
reference.go | ||
reference_test.go | ||
registry.go | ||
registry_test.go |