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

cargo install on Windows fails if the target executable is running #3486

Open
mzji opened this issue Jan 2, 2017 · 6 comments
Open

cargo install on Windows fails if the target executable is running #3486

mzji opened this issue Jan 2, 2017 · 6 comments
Labels
Command-install E-medium Experience: Medium O-windows OS: Windows S-needs-design Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted.

Comments

@mzji
Copy link

mzji commented Jan 2, 2017

OS: Windows 10 x64
Console Output:

C:\Users\USERNAME\Documents\Rust\winres>cargo install racer -f
    Updating registry `https://github.com/rust-lang/crates.io-index`
   Compiling rustc-serialize v0.3.22
   Compiling unicode-segmentation v0.1.3
   Compiling libc v0.2.18
   Compiling typed-arena v1.2.0
   Compiling utf8-ranges v0.1.3
   Compiling bitflags v0.7.0
   Compiling memchr v0.1.11
   Compiling ansi_term v0.9.0
   Compiling winapi-build v0.1.1
   Compiling regex-syntax v0.3.9
   Compiling unicode-width v0.1.4
   Compiling unicode-xid v0.0.3
   Compiling kernel32-sys v0.2.2
   Compiling strsim v0.5.2
   Compiling aho-corasick v0.5.3
   Compiling log v0.3.6
   Compiling vec_map v0.6.0
   Compiling winapi v0.2.8
   Compiling toml v0.2.1
   Compiling syntex_pos v0.52.0
   Compiling thread-id v2.0.0
   Compiling term_size v0.2.1
   Compiling term v0.4.4
   Compiling thread_local v0.2.7
   Compiling clap v2.19.3
   Compiling regex v0.1.80
   Compiling syntex_errors v0.52.0
   Compiling syntex_syntax v0.52.0
   Compiling env_logger v0.3.5
   Compiling racer v2.0.4
    Finished release [optimized + debuginfo] target(s) in 613.58 secs
   Replacing C:\Users\USERNAME\.cargo\bin\racer.exe
error: failed to move `C:\Users\USERNAME\.cargo\bin\cargo-install.txmENb8PGFGR\racer.exe` to `C:\Users\USERNAME\.cargo\bin\racer.exe`

To learn more, run the command again with --verbose.

cargo version:

C:\Users\USERNAME\Documents\Rust\winres>cargo version
cargo 0.17.0-nightly (740f9c0 2016-12-29)

rustc version:

C:\Users\USERNAME\Documents\Rust\winres>rustc -vV
rustc 1.16.0-nightly (4ecc85beb 2016-12-28)
binary: rustc
commit-hash: 4ecc85beb339aa8089d936e450b0d800bdf580ae
commit-date: 2016-12-28
host: x86_64-pc-windows-msvc
release: 1.16.0-nightly
LLVM version: 3.9

See also #3364

@alexcrichton
Copy link
Member

This is likely related to racer running in the background still, and cargo install not working to uninstall programs that are currently running.

@mzji
Copy link
Author

mzji commented Jan 3, 2017

Could we kill all racer instances in this case?

@alexcrichton
Copy link
Member

That's probably not Cargo's job itself, but Cargo can likely do something better here regardless.

@dwijnand
Copy link
Member

dwijnand commented Dec 1, 2018

2 years later, do we want to assume this still needs fixing?

@ehuss ehuss added the O-windows OS: Windows label Mar 28, 2020
@ehuss ehuss changed the title Cannot update racer on Windows cargo install on Windows fails if executable is currently running Apr 2, 2020
@PerMagnusH
Copy link

I also get this almost every second time I do a cargo install. It's quite annoying really.

@samoylovfp
Copy link

samoylovfp commented Jul 16, 2021

I forget about this every time the new version of nu shell comes out. And to update it I have to close vscode, all the console windows and open up powershell or cmd and run cargo install nu there. Quite annoying. I wonder if cargo install can issue this call
https://stackoverflow.com/questions/1606140/how-can-a-program-delete-its-own-executable when run on windows.

@mzji mzji changed the title cargo install on Windows fails if executable is currently running cargo install on Windows fails if the target executable is running Jul 16, 2021
@weihanglo weihanglo added S-needs-design Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted. E-medium Experience: Medium labels May 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Command-install E-medium Experience: Medium O-windows OS: Windows S-needs-design Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted.
Projects
None yet
Development

No branches or pull requests

7 participants