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

"Delete Cache and Reconfigure" not working properly #3515

Closed
424778940z opened this issue Dec 26, 2023 · 16 comments
Closed

"Delete Cache and Reconfigure" not working properly #3515

424778940z opened this issue Dec 26, 2023 · 16 comments
Assignees
Labels
bug a bug in the product
Milestone

Comments

@424778940z
Copy link

Brief Issue Summary

My use case is a bit odd, I'm swaping between few computers for work, and my project folder is synced by usb drive or network drive.

That means the abs path won't be same between computers. So when I try to build after move computer, cmake will complain some config issues caused by path chage, understandable.

However, when I select CMake: Delete Cache and Reconfigure, the cache is not fully cleared, cmake is still complaining something in CMakeCache.txt isn't right, unless I manually remove the build folder entirely.

Make things worse, sometime it seems vscode/cmake is holding build folder open so I cannot remove it within vscode, I have to close everything then remove the folder and open everything again.

Could we have an option to force remove build folder or make the ext clear cache properly?

CMake Tools Diagnostics

No response

Debug Log

No response

Additional Information

No response

@snehara99
Copy link
Contributor

Hi @424778940z, could you please provide us with a sample project that reproduces your issue? It would be much easier to investigate with it, thanks!

@snehara99 snehara99 added bug a bug in the product more info needed More info is needed from the community for us to properly triage and investigate. and removed triage labels Jan 2, 2024
@snehara99 snehara99 moved this from Triage Needed to More Information Needed in CMake Tools Jan 2, 2024
@424778940z
Copy link
Author

424778940z commented Jan 2, 2024

Hi @424778940z, could you please provide us with a sample project that reproduces your issue? It would be much easier to investigate with it, thanks!

nothing complex, it's not about the project, it's caused by system / source pathchange
even a simple hello world should be able to reproduce the issue

  1. create a simple hello world cmake project
  2. compile on current computer with whatever version of gcc (or other compilers)
  3. copy the whole folder to another computer's different path
  4. build again
  5. you get the error from cmake (which is totally fine)
  6. clear cache in vscode
  7. build again
  8. you still get the error from cmake (which is not fine...)

@snehara99 snehara99 removed the more info needed More info is needed from the community for us to properly triage and investigate. label Jan 12, 2024
@snehara99 snehara99 moved this from More Information Needed to Pending Prioritization in CMake Tools Jan 12, 2024
@snehara99
Copy link
Contributor

@424778940z Thank you for the detailed repro steps. We'll investigate the issue as soon as we have enough capacity.

@snehara99 snehara99 moved this from Pending Prioritization to Repro Needed in CMake Tools Jan 12, 2024
@gcampbell-msft gcampbell-msft added this to the 1.18 milestone Jan 30, 2024
@qarni
Copy link
Contributor

qarni commented Feb 29, 2024

@424778940z Two members from our team attempted the repro and it didn't reproduce. If there is any other information you could provide that might help us reproduce, that would be great, otherwise, we will close the issue.

@gcampbell-msft
Copy link
Collaborator

@424778940z Could you confirm whether this is still reproducing? Specifically on the most recent pre-release CMake Tools version? Thank you!

@424778940z
Copy link
Author

424778940z commented Mar 27, 2024

image
Here is an example, which is my tiny C playground for some quick testing, which the cmakelist.txt only few lines, and a single source code
It was built at C:/_projects/_playgrounds/c_std_pg, then I copy the whole c_std_pg folder to d:/c_std_pg, then cmake will complain about the location change, which is fine, but the "Clean" or "Clean and rebuild" from Cmaketools won't work because cmake refuse to work due to location change

hummm, seems the CMake: Delete Cache and Reconfigure is working now, before it was like the cache is not fully removed, somehow the cmakecache.txt still had the old information
I will test on my Linux machine tomorrow see if that works too...

@424778940z
Copy link
Author

Confirmed it is working under linux. We could close the issue now

@github-project-automation github-project-automation bot moved this from Repro Needed to Completed in CMake Tools Mar 27, 2024
@424778940z
Copy link
Author

unfortunately, I have to open this issue again, it seems the CMake: Delete Cache and Reconfigure is only removing following two files, but in some cases, this is NOT enough, as there are many things in the build folder.
I can't give you the whole project to repurduce the issue, but could you just give an option to let CMake: Delete Cache and Reconfigure nuke the whole build folder instead of removing those two files?

[driver] Removing /home/user/Desktop/firmware/.build/CMakeCache.txt
[driver] Removing /home/user/Desktop/firmware/.build/CMakeFiles

@424778940z 424778940z reopened this Apr 25, 2024
@v-ericawu v-ericawu added enhancement an enhancement to the product that is either not present or an improvement to an existing feature and removed triage labels Apr 29, 2024
@v-ericawu
Copy link
Collaborator

@424778940z @gcampbell-msft Thanks for your feedback, we can reproduce the problem using the following environment and steps and we will continue to follow the issue:

ENV:

  • OS: Win10 22H2
  • VS Code version: 1.88.1
  • CMake Tools extension: 1.18.31(pre-release)

Repro Steps:

  1. Download and unzip Test project.
  2. Open Test project with VS Code.
  3. Press F1 and run command 'CMake: Delete Cache and Reconfigure'.

Expected Result: Provide an option to delete the entire build folder, not just the two files.

Actual Result: Only CMakeCache.txt/CMakeFiles have been removed.
Before running the 'CMake: Delete Cache and Reconfigure' command:
image

After running the 'CMake: Delete Cache and Reconfigure' command:
[driver] Removing c:/Users/v-ericawu/Desktop/Test/build/CMakeCache.txt
[driver] Removing c:\Users\v-ericawu\Desktop\Test\build\CMakeFiles
image

@gcampbell-msft gcampbell-msft modified the milestones: 1.18, 1.19 Jun 6, 2024
@gcampbell-msft gcampbell-msft added fixed (release pending) and removed enhancement an enhancement to the product that is either not present or an improvement to an existing feature labels Jun 26, 2024
@Ashley-Li
Copy link
Collaborator

Ashley-Li commented Jul 9, 2024

Verified on CMake Tools v1.18.43(release), this issue still repro: only CMakeCache.txt/CMakeFiles have been removed.
image

@gcampbell-msft
Copy link
Collaborator

@Ashley-Li Did you turn on the setting that was added?

@Ashley-Li
Copy link
Collaborator

@gcampbell-msft Thank you for your guidance. After setting cmake.deleteBuildDirOnCleanConfigure is true, this issue has fixed. Now deleted the entire build folder, not just the two files.
image

@424778940z
Copy link
Author

could we have a checkbox for this option in settings menu?

@Ashley-Li
Copy link
Collaborator

could we have a checkbox for this option in settings menu?

Hi @424778940z Please press "Ctrl+," to open setting page, then search keywords and find "Cmake:Delete Build Dir On Clean Configure" and switch to Workspace, then select the checkbox to enable. Please see below:
image

@starball5
Copy link

I wonder if this could have been worked around by using the CMake Tools command to do a clean rebuild?

@424778940z
Copy link
Author

no cmake only cleans what built directly by it, any by product won't be deleted by clean unless you specifically config it to

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
Projects
Status: Completed
Development

No branches or pull requests

8 participants