run vcpkg install failed because of git fsmonitor--daemon
- Dominant language
- CMake
- Stars
- 27.5k
- Forks
- 7.7k
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 321
Description
**Describe the bug**
```
# vcpkg install
error: rename_or_delete("C:/Users/krysl/AppData/Local/vcpkg/registries/git-trees/c4ef98fd8710fdbedc145a628206d7dbb72e8c22_10736.tmp", "C:\Users\krysl\AppData\Local\vcpkg\registries\git-trees\c4ef98fd8710fdbedc145a628206d7dbb72e8c22"): 另一个程序正在使用此文件,进程无法访问。(translate -> The process cannot access the file because it is being used by another process)
note: while loading hwloc@2.10.0#1
```
**Environment**
- OS: Win10
**To Reproduce**
Steps to reproduce the behavior:
0. `git config --system core.fsmonitor true`
1. vcpkg install xxxx
2. See error
**Expected behavior**
no error
**Failure logs**
-(See above)
**Additional context**
I set a simple breakpoint at `Filesystem::rename_or_delete` and used `PowerToys/File Locksmith` to find that the process `git fsmonitor--daemon run --detach --ipc-threads=8` was occupying the folder.
So simply disabling git's fsmonitor feature (`git config --system core.fsmonitor false`) should solve the problem, but shouldn't vcpkg run quietly and normally, independent of git configuration?
On another note, I don't know why, but after accidentally adding `fsmonitor = false` to `%LocalAppData%\vcpkg\registries\git\.git\config` , the problem no longer occurred.
```
[core]
repositoryformatversion = 0
filemode = false
bare = false
logallrefupdates = true
ignorecase = true
fsmonitor = false <---- add this line
```
Contributor guide
Research direction
Reproduce with `git config --system core.fsmonitor true` and `vcpkg install`, then start at `Filesystem::rename_or_delete` while inspecting the git registry under `%LocalAppData%\vcpkg\registries\git`. Confirm the behavior with Git's `fsmonitor--daemon` enabled and define done as a successful install without requiring the user to disable fsmonitor.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- git
- Domain
- build-system, cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100