You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue is mostly in the context of terraform but it seems the best way to tackle it is at the bottom of the stack, so I'm posting it here.
Right now, Terraform requires me to manually copy paste the TF_REATTACH_PROVIDERS environment configuration every time I start my provider in a debugger. This is really inconvenient. As far as I can tell there is currently no clean way around this, since Unix sockets are always assigned a random temp file, and I'd rather not have some hacky concoction of env vars and command aliases to prefix me running terraform with something to load the provider config automatically.
It seems to me like the best solution is some sort of env var to force the plugin system to mount to a specific unix (or TCP for Windows, but btw Windows 10 has had unix sockets for almost 5 years now) socket. Then I can specify a fixed TF_REATTACH_PROVIDERS and pressing F5 in VSCode is all I need to make sure the provider is properly connected to the terraform CLI.
Some further thoughts:
TF_REATTACH_PROVIDERS currently includes a PID number to check if the process is still alive, and otherwise error. This is cheatable by simply specifying an always-live PID like 1, but perhaps a cleaner solution is in order if this becomes an official configuration.
You'll need to unlink() + recreate the Unix socket if the unix socket still exists on disk due to unclean shutdown, probably.
The text was updated successfully, but these errors were encountered:
This issue is mostly in the context of terraform but it seems the best way to tackle it is at the bottom of the stack, so I'm posting it here.
Right now, Terraform requires me to manually copy paste the
TF_REATTACH_PROVIDERS
environment configuration every time I start my provider in a debugger. This is really inconvenient. As far as I can tell there is currently no clean way around this, since Unix sockets are always assigned a random temp file, and I'd rather not have some hacky concoction of env vars and command aliases to prefix me runningterraform
with something to load the provider config automatically.It seems to me like the best solution is some sort of env var to force the plugin system to mount to a specific unix (or TCP for Windows, but btw Windows 10 has had unix sockets for almost 5 years now) socket. Then I can specify a fixed
TF_REATTACH_PROVIDERS
and pressing F5 in VSCode is all I need to make sure the provider is properly connected to the terraform CLI.Some further thoughts:
TF_REATTACH_PROVIDERS
currently includes a PID number to check if the process is still alive, and otherwise error. This is cheatable by simply specifying an always-live PID like 1, but perhaps a cleaner solution is in order if this becomes an official configuration.The text was updated successfully, but these errors were encountered: