Skip to content

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

Description

@nogard

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".

Activity

  1. brson commented on Jun 3, 2016

    @brson
    Contributor

    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?

  2. chlai88 commented on Jun 3, 2016

    @chlai88

    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

  3. Diggsey commented on Jun 5, 2016

    @Diggsey
    Contributor

    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?

  4. chlai88 commented on Jun 6, 2016

    @chlai88

    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

  5. Diggsey commented on Jun 7, 2016

    @Diggsey
    Contributor

    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?

  6. chlai88 commented on Jun 10, 2016

    @chlai88

    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 ?

  7. Diggsey commented on Jun 10, 2016

    @Diggsey
    Contributor

    @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.

  8. brson commented on Jun 23, 2016

    @brson
    Contributor

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

  9. Diggsey commented on Jun 24, 2016

    @Diggsey
    Contributor

    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.

  10. brson commented on Jun 30, 2016

    @brson
    Contributor

    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.

  11. brson commented on Nov 18, 2016

    @brson
    Contributor

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions