Skip to content
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

doesn't work for a drive mounted to root / #42

Closed
hibernick opened this issue Sep 14, 2018 · 6 comments
Closed

doesn't work for a drive mounted to root / #42

hibernick opened this issue Sep 14, 2018 · 6 comments

Comments

@hibernick
Copy link

 $ mount 
 ...
 C: on /c type drvfs (rw,noatime,uid=1000,gid=1000,umask=22,fmask=111,metadata)
 D: on /d type drvfs (rw,noatime,uid=1000,gid=1000,umask=22,fmask=111,metadata)
$ cat  /etc/wsl.conf
[automount]
root = /
options = "metadata,uid=1000,gid=1000,umask=22,fmask=111"

vscode output:

Open repository: \d\work\projects\proj
> git status -z -u
> git rev-parse --show-toplevel
fatal: Not a git repository (or any parent up to mount point /d)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
@andy-5
Copy link
Owner

andy-5 commented Sep 17, 2018

Yes, this is a known issue, as wslgit currently does not honor settings in wsl.conf. There is some discussion in #12 on how to fix this, but no implementation for now.

One possible temporary workaround, until this is implemented, is to use the old way of configuring your setup using bind mounts. This kind of works, but leads to other problems in some situations, as discussed in #34 .

I'll leave this issue open for now as a concise example for the wsl.conf setup and resulting mount points.

@nickjj
Copy link

nickjj commented Dec 16, 2018

I'd really like to see this work with / as well. Going back to /mnt can't happen for me. Also I tried symlinking /mnt/c to /c and that also didn't work.

I never compiled a Rust app before, but if you change the hard coded /mnt to /, would it work?

This was referenced Feb 5, 2019
@weissglut-dev
Copy link

weissglut-dev commented Feb 20, 2019

I never compiled a Rust app before, but if you change the hard coded /mnt to /, would it work?

I just tried that and it works

@GuillaumedesPommareSAP
Copy link

GuillaumedesPommareSAP commented Feb 20, 2019

It would be nice if you could share your compiled wslgit.exe somewhere, because putting in place the build environment when you don't have all the required tools is really time consuming.

Maybe providing two variants, one with / and the other with /mnt/, if it is not complex to do, would help people forced, as I am, to switch their mounting point to / ?

@GuillaumedesPommareSAP
Copy link

If anyone needs to make it working, the 'easiest' way is to go through the installation of VS Tools 2018 + W10 SDK. I tried to use cargo+rust under WSL to generate a .exe but it's really tricky and complex to set up.
Then you will need to modify two lines:
l27 format!("/{}", drive)
and
l76 Regex::new(r"(?m-u)/(?P<drive>[A-Za-z])(?P<path>/\S*)")

And a build, and here you go, it works with a mount on root /c/here/i/am
I can share a build, if needed, but sharing .exe outside this site could be risky for the receiver.

@andy-5
Copy link
Owner

andy-5 commented Feb 21, 2019

Great! Nice to hear that it works in principle. Note, however, that this could fail in some edge cases, e.g. if the output of some translated git command contains slashes that are not part of a path (but only few git commands are actually translated).

I think many will find this useful, so I've added a new build with these changes (which are now in the mount-at-root branch) to the latest release - just grab the wslgit-mount-at-root.exe binary there.

I'm also closing this issue, as these changes seem to solve this specific use case.

@andy-5 andy-5 closed this as completed Feb 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants