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

cmake.cacheInit does not respect absolute paths in environment variables #2777

Closed
Atry opened this issue Oct 7, 2022 · 3 comments · Fixed by #3749
Closed

cmake.cacheInit does not respect absolute paths in environment variables #2777

Atry opened this issue Oct 7, 2022 · 3 comments · Fixed by #3749
Labels
bug a bug in the product Feature: configure investigation needed issues needs a developer assigned to it and investigation done in order to implement a fix quick fix the fix is estimated to be quick suggested Temporary label for internal tracking for suggested bugs to pick up in spare time.
Milestone

Comments

@Atry
Copy link

Atry commented Oct 7, 2022

Brief Issue Summary

Reproducing steps

  1. Set environment variable CMAKE_INIT_CACHE to an absolute path, e.g. /tmp/my-init-cache.cmake
  2. Add the following setting in settings.json
    "cmake.cacheInit": "${env:CMAKE_INIT_CACHE}"
  3. Click "Configure All Projects" button

I expect the file /tmp/my-init-cache.cmake will be used to initialize CMake cache. Unfortunately the following command is invoked:

cmake ... -C /home/my-user/my-workspace//tmp/my-init-cache.cmake ...

CMake Tools Diagnostics

No response

Debug Log

No response

Additional Information

No response

@Atry Atry changed the title cmake.cacheInit does not support absolute paths in environment variables cmake.cacheInit does not respect absolute paths in environment variables Oct 7, 2022
@elahehrashedi
Copy link
Contributor

elahehrashedi commented Oct 7, 2022

it looks like we are not expanding the path before we test if it is an absolute path.

Can you try using this setting and see if it works:
"cmake.cacheInit": "/tmp/my-init-cache.cmake"

@elahehrashedi elahehrashedi added bug a bug in the product Feature: configure labels Oct 7, 2022
@bobbrow bobbrow added the quick fix the fix is estimated to be quick label Oct 7, 2022
@bobbrow bobbrow added this to the On Deck milestone Oct 7, 2022
@Atry
Copy link
Author

Atry commented Oct 7, 2022

The following setting works:

"cmake.cacheInit": "/tmp/my-init-cache.cmake"

@Atry
Copy link
Author

Atry commented Oct 7, 2022

Workaround:

"cmake.cacheInit": "/${env:CMAKE_INIT_CACHE}"

then the following command will be executed:

cmake ... -C //tmp/my-init-cache.cmake ...

@gcampbell-msft gcampbell-msft modified the milestones: On Deck, 1.16 Jul 5, 2023
@gcampbell-msft gcampbell-msft added the investigation needed issues needs a developer assigned to it and investigation done in order to implement a fix label Oct 4, 2023
@benmcmorran benmcmorran modified the milestones: 1.16, 1.17 Nov 14, 2023
@github-project-automation github-project-automation bot moved this to Triage Needed in CMake Tools 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 modified the milestones: 1.17, On Deck Nov 29, 2023
@gcampbell-msft gcampbell-msft added the suggested Temporary label for internal tracking for suggested bugs to pick up in spare time. label Apr 24, 2024
@github-project-automation github-project-automation bot moved this from Pending Prioritization to Completed in CMake Tools May 10, 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 Feature: configure investigation needed issues needs a developer assigned to it and investigation done in order to implement a fix quick fix the fix is estimated to be quick suggested Temporary label for internal tracking for suggested bugs to pick up in spare time.
Projects
Status: Completed
Development

Successfully merging a pull request may close this issue.

5 participants