Skip to content
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

vcpkg deactivate does not unset environment variables #36025

Closed
Zitrax opened this issue Jan 4, 2024 · 3 comments · Fixed by microsoft/vcpkg-tool#1499 or #41271
Closed

vcpkg deactivate does not unset environment variables #36025

Zitrax opened this issue Jan 4, 2024 · 3 comments · Fixed by microsoft/vcpkg-tool#1499 or #41271
Assignees
Labels
category:vcpkg-ce The issue is with vcpkg artifacts, which is something the vcpkg artifacts should already support requires:tool-release An issue that has been fixed in the microsoft/vcpkg-tool repo and is waiting for a release thereof

Comments

@Zitrax
Copy link

Zitrax commented Jan 4, 2024

Describe the bug

In my registry I have this:

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

Environment

  • OS: WSL on Windows 11 which reports: Ubuntu 22.04.2 LTS
  • vcpkg version: vcpkg package management program version 2023-12-12-1c9ec1978a6b0c2b39c9e9554a96e3e275f7556e

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.

@Cheney-W Cheney-W added the category:vcpkg-ce The issue is with vcpkg artifacts, which is something the vcpkg artifacts should already support label Jan 5, 2024
Copy link

github-actions bot commented Jul 9, 2024

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.

@github-actions github-actions bot added the Stale label Jul 9, 2024
@Cheney-W
Copy link
Contributor

Cheney-W commented Jul 9, 2024

Still present.

@github-actions github-actions bot removed the Stale label Jul 10, 2024
BillyONeal added a commit to BillyONeal/vcpkg-tool that referenced this issue Sep 25, 2024
@BillyONeal BillyONeal reopened this Sep 30, 2024
@BillyONeal BillyONeal added the requires:tool-release An issue that has been fixed in the microsoft/vcpkg-tool repo and is waiting for a release thereof label Sep 30, 2024
@Zitrax
Copy link
Author

Zitrax commented Oct 6, 2024

Thanks!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
category:vcpkg-ce The issue is with vcpkg artifacts, which is something the vcpkg artifacts should already support requires:tool-release An issue that has been fixed in the microsoft/vcpkg-tool repo and is waiting for a release thereof
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants