rustup icon indicating copy to clipboard operation
rustup copied to clipboard

Can't build in parallel with linked toolchain on windows

Open brson opened this issue 8 years ago • 7 comments

*** Nothing to do with lock errors with ESP32 ***

Running two builds in parallel with a linked toolchain on windows:

brian@DESKTOP-CODN6ST MINGW64 /c/Users/brian/Documents/dev/rls
$ PATH="c:\Program Files\CMake\bin:$PATH" cargo +rust1-stage2 build
error: unable to unlink old fallback exe
info: caused by: Access is denied. (os error 5)

This is because of the hack where the 'fallback' cargo is copied into a temporary location for the duration of the build.

brson avatar May 26 '17 00:05 brson

I wonder if we'd be better off dropping cargo into the linked toolchain when we link it rather than copying exes in this concurrency-unsafe fashion.

Anyhow, as a workaround, ignoring deletion errors, or perhaps retrying a couple of times, should address this.

rbtcollins avatar Jul 27 '20 13:07 rbtcollins

Is there a workaround for tools like cargo-espflash which internally call cargo and then die because they're blocking themselves?

ForsakenHarmony avatar Sep 04 '21 01:09 ForsakenHarmony

@ForsakenHarmony I suggest discussing on the cargo tracker; rustup doesn't block anything

rbtcollins avatar Sep 04 '21 16:09 rbtcollins

@rbtcollins it does, in the case of cargo-espflash.

  • I call cargo espflash which makes rustup copy cargo and lock it
  • then cargo-espflash internally calls cargo build which fails because rustup tries to copy cargo again

ForsakenHarmony avatar Sep 16 '21 16:09 ForsakenHarmony

@ForsakenHarmony rustup does not lock anything. Cargo has locks. Thats why I suggested discussing on the cargo bugtracker.

If you are encountering some other sort of lock, you could start by filing a specific bug about it, rather than sidetracking an existing bug that seems to be separate : I'm going to wait long enough for notification emails to be sent then mark all these comments offtopic.

rbtcollins avatar Sep 16 '21 17:09 rbtcollins

Also marking that off topic @JasonKleban.

rbtcollins avatar Dec 05 '21 15:12 rbtcollins

I recently commented on #2889 with a possible solution to this issue.

kinnison avatar Dec 27 '21 10:12 kinnison