Skip to content

rustup update error #1316

Closed
ethereumproject/go-ethereum
#455

Description

@Eh2406

I get this error today:

C:\rust_things>rustup -V
rustup 1.8.0 (cb2d14862 2017-12-17)
C:\rust_things>rustup self update
info: checking for self-updates
error: could not create link from 'C:\Users\finkelman\.cargo\bin\rustup.exe' to 'C:\Users\finkelman\.cargo\bin\rustc.exe'

Don't know what it means just reporting.

Win 10, 64 bit.

Activity

  1. Antelope13 commented on Dec 19, 2017

    @Antelope13

    I'm getting the same thing. Win 10, 64 bit.

  2. kjeremy commented on Dec 19, 2017

    @kjeremy

    Seeing this on Windows 7 x64 for cargo, cargo-fmt, rls, rustc, rustdoc, rustfmt, rust-gdb, and rust-lldb

  3. Eh2406 commented on Dec 19, 2017

    @Eh2406
    Author

    I don't know if it is relevant but cargo is not finding cargo-fmt despite it being on my path.

  4. BrianLee608 commented on Dec 20, 2017

    @BrianLee608

    Getting the same error:

    C:\Users\Brian> rustup update
    info: syncing channel updates for 'stable-x86_64-pc-windows-msvc'
    info: syncing channel updates for 'nightly-x86_64-pc-windows-msvc'
    info: latest update on 2017-12-20, rust version 1.24.0-nightly (b39c4bc12 2017-12-19)
    info: downloading component 'rustc'
    error: component download failed for rustc-x86_64-pc-windows-msvc
    info: checking for self-updates
    
           stable-x86_64-pc-windows-msvc unchanged - rustc 1.22.1 (05e2e1c41 2017-11-22)
      nightly-x86_64-pc-windows-msvc update failed - rustc 1.24.0-nightly (77efd6800 2017-12-15)
    
    error: could not create link from 'C:\Users\Brian\.cargo\bin\rustup.exe' to 'C:\Users\Brian\.cargo\bin\rustc.exe'
    
  5. systemtrap commented on Dec 20, 2017

    @systemtrap

    I ran into the same problem. In "raw.rs" the function hardlink tries to unlink the destinaton file but does not care about the io::Result. This call fails on my system. Any attempt to link the file fails due to an already existing file.

    As far as I understand informations from MSDN right now hardlinks are not removeable when the the file is locked. It seems to be locked due to running rustup.exe.

    Has the mechanisms for handling .cargo/bin changed recently? The Problem was introduced with #1310 and cb2d148.

  6. iliekturtles commented on Dec 21, 2017

    @iliekturtles

    Possibly related. Running rustup self update on Windows 10 64-bit in the git-for-windows bash shell. Past updates have worked successfully. No rustup executables exist in cargo/bin after the error messages below.

    $ rustup self update
    info: checking for self-updates
    info: downloading self-update
    info: rustup updated successfully to 1.8.0
    error: could not copy file from 'C:\Users\mike\.local\share\cargo\bin\rustup-init.exe' to 'C:\Users\mike\.local\share\cargo\bin\rustup.exe'
    info: caused by: Access is denied. (os error 5)
    

    Downloading rustup-init.exe and running from a regular command prompt I get the following errors:

    C:\Users\mike\Downloads>rustup-init.exe --no-modify-path
    error: it looks like you have an existing installation of Rust at:
    error: C:\Users\mike\.local\share\cargo\bin
    error: rustup cannot be installed alongside Rust. Please uninstall first
    error: if this is what you want, restart the installation with `-y'
    error: cannot install while Rust is installed
    
    C:\Users\mike\Downloads>rustup-init.exe --no-modify-path -y
    warning: tool `rustfmt` is already installed, remove it from `C:\Users\mike\.local\share\cargo\bin`, then run `rustup update` to have rustup manage this tool.
    warning: tool `cargo-fmt` is already installed, remove it from `C:\Users\mike\.local\share\cargo\bin`, then run `rustup update` to have rustup manage this tool.
    info: updating existing rustup installation
    

    Running cargo uninstall rustfmt-nightly and allows rustup to install successfully but subsequent self updates fail:

    C:\Users\mike\Downloads>rustup-init.exe --no-modify-path -y
    info: updating existing rustup installation
    C:\Users\mike\Downloads>rustup self update
    info: checking for self-updates
    error: could not create link from 'C:\Users\mike\.local\share\cargo\bin\rustup.exe' to 'C:\Users\mike\.local\share\cargo\bin\rustc.exe'
    
  7. CryZe commented on Dec 22, 2017

    @CryZe

    Yeah, I can confirm that rustup update does not work anymore. You need to delete all of the tools it mentions at the same time for it not to error out. It'll error out on the next update again though

  8. CryZe commented on Dec 22, 2017

    @CryZe

    These are the tools you need to delete:

    https://i.imgur.com/o4TYpLJ.png

  9. petertiedemann commented on Dec 22, 2017

    @petertiedemann

    Me too (also win 10 x64)

  10. whilei commented on Dec 22, 2017

    @whilei

    We're seeing the same failure across many AppVeyor builds, eg.

    verbose: toolchain 'stable-i686-pc-windows-msvc' installed
    info: default toolchain set to 'stable'
      stable installed - rustc 1.22.1 (05e2e1c41 2017-11-22)
    set PATH=%PATH%;%USERPROFILE%\.cargo\bin
    rustup update
    info: syncing channel updates for 'stable-i686-pc-windows-msvc'
    info: checking for self-updates
      stable-i686-pc-windows-msvc unchanged - rustc 1.22.1 (05e2e1c41 2017-11-22)
    error: could not create link from 'C:\Users\appveyor\.cargo\bin\rustup.exe' to 'C:\Users\appveyor\.cargo\bin\rustc.exe'
    

    https://ci.appveyor.com/project/r8d8/emerald-rs-wimdr/build/1.0.234/job/8uxp8lp6gsgnqi11

    Any solves or workarounds would be very welcome -- this is a blocking issue for many of our projects.

  11. DustinByfuglien commented on Dec 23, 2017

    @DustinByfuglien

    Confirm.
    I have this problem in Windows 7 x64.

  12. nonsensecreativity commented on Dec 24, 2017

    @nonsensecreativity

    Confirm,
    I have this problem in Windows 10 x64

  13. workingj commented on Dec 25, 2017

    @workingj

    I do have the same issue too.
    Win 10 x64

  14. gagarin55 commented on Dec 25, 2017

    @gagarin55

    Same issue

  15. sc0ttwad3 commented on Dec 25, 2017

    @sc0ttwad3

    Same here Win10 x64 (17063):

    λ rustup update
    info: syncing channel updates for 'beta-x86_64-pc-windows-msvc'
    info: syncing channel updates for 'nightly-x86_64-pc-windows-msvc'
    info: checking for self-updates
    
         beta-x86_64-pc-windows-msvc unchanged - rustc 1.23.0-beta.2 (c9107ee93 2017-12-08)
      nightly-x86_64-pc-windows-msvc unchanged - rustc 1.24.0-nightly (c284f8807 2017-12-24)
    
    warning: tool `rustfmt` is already installed, remove it from `C:\Users\scott\.cargo\bin`, then run `rustup update` to have rustup manage this tool.
    warning: tool `cargo-fmt` is already installed, remove it from `C:\Users\scott\.cargo\bin`, then run `rustup update` to have rustup manage this tool.
    

    Removed 'rustfmt' and 'cargo-fmt' as indicated, then:

    λ rustup update
    info: syncing channel updates for 'beta-x86_64-pc-windows-msvc'
    info: syncing channel updates for 'nightly-x86_64-pc-windows-msvc'
    info: checking for self-updates
    
         beta-x86_64-pc-windows-msvc unchanged - rustc 1.23.0-beta.2 (c9107ee93 2017-12-08)
      nightly-x86_64-pc-windows-msvc unchanged - rustc 1.24.0-nightly (c284f8807 2017-12-24)
    
    error: could not create link from 'C:\Users\scott\.cargo\bin\rustup.exe' to 'C:\Users\scott\.cargo\bin\rustc.exe'
    
  16. 17 remaining items

  17. added 7 commits that reference this issue on Jan 4, 2018
    3eae698
    2711e22
    98acdbb
    c008633
    f6e8d7a
    a1798ab
    f94daed
  18. added a commit that references this issue on Jan 4, 2018
    abe2bde
  19. Yanpas commented on Jan 4, 2018

    @Yanpas

    I still get error: could not create link from 'C:\Users\USERNAME\.cargo\bin\rustup.exe' to 'C:\Users\USERNAME\.cargo\bin\rustc.exe'

  20. alexcrichton commented on Jan 4, 2018

    @alexcrichton
    Member

    @Yanpas an updated version of rustup had not been released, it shoudl be fixed now.

  21. hherman1 commented on Mar 7, 2018

    @hherman1

    Having this issue. Was on a pretty old version of rustup and updated recently. GOt the warnings about rustfmt and cargo-fmt, complied, and suffered.

    The error:

    PS C:\Users\me> rustfmt
    error: toolchain 'stable-x86_64-pc-windows-msvc' does not have the binary `rustfmt.exe`
    

    Attempt to solve:

    PS C:\Users\me> rustup component add rustfmt
    error: toolchain 'stable-x86_64-pc-windows-msvc' does not contain component 'rustfmt' for target 'x86_64-pc-windows-msvc'
    

    Version:

    PS C:\Users\me> rustup --version
    rustup 1.11.0 (e751ff9f8 2018-02-13)
    
  22. Arnavion commented on Mar 7, 2018

    @Arnavion

    @hherman1 Perhaps you commented on the wrong issue. Anyway you're trying to add a component named rustfmt that does not exist, thus the error. The component you're looking for is named rustfmt-preview and you can see from rustup component list

  23. added a commit that references this issue on Apr 5, 2018
    df4e4bb
  24. Zykino commented on Oct 26, 2018

    @Zykino

    I just got the same error updating to 1.30.

    PS C:\Users\me> rustup update
    info: syncing channel updates for 'stable-x86_64-pc-windows-gnu'
    info: latest update on 2018-10-25, rust version 1.30.0 (da5f414c2 2018-10-24)
    info: downloading component 'rustc'
     76.7 MiB /  76.7 MiB (100 %)  23.4 MiB/s ETA:   0 s
    info: downloading component 'rust-std'
     51.7 MiB /  51.7 MiB (100 %)   8.4 MiB/s ETA:   0 s
    info: downloading component 'cargo'
      4.5 MiB /   4.5 MiB (100 %) 910.8 KiB/s ETA:   0 s
    info: downloading component 'rust-docs'
    info: downloading component 'rust-mingw'
    info: removing component 'rustc'
    info: removing component 'rust-std'
    info: removing component 'cargo'
    info: removing component 'rust-docs'
    info: removing component 'rust-mingw'
    info: installing component 'rustc'
    info: installing component 'rust-std'
    info: installing component 'cargo'
    info: installing component 'rust-docs'
    info: installing component 'rust-mingw'
    info: syncing channel updates for 'beta-x86_64-pc-windows-gnu'
    info: checking for self-updates
    info: downloading self-update
    
      stable-x86_64-pc-windows-gnu updated - rustc 1.30.0 (da5f414c2 2018-10-24)
      beta-x86_64-pc-windows-gnu unchanged - rustc 1.30.0-beta.17 (f33946f81 2018-10-23)
    
    PS C:\Users\me> error: could not remove 'rustup-bin' file: 'C:\Users\me\.cargo\bin\rustup.exe'
    info: caused by: Access is denied. (os error 5)
    

    Also after trying rustup self update if it matters (just in case since I saw people using this command in this thread).

    PS C:\Users\me> rustup self update
    info: checking for self-updates
    info: downloading self-update
    info: rustup updated successfully to 1.14.0
    PS C:\Users\me> error: could not remove 'rustup-bin' file: 'C:\Users\me\.cargo\bin\rustup.exe'
    info: caused by: Access is denied. (os error 5)
    
    PS C:\Users\me> rustup --version
    rustup 1.12.0 (573895abc 2018-07-07)
    

    Since the issue was closed about 1 year ago tell me if you prefer that I open a new one.

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