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

rustup-init x86_64-pc-windows-gnu reparse links created in msys2 shell corrupted #488

Closed
nogard opened this issue May 19, 2016 · 11 comments
Closed

Comments

@nogard
Copy link

nogard commented May 19, 2016

Using x86_64-pc-windows-gnu v0.1.12 rustup to link to a custom toolchain inside msys2 shell. The links created inside $USERPROFILE/.multirust/toolchains can be opened by ls in msys2 shell but gives "'custom toolchain' not installed" when rustup run custom_toolchain rustc.

Under windows powershell or file explorer, when the links are opened it gives "'link' is not accessible, The filename, directory name, volume label syntax is incorrect".

@brson
Copy link
Contributor

brson commented Jun 3, 2016

Thanks for the report.

The symlinking on windows uses a big ball of win32 code so it wouldn't surprise me it's got problems. The test suite passes here though so I wonder if there are platform differences causing the problems for you. What version of Windows are you on?

@chlai88
Copy link

chlai88 commented Jun 3, 2016

it's windows 10 home insider preview
version: 1511
os build: 14352.1002

msys version: MINGW64_NT-10.0 2.5.0(0.297/5/3) x86_64

@Diggsey
Copy link
Contributor

Diggsey commented Jun 5, 2016

It sounds like msys is not converting the path to a windows-style path when you pass in the location of your custom toolchain directory. Could you give the exact command line you're using to invoke rustup?

@chlai88
Copy link

chlai88 commented Jun 6, 2016

Ah yes that's the problem. Used this command to link

rustup toolchain link test /d/projects/rust/rust/build/x86_64-pc-windows-gnu/stage2

@Diggsey
Copy link
Contributor

Diggsey commented Jun 7, 2016

I've looked into it, and the problem is that while msys is for the most part converting the path to a windows-style path, it does not replace forward slashes with backslashes. It should be sufficient to do a simple find/replace, but it may be preferable to do some kind of canonicalization instead?

@chlai88
Copy link

chlai88 commented Jun 10, 2016

rust's fs::canonicalize doesn't play well with msys paths like this /d/projects/rust/rust/build/x86_64-pc-windows-gnu/stage2 . maybe a simple find/replace will suffice ?

@Diggsey
Copy link
Contributor

Diggsey commented Jun 10, 2016

@chlai88 msys is correctly converting the path to a window-style path (ie. with a drive letter) it's just not converting the forward slashes to backslashes. In most places windows doesn't care which type of slash is used and will happily accept a mix even, but for the more "raw" apis, like link creation, only backslashes work.

@brson
Copy link
Contributor

brson commented Jun 23, 2016

@Diggsey Can we convert the slashes ourselves at the time the link is created?

@Diggsey
Copy link
Contributor

Diggsey commented Jun 24, 2016

We can, the question is how: we can do a simple find and replace, or we could canonicalize the path. Also, we can fix this directly in rustup, or it could be fixed in the standard library - it's going to be an issue for anyone using the link creation functions with paths that may contain forward slashes.

@brson
Copy link
Contributor

brson commented Jun 30, 2016

I don't know if there's a place to fix this in std - rustup is making directory junctions directly instead of using the std symlink functions.

@brson
Copy link
Contributor

brson commented Nov 18, 2016

I think this is probably the bug I've been encountering trying to fix #812 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants