-
Notifications
You must be signed in to change notification settings - Fork 429
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
Environment of sourcing '.bashrc' is not working sometimes in cmake-tools on Linux #3705
Comments
@hwhsu1231 To confirm, there is no way to repro this on the command-line? It seems like if the issue is related to the |
@hwhsu1231 However, it could have to do with our interpretation of the PATH variable while parsing the presets. I see you are using the pre-release version (THANK YOU!), does this also happen on the official release version (1.17.17). Thanks. Also, if possible, please provide your repro project, if it has anything to do with presets interpretation, we will need that in order to investigate. |
Hello, @gcampbell-msft
That is correct. I haven't reproduced this on the command-line currently, and it only happened to CMake Tools.
I already provided the repro/demo project, demo-cmake-tools-bashrc, at the first comment. And it's already published to GitHub, so you can clone it to investigate. |
Yes. It does. I switched to 1.17.17, and rebooted after this phenomenon finally happened. As we can see, rebooting can definitely solve this issue. |
@hwhsu1231 @gcampbell-msft, thanks for providing the demo project. Today we verified this issue with below environment and
Repro steps: |
Hello, @Evelyn-001
There's something you indeed misunderstand. It seems that the Node.js you installed is through /usr/bin/node But the Node.js I installed in the demo is through nvm. Therefore, the output of /home/hwhsu1231/.nvm/versions/node/v20.12.1/bin/node If you install Node.js through nvm successfully, you should see the following contents in your export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion And that is why |
@hwhsu1231 @gcampbell-msft, thanks for your reply. Today we installed Node.js using the method you mentioned in abopve comment, but we still didn't repro this issue with below steps: System info: Ubuntu 22.04.4 LTS VS code version: 1.88.1 CMake Extension version: v 1.17.17& v 1.88.29 pre-release Install Node using the method the customer mentioned. Repro steps: |
Hello, @Evelyn-001 Can you please try a few more times to see what happens? This issue occurs sporadically, so I can't precisely pinpoint how to reproduce it. Note: In fact, the phenomenon occurred again while I was writing this response. However, this time, closing all windows and restarting VSCode resolved the issue. I suspect that the "software update" may be the cause. For example: |
@hwhsu1231 @gcampbell-msft, thanks for your reply. Sorry we tried to reproduce this issue many times but still don't reproduce it. Could you please install VS code on another clean machine or reinstall VS Code to verify this issue again? Thanks a lot. |
Hello, @Evelyn-001 Besides
BTW, my VSCode is installed by Snap. Here are some information about it: hwhsu1231@vb-kubuntu:~$ snap list code
Name Version Rev Tracking Publisher Notes
code e170252f 157 latest/stable vscode✓ classic
hwhsu1231@vb-kubuntu:~$ snap info code
name: code
summary: Code editing. Redefined.
publisher: Visual Studio Code (vscode✓)
store-url: https://snapcraft.io/code
contact: https://twitter.com/code
license: unset
description: |
Visual Studio Code is a new choice of tool that combines the
simplicity of a code editor with what developers need for the core
edit-build-debug cycle.
commands:
- code
- code.url-handler
snap-id: Ht0aUHi7ofh9Fbwh6m7jUN2pAy6kzBiu
tracking: latest/stable
refresh-date: 5 days ago, at 13:51 CST
channels:
latest/stable: e170252f 2024-04-11 (157) 326MB classic
latest/candidate: ↑
latest/beta: ↑
latest/edge: ↑
installed: e170252f (157) 326MB classic
hwhsu1231@vb-kubuntu:~$ |
@gcampbell-msft, we still don't repro this issue on our environment. what other useful information can customer provide for investigation (when the issue occurs)?" Thanks in advance. |
@hwhsu1231 @Evelyn-001 Unfortunately this seems to be a difficult problem to reproduce in general. Either way, from all of your screenshots, this seems to be an issue of opening VS Code with the right environment, not so much a bug with CMake Tools. When this problem reproduces, are you able to, on the terminal command-line, ignoring the CMake Tools extension, print out the environment variable and see what the values are normally vs in the repro? |
@gcampbell-msft Sure. But I have some questions to ask:
|
Thanks! |
To print the output of the hwhsu1231-demo/demo-cmake-tools-bashrc@e9cfc13 However, I don't think this issue is related to VSCode (Maybe I'm wrong~). It's because when I first tried to test if there was a problem, I actually conducted the test on VSCode's "Integrated Terminal". The results, as I posted in my 1st comment, were successful in identifying those third-party tools. BTW, as I write this comment, the issue has finally reoccurred. Below are the log outputs and screenshots from my tests. This time, I tested three scenarios:
The results show that only the output from the CMake Tools extensions failed to find those third-party tools. LOG-20240502-cmt-extension.txt |
The following is the debug log printed in Click to expand the debug log
But unfortunately, this reopenning didn't fix the issue. The following is the debug log of the subsequent Click to expand the debug log
Is this information helpful? |
Hello, @gcampbell-msft and CMake Tools Team. Can you try install the snap version of CMake: sudo snap install cmake --classic and then run the follwoing command to create a symbolic link: sudo ln -s /snap/cmake/current/bin/cmake /usr/bin/cmake and try again to see whether the phenomenon happens? This is the way I fix the snap of cmake issue of cmake-tools #838 (comment). Maybe it's related to this issue. |
@hwhsu1231, thanks for your reply. the snap version of CMake we have always installed. And we run the above command to create a symbolic link, but we still don't repro this issue, please see the below screenshots. Thanks. |
Brief Issue Summary
Recently, I tried to use
find_program
to find some 3rd-party tools installed on my Kubuntu 22.04 system. For example:However, I found that sometimes cmake-tools cannot find those tools due to the incorrect value of
$PATH
.Click to expand the full log
As we can see, those tools cannot be found by
find_program()
due to theENV{PATH}
.But it is working when I configuring the cmake project directly on the command-line:
Click to expand the full log
I can't tell how to reproduce this phenomenon exactly because it just happened randomly. (At least, I haven't found the step yet.)
After testing several times, I can be certain of the following points:
.bashrc
since the environments of those 3rd-party tools are configured by.bashrc
.You can see the demo project here: demo-cmake-tools-bashrc
CMake Tools Diagnostics
Debug Log
Additional Information
my-bashrc-and-profile.zip
The text was updated successfully, but these errors were encountered: