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
Switch is_directory to exists in assertPathExists #47
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initial testing with Skyrim SE seems fine. Tested the game, SKSE, SkyUI, CBBE, Bodyslide, FNIS, xEdit, and Wrye Bash.
I can't test this right now, but what happens if you do |
I can't test that myself either since I don't actually own a copy of the game and the test cases in this repository seem to be broken, but I could loop in the friend I developed this patch with. My first attempt was changing the If the scenario @isanae propose turns out to be troublesome, we could try and adjust the code to either use the Win32 APIs directly instead of Boost, or possibly refactor the code so it doesn't have to walk up the entire directory chain. I'm not 100% sure I understand why |
What about something like |
Yeah, that might actually be a great approach! We'll give it a shot and update the patch if that turns out to work fine. Thanks! |
Make sure to add a comment before the |
About to test this! I've noticed that it might also be possible to do something like |
I think this is mostly equivalent to what I wrote. I'm not sure what else |
Both solutions worked, but the one I committed feels like a more solid and easier to read solution, since it's more explicit. I saw your comment right after committing - if we prefer the |
It's fine. Instead of referring to the pull request in the comment, I'd include the relevant information. Something like "the path should be a directory, but is_directory() returns false for symlinks and reparse points; the condition can technically be true for symlinks to files, but since it's checked against parent_path(), it's unlikely to happen". |
Oh cool, I'll change it to say that instead. I've been doing these changes from the GitHub web UI since I don't actually have a functioning copy of Windows at all - do you know if it's possible to squash commits from there, or should I create a newer branch to keep the commit history clean, or does it not matter? Also, it looks like the build broke with this last commit, although it built fine locally and I don't see any errors in the appveyor log. Any idea what's up with that? Thank you! |
No need to squash, it's fine. The failure is because we're exceeding disk space on appveyor, a perennial issue that we can't fix, except by begging them to give us more space. We can't even delete the artifacts ourselves. |
That sounds like a really frustrating situation. Sorry if I exacerbated the issue with my additional commits! Hopefully this will be good enough to be merged in usvfs - as soon as this issue gets solved, Linux users running the latest Wine version will be able to play with mods again :) |
We didn't get any other report that MO doesn't work at all with Wine right now. Is it a new problem? |
The problem was introduced with a Wine update a while ago. As far as I know, Wine 5.0 was the first version to include a patch that allowed USVFS to work, and then Wine 5.4 or 5.5 broke it again with a different change - the one I referenced earlier in this thread. Many people use an older version of Wine or Proton for certain games, so they might not be affected by the issue yet, until they update to the latest version. While Wine support is my main motivation behind this patch, I believe Windows users could also hit this edge case with certain exotic configurations - so either way, the patch just makes the code more correct. |
I'll chime in cos I've been working with @GranPC on this. So yes, it is a new problem. A regression test of Wine shows that MO (specifically USVFS) stopped working at Wine commit wine-mirror/wine@6b498d9 because it exposes reparse points. That commit was from almost a year ago and apparently community folk have been aware of this, but haven't looked into it or said anything. I've been bored and really wanting to play New Vegas (in Wine because I'm insane) so I started bothering GranPC! The outstanding issue I have in Wine with MO now is that NCC will not run due to relying on dotnet46 which currently doesn't work in Wine at all, so I am compromising by setting up my mods in Windows and then just transferring the folder / profiles over. USVFS works great with the the patch otherwise. |
This patch will be included in the next devbuild, which should be out on discord within the next few days. Thanks to both of you. |
is_directory
returns false for symbolic links and reparse points. This, combined with the fact that USVFS walks up the directory chain when adding an entry to the redirection tree, causes overlays to fail for directories where the path contains a symbolic link or a reparse point.While that's fine for most users, people who use symbolic links to manage their game collection, or people who mount another disk in a NTFS directory, would be unable to overlay anything inside this game directory. It turns out that with the way Wine works internally, most Linux users actually have such a setup by default, and as of wine commit wine-mirror/wine@6b498d9, which exposes this internal detail to Win32 software, USVFS no longer works.
Changing the function from
is_directory
toexists
seems to have fixed this issue with no adverse side-effects.