-
Notifications
You must be signed in to change notification settings - Fork 30.7k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Python debugging fails to unpack env variables in launch args #77119
Comments
Note: This is not an extension issue, we're sending the right information to the Debug Adapter. |
For reference, I created #77050 but was refused. |
Any luck on this? @DonJayamanne, since you confirmed this is not python extension issue do you have any workaround? |
Sorry, but I don't understand the intended behavior of the launch config from above. In the launch config from above the "env" section defines "FW_PACKAGE" and "FW_TEST" but then later "LIMP_PACKAGE" and "LIMP_TEST" is used. How are they related? In addition please note: the "env" section is passed to the debug extension which sets the environment for the target program. The "env" section does not affect the VS Code environment variables and the variables defined in the "env" section are not available for "${env:ENV_NAME}" variable substitution in the launch config. |
@weinand, you are right I wrongly copied two different versions of the launch config when I was reporting this bug, but this mistake doesn't invalidate the report. Also there seems a confusion here. Let me try to clear it with few points:
Point 4 is what made me sure this was a bug when I first report it, because whether I'm using |
The "env" attribute is implemented by the Python extension. Since VS Code does know what "env" is, it does not interpret "env" in any way (and it does not change any environment variables because of it). The Python extension sees the "env" attribute, knows its semantic and can do something with it. But whatever the Python extension does with "env" it can not influence VS Code directly. And since VS Code performs the variable substitution before the Python extension sees "env", the variable substitution can not be affected by "env" directly. Another confusing thing from the initial bug report is the statement:
I do not really understand what this means, but please note that VS Code's variable substitution takes place before anything is passed to the terminal for execution. So when setting an env var in the terminal the "${env:LIMP_PACKAGE}" has been already processed by VS Code (and it will not be processed again). |
Closing since this works as designed: VS Code's variable substitution is done before the command line is executed in a command prompt/terminal. As a consequence variable substitution cannot take into account anything that is the result of running a command in the command prompt/terminal. |
@weinand, this makes sense now. Is this something Python extension team can manipulate or that this sequence can never be updated by an extension? IOW is this an extension bug that they are not timing |
@AjawadMahmoud this is neither a bug of an extension nor of VS Code. It is just a consequence of a design decision that we made for variable substitution in launch configs. |
@AjawadMahmoud commented on Wed Jul 10 2019
Issue Type: Bug
Using the following
launch.js
config:I get in terminal:
As it's seen in the terminal debug command, it's failing to unpack both env variables although the command was prefixed with env variables setter. And to confirm the env variables are assigned I was able to print them in the terminal after the debug command failed, and I got the env variables with the respective values correctly.
VS Code version: Code 1.36.1 (2213894, 2019-07-08T22:59:35.033Z)
OS version: Windows_NT x64 10.0.18932
System Info
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: disabled_software
oop_rasterization: disabled_off
protected_video_decode: unavailable_off
rasterization: enabled
skia_deferred_display_list: disabled_off
skia_renderer: disabled_off
surface_synchronization: enabled_on
video_decode: enabled
viz_display_compositor: disabled_off
webgl: enabled
webgl2: enabled
Extensions (14)
(2 theme extensions excluded)
The text was updated successfully, but these errors were encountered: