-
Notifications
You must be signed in to change notification settings - Fork 140
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
170 - Windows Slash Tests #208
Conversation
Blocked by #206 |
Closes #170 |
I think this problem is only reproducible when using things like git-bash on Windows. There's some more info on it here BurntSushi/ripgrep#1973 (comment) I'm not sure how, but other programs like |
I don't have a Windows machine, so I can't reproduce locally. Is the objective to discover whatever Windows git bash is doing to forward slashes in arguments and/or stdin and introduce a flag to undo that behavior? I'm curious as to what git bash is doing, and I have no idea why |
I've got access to a Windows machine, so I'll start digging in deeper to try and get things sorted out more |
Hey @CosmicHorrorDev , did you get a chance to reproduce in Windows? IMO if this isn't easily reproducible, it might not be worth holding up the release, as it would be addressing an issue before stdin even makes it to the binary. I selfishly want the release to happen soon so I can stop using my fork to distribute ARM builds, but understand if you want to take your time resolving these issues. |
Haven't had time to setup a Windows env for reproducing I agree this issue shouldn't hold up the next release. I'll be working on the final touches for preparing the release over this upcoming weekend |
Got to use my Windows machine to test this, both gnu and msvc targets are tested, on both powershell and git-bash. Strangely, this specific test didn't go wrong in either target, but Update: that test failed to create a soft link because of "Error: A required privilege is not held by the client. (os error 1314)", even though the tempdir it created is perfectly under my user's own place. |
I wrote a simple test program: #include <stdio.h>
int main(int argc, char** argv) {
for(int i = 0; i < argc; i++) {
printf("%d\t%s\n", i, argv[i]);
}
return 0;
} Compiled it with Ran it under powershell and git-bash. Voilà:
IDK if it's git-bash or mingw64, but it apparently lies in the translation layer of one of them. |
It's mingw64 - or msys2, since this is documented by the latter, not the former - that does this "automagic path translation":
Our case is, of course, covered. |
@CosmicHorrorDev would adding a recommendation that the environment variable |
(It's This works, but doesn't look nice. You certainly don't want to prefix with it every time running sd or something else. Do we advice the user to alias it? Globally export? Or we ship a wrapper that adds it? |
(I'll be able to get to this next week) |
Finally got a dev environment setup on windows
I can also reproduce this issue. Not sure what the underlying issue is, but I didn't do any digging
My current plan is to allow for specifying custom path separators through a I'm currently working on adding support for custom path separators by looking through how |
ripgrep and fd have file paths in their output, so that option makes sense. Other than that, I also don't think it's a good idea to use an output modifier to change "input" behavior, but it's just a gut feeling. Update: --preview does print file names, which I overlooked. Meanwhile I'm getting somewhere with diffs - PR for later. |
@CosmicHorrorDev , would providing the ability to adjust the path-separator really be the best solution here? The issue in the example referenced in #170 isn't that they were using a Windows path separator of I think the |
I was mistaken about the utility behind a custom path separator. I agree with you 👍 |
Appreciate the discussion here and definitely agree as well with recommending the env var approach. I have always believed in adding config options as an absolute last resort, which might seem a bit unusual but leads to better experience for both the users and the developers in the long term |
This should confirm that windows builds handle slashes appropriately.