Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Environmental Variables in CMake Tools #3433

Closed
diehard2 opened this issue Nov 10, 2023 · 3 comments
Closed

Environmental Variables in CMake Tools #3433

diehard2 opened this issue Nov 10, 2023 · 3 comments
Labels
bug a bug in the product more info needed More info is needed from the community for us to properly triage and investigate.

Comments

@diehard2
Copy link

Brief Issue Summary

I've seen similar issues to this throughout the Issues board, but I can't seem to locate a workaround. I have a secret stored in an environmental variable

vcpkg_from_github(
    OUT_SOURCE_PATH SOURCE_PATH
    REPO Foo/foo-client-cpp
    GITHUB_HOST https://github.foo.com
    REF 1.1.9
    SHA512 097519485gqopegn936
    AUTHORIZATION_TOKEN $ENV{AUTH_TOKEN}  
)

I can build this from the command line, but I can't find any way to get my environmental variable to be picked up by the extension short of hardcoding the token in the settings file. Which obviously is not great since someone will eventually commit it. The behavior that would be nice is environmental variable expansion in settings.json,

 "cmake.environment": {
        "AUTH_TOKEN": "${env:AUTH_TOKEN}"
    },

but it looks like this hasn't gotten any traction in awhile. I'll pretty much take any workaround that makes this seamless. This seems like something that should work, so apologies if I'm just missing something easy.

CMake Tools Diagnostics

No response

Debug Log

No response

Additional Information

No response

@snehara99 snehara99 added investigation needed issues needs a developer assigned to it and investigation done in order to implement a fix and removed triage labels Nov 14, 2023
@snehara99
Copy link
Contributor

Hi @diehard2 thank you for your post. We'll investigate this issue as soon as we have the bandwidth and get back to you with a fix/workaround.

@github-project-automation github-project-automation bot moved this to Needs Triaging in CMake Tools Nov 21, 2023
@github-project-automation github-project-automation bot moved this to Triage Needed in CMake Tools Nov 29, 2023
@gcampbell-msft gcampbell-msft added the bug a bug in the product label Nov 29, 2023
@gcampbell-msft gcampbell-msft moved this from Triage Needed to Pending Prioritization in CMake Tools Nov 29, 2023
@gcampbell-msft gcampbell-msft added this to the On Deck milestone Nov 29, 2023
@gcampbell-msft gcampbell-msft modified the milestones: On Deck, 1.18 Feb 16, 2024
@gcampbell-msft
Copy link
Collaborator

@diehard2 Could you tell us some more information about your repro project?

Are you using kits or CMake Presets?
I've just ran a small test where I updated my CMakeLists.txt to output a variable from the environment, and I was able to confirm that when configuring with the extension, it picks up this value. Therefore, I'm not able to reproduce your issue and I believe we support what you're asking for.

Also, I tested and confirmed that we do support the macro expansion that you were attempting in cmake.environment. Therefore, can you please make sure the extension is updated to the most recent versions and confirm that this works for you?

@gcampbell-msft gcampbell-msft added more info needed More info is needed from the community for us to properly triage and investigate. and removed investigation needed issues needs a developer assigned to it and investigation done in order to implement a fix labels Mar 1, 2024
@gcampbell-msft gcampbell-msft moved this from Pending Prioritization to More Information Needed in CMake Tools Mar 1, 2024
@gcampbell-msft
Copy link
Collaborator

@diehard2

Closing this issue since we haven't gotten any feedback, and I believe this issue has been resolved through other changes.

Please create a new issue if you are still running into this issue.

@github-project-automation github-project-automation bot moved this from More Information Needed to Completed in CMake Tools Mar 27, 2024
@gcampbell-msft gcampbell-msft removed this from the 1.18 milestone Mar 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug a bug in the product more info needed More info is needed from the community for us to properly triage and investigate.
Projects
Status: Completed
Development

No branches or pull requests

3 participants