microsoft / vcpkg

C++ Library Manager for Windows, Linux, and MacOS
MIT License
22.86k stars 6.31k forks source link

vcpkg deactivate does not unset environment variables #36025

Open Zitrax opened 8 months ago

Zitrax commented 8 months ago

Describe the bug

In my registry I have this:

"windows,linux": {
  "message": "Updated environment variable MYVAR",
  "exports": {
    "paths": {
      "MYVAR": ""
    }
  }
}

Environment

To Reproduce Steps to reproduce the behavior:

  1. vcpkg activate
  2. echo $MYVAR
  3. vcpkg deactivate
  4. echo $MYVAR

Expected behavior

After deactivation MYVAR should no longer be set but it is.

Notice that I only see this on WSL, not under Windows. (I have not tested non-WSL linux)

Failure logs

If I run vcpkg deactivate --debug I see this on WSL:

debug: [00:00.160] --------[START SHELL SCRIPT FILE]--------
unset M
unset Z

--------[END SHELL SCRIPT FILE]---------

but on Windows I see:

debug: [00:00.116] --------[START SHELL SCRIPT FILE]--------
${ENV:MYVAR}=$null
${ENV:Z_VCPKG_UNDO}=$null

--------[END SHELL SCRIPT FILE]---------

So for some reason it tries to unset env variables with the first letter only.

github-actions[bot] commented 2 months ago

This is an automated message. Per our repo policy, stale issues get closed if there has been no activity in the past 180 days. The issue will be automatically closed in 14 days. If you wish to keep this issue open, please add a new comment.

Cheney-W commented 2 months ago

Still present.