-
Notifications
You must be signed in to change notification settings - Fork 382
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
use cygpath if wsl is not available #852
Conversation
f96b0a3
to
8946e57
Compare
.with_error(|| { | ||
<eyre::Report as std::convert::AsRef< | ||
dyn std::error::Error + Send + Sync + 'static, | ||
>>::as_ref(Box::leak(Box::new(cyg_err))) | ||
}) | ||
.with_error(|| { | ||
<eyre::Report as std::convert::AsRef< | ||
dyn std::error::Error + Send + Sync + 'static, | ||
>>::as_ref(Box::leak(Box::new(wsl_err))) | ||
}) |
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.
some nice leaks, unfortunately couldn't find a better way to do this
// podman weirdly expects a WSL path here, and fails otherwise | ||
path = wslpath(&path, verbose)?; | ||
path = winpath(&path, verbose)?; |
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.
does this work with podman?
Isn't WSL2 required though? Both Docker and Podman require it on Windows. So we might have an issue with it not being present, and maybe we need a better error? |
wsl2 is not required, only wsl. doing this specifically because of the error in #851 : https://github.com/cross-rs/cross/runs/7045847730?check_suite_focus=true |
I believe WSL2 is now required, or Hyper-V (I forgot that LinuxKit was a thing). I know WSL used to be used back in 2017ish? 2016ish? back when I used it then before Docker Desktop was released, but I doubt we should rely on anyone used that anymore. We probably need a different solution than cygpath if we do, since we would want it to be compatible with Hyper-V? |
Putting the discussion from matrix here:
We don't need the paths to be compatible, only that they are expressed in a sane way that unix understands. This is because we mount the volume paths with We could instead of using cygpath fallback to something like |
I think this won't be too complex to implement in cross itself. We shouldn't have to worry about UNC paths or I believe verbatim paths as long as we canonicalize them first in most cases, except when necessary. |
docker -v doesn't take unc paths, don't think there are cases where we use unc paths |
If that's the case, then handling drives is pretty easy. |
Removes the dependency on WSL2, and properly handles DOS-style paths, UNC paths, including those on localhost, even if Docker itself does not support them. Closes cross-rs#854. Related to cross-rs#665. Supersedes cross-rs#852.
856: Remove WSLpath and implement WSL-style path. r=Emilgardis a=Alexhuszagh Removes the dependency on WSL2, and properly handles DOS-style paths, UNC paths, including those on localhost, even if Docker itself does not support them. Closes #854. Related to #665. Supersedes #852. Co-authored-by: Alex Huszagh <[email protected]>
Implements getting unix paths with
cygpath
if wsl/wslpath is not installed.