-
Notifications
You must be signed in to change notification settings - Fork 29.3k
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
VSCode prevents moving any git directory under the working directory on Windows #104251
Comments
Did anyone tried to reproduce this? It's becoming problematic for me... |
@bpasero Could this be related to file watching? |
@Klaim Is this maybe about moving things which contain folders which start with a dot |
Hm, not sure, if that was the case people could not delete folders in VSCode since we install a recursive watcher. |
I believe it is, though I think it's specific to git support because...
...I did try with several kinds of directories and the only case was if it was a real git repository. If you create a
What's super weird is that it only impacts moving, not deleting or anything else. |
What about the following error?
|
That's what initially suggested me to try with The If the That's what made me realized that it was related to git: I tried to completely remove And it will fail for any directory that contains a git repository, recursively, and that you try to move. BTW, my repro is super simple and quick to reproduce. Do you manage to reproduce the issue on your side? I have it on all my windows (3 different machines). I had it for years actually but didn't do enough research to figure out a very small repro at the time. |
Got it, I was able to repro. This is due to the watching mechanism in: vscode/extensions/git/src/repository.ts Line 514 in 1ab3137
Unfortunately this is an issue with the Windows NTFS file system and is unlikely to change until we adopt a different file watching mechanism or our API supports arbitrary watching: #3025 Will have to close it as designed/duplicate for now. Sorry about that! |
Context
Version: 1.48.0-insider (user setup)
Commit: 2277c8e
Date: 2020-08-07T11:32:09.993Z
Electron: 7.3.2
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Windows_NT x64 10.0.17134
NOTE: This issue have been there for a long time, in years, but I only figured the root now.
It prevents some usage patterns when using
build2
becausebuild2
's package manager can retrieve packages fromgit
repositories, in which case it will attempt to move them.This issue seems related to #71221 which is currently wrongly closed as it also affects other situations like #71340 and probably other interracting tools.
I have been seeing this issue on 2 other Windows 10 computers, with different hardware and various VSCode, git and build2 versions
Steps to Reproduce
BEWARE: do NOT attempt to reproduce these steps through an executable script (either
.sh
or.bat
), as the result might succeed. (yeah, I know, weird!). See below for an example.cmd
,powershell
andgit-bash
. If usinggit-bash
, usemv
instead ofmove
in the following commnands.move xxx yyy
(ormv xxx yyy
withgit-bash
)This is where the issue happens.
Observed
Step 4 triggers an error:
cmd
:Powershell:
git-bash
:Step 5 (closing VSCode and retrying step 4) Will succeed.
cmd
:powershell
:git-bash
Expected
mv
andmove
should never fail when VSCode is open in the directory.Additional Information
Assuming VSCode is open in the directory, if I create a file
repro.sh
with :Then run it using
git-bash
:No problem. Same if I rename
repro.sh
torepro.bat
and replacemv
bymove
then I run it incmd
.For some reason (race/speed? rights?) running these commands via a script works.
How to see that issue affecting
build2
build2
: https://build2.org/install.xhtmlbdep new repro
- this will create a complete hello-world executable project in therepro/
directory.repro/manifest
uncomment this line:depends: libhello ^1.0.0
(remove the#
)repro/repositories.manifest
uncomment (remove the#
) this block:This will first create a (build) configuration in the specified directory, then configure the current project(s) in that configuration. Part of the process is acquisition of the dependencies, so it will clone the repository whrere
libhello
will be found, and attempt to move the fetched git repository and will fail if VSCode can see the configuration directory.(use
-V
to see the specific commands invoked bybuild2
)Note that we attempted to retry the move several times in a row without success, even when retrying for 10 minutes.
Why is this important for
build2
usersWhen working on C++ projects with
build2
, I like to use VSCode as it's "intellisense" will take into account all the files accessible in the working directory. When my project use dependencies, I like VSCode to be aware of the code from these dependencies.With that issue, I cannot have the configuration directory open by VSCode, which means that VSCode is not aware of that directory's content which is mostly the code of the dependencies of my project and the generated code from them and my project.
If that issue was not there, I could use VSCode on all platforms the same way, no biggie. Currently on Windows I have to open only the source directory of my project and never their dependencies. VSCode therefore by default will mark errors of names it cannot find until I manually open source directories from the configuration.
The configuration content can change through working on the project, so this is very far from ideal.
Does this issue occur when all extensions are disabled?: Yes
The text was updated successfully, but these errors were encountered: