-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Ripgrep not working in OneDrive folders using Files On Demand #705
Comments
I'm on mobile and headed to bed at the moment, but the first thing that
springs to mind is memory maps. If you run rg with --no-mmap (--mmap does
the opposite) then it will avoid using memory maps and instead use standard
file APIs. Linux, for example, has an issue where virtual files can't be
memory mapped. ripgrep detects this by looking at file size. If the size is
zero (which is what virtual files like /proc/cpuinfo report), then it
forcefully disables use of memory maps and everything works.
If memory maps are indeed the problem, and if there is a way to tell that
memory maps won't work with a stat call or similar then we can change
ripgrep's heuristics on Windows.
If this isn't the problem, then I personally would probably try to
reproduce the problem using a minimal Rust program, and then start
diagnosing from there. If it comes to that, how easy would it be for me to
reproduce the bug on my own Windows machine?
…On Dec 3, 2017 9:58 PM, "Rob Lourens" ***@***.***> wrote:
Ref: microsoft/vscode#35433
<microsoft/vscode#35433>
Files On Demand is a new OneDrive feature that only downloads files to the
local disk when needed. It has caused some issues in Node/Electron land -
nodejs/node#12737 <nodejs/node#12737>,
microsoft/vscode#27285 <microsoft/vscode#27285>.
When running ripgrep in a folder with this feature enabled, I just get Access
is denied. (os error 5) immediately. Running with --debug doesn't produce
any clues. I will investigate if you can point me in the right place to
start looking?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#705>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAb34oBLIpawThhCJmvauqV1SEgWmK2Uks5s81_BgaJpZM4Q0C1B>
.
|
I get the same error with Repro steps are basically
|
Thanks! cc @retep998 Do you have any insight on this with respect to std? |
Filed rust-lang/rust#46484 |
Since there isn't much progress on the upstream issue, I'm trying to work around it in the ripgrep build for vscode. Would you be interested in a PR? The workaround is fairly simple, just need to check the |
@roblourens Sorry for the late response, but yes, I would definitely be interested in a patch to ripgrep proper. If I had more Windows expertise, then I'd be happy to push this through upstream too, but I just don't have the bandwidth at the moment, so I'm happy to work around it. |
@roblourens I am working on a fix to this in |
Awesome! Sorry I never delivered on my drive-by PR offer, it's been on my list but I was too busy in January. |
@roblourens No worries! The Windows side of things is pretty straight-forward, but fixing the code itself is a little gnarly! |
This commit fixes a bug on Windows where walkdir refused to traverse directories that resided on OneDrive via its "file on demand" strategy. The specific bug is that Rust's standard library treats a reparse point (which is what OneDrive uses) as distinct from a file or directory, which wreaks havoc on any code that uses FileType::{is_file, is_dir}. We fix this by checking the directory status of a file by looking only at whether its directory bit is set. This bug was originally reported in ripgrep: BurntSushi/ripgrep#705 It has also been filed upstream: rust-lang/rust#46484 And has a pending fix: rust-lang/rust#47956
Got it! I manually tested the fix. I can search directories on OneDrive using ripgrep master. |
This works great. Thanks! Will update in vscode ASAP. |
This commit fixes a performance regression in Windows that resulted from fallout from fixing #705. In particular, we introduced an additional stat call for every single directory entry, which can be quite disastrous for performance. There is a corresponding companion PR that fixes the same bug in walkdir: BurntSushi/walkdir#96 Fixes #820
This commit fixes a performance regression in Windows that resulted from fallout from fixing #705. In particular, we introduced an additional stat call for every single directory entry, which can be quite disastrous for performance. There is a corresponding companion PR that fixes the same bug in walkdir: BurntSushi/walkdir#96 Fixes #820
This commit undoes a work-around for a bug in Rust's standard library that prevented correct file type detection on Windows in OneDrive directories. We remove the work-around because we are moving to a latest-stable Rust version policy, which has included this fix for a while now. ref #705, rust-lang/rust#46484
This commit undoes a work-around for a bug in Rust's standard library that prevented correct file type detection on Windows in OneDrive directories. We remove the work-around because we are moving to a latest-stable Rust version policy, which has included this fix for a while now. ref #705, rust-lang/rust#46484
Ref: microsoft/vscode#35433
Files On Demand is a new OneDrive feature that only downloads files to the local disk when needed. It has caused some issues in Node/Electron land - nodejs/node#12737, microsoft/vscode#27285.
When running ripgrep in a folder with this feature enabled, I just get
Access is denied. (os error 5)
immediately. Running with--debug
doesn't produce any clues. I will investigate if you can point me in the right place to start looking?The text was updated successfully, but these errors were encountered: