microsoft / vscode-makefile-tools

MAKE integration in Visual Studio Code
Other
184 stars 55 forks source link

'env' option of 'terminal.integrated.automationProfile' not working #493

Open kyeason opened 11 months ago

kyeason commented 11 months ago

Makefile-tools version: 0.7.0 Part of settings.json:

"terminal.integrated.automationProfile.windows": {
    "path": "cmd",
    "env": {
        "PATH": "${env:PATH};{Path of My Own}",
    }
}

When I run build, I found the env option is not working. But it's ok with custom tasks in tasks.json Then I try to modify make.js as below:

Before:

// make.js, line: 308
let myTaskOptions = { env: util.mergeEnvironment(process.env), cwd };

After:

// make.js, line: 308
let myTaskOptions = { cwd };

The build process works well !

Would you please help fixing this problem?

gcampbell-msft commented 11 months ago

@kyeason Do you find that when you make the aforementioned change in make.js, the build simply succeeds? Or that it actually made the updated PATH changes you requested in settings.json?

Based on your suggested fix, it seems like we wouldn't be passing through any updated PATH.

To clarify, what are the exact scenarios that aren't working? When you run build, the env option isn't being used? When you run it with tasks, it does work?

I want to make sure I fully understand the issue so that I can investigate. Thanks!

kyeason commented 10 months ago

@gcampbell-msft After the modification, It's using the VSCode env settings, so that the make process succeeds.

When you run build, the env option isn't being used?

NO. The env option in the origin make.js seems using the vscode process env, but not the settings in settings.json or any user profile's settings.json

When you run it with tasks, it does work?

YES.

I have multiple profiles, and each with a different env option. I can easily switch between different environment when needed:

image

Thanks for reply!

gcampbell-msft commented 10 months ago

@kyeason Ah, I see, so the issue is that we're trying to do some modifications for the environment without taking the settings.json into account. Got it.

I'll mark this as a bug and put it on our backlog so that we can track it and work to prioritize it for a specific release and milestone.

gcampbell-msft commented 7 months ago

@kyeason FYI. I am modifying this issue to an enhancement request. This is because we don't currently support this field for our builds and things where we control the invocation, but it will be supported in things like tasks.