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

Verification for existing command execution while update #3376

Closed
NishantJoshi00 opened this issue Jun 5, 2023 · 2 comments
Closed

Verification for existing command execution while update #3376

NishantJoshi00 opened this issue Jun 5, 2023 · 2 comments

Comments

@NishantJoshi00
Copy link

NishantJoshi00 commented Jun 5, 2023

Problem

Executing the cargo build command on my stable toolchain, on a different terminal updated my stable toolchain with rustup update stable. This caused my build to panic with an error getting hold of core functions, which happened just after the rust-std update.

I have tried this on both my macosx and windows machine, attached a screenshot below (from windows machine):

just a screenshot

Steps

  1. Required an outdated stable branch, and that branch being used for any compilation and execution
  2. (In my case) Start compiling a project which might take a little longer than the update process
  3. parallelly update the stable branch while the compilation is underway.
  4. This will break the compilation

Possible Solution(s)

considering cargo, rustc, rustfmt are stateless functions, we can consider having a lock file, which gets created when the specific function is invoked, this lock file, however, will not prevent the executable from executing but will prevent any program, in this case, rustup to remove and/or update it, until the lock file is removed.
To allow multiple executions, if anyone wants to use these executables, we can create n lock files for every pid that is using the program, and will only allow rustup to tamper with them if there is no lock file present.

Notes

If possible I would like to work on solving this issue. Though the solution that I have might be a bit vague, any inputs on a different approach are welcome. In the mean time, I'll try to understand the internal workings of rustup.

Rustup version

rustup 1.26.0 (5af9b9484 2023-04-05)

Installed toolchains

Default host: x86_64-pc-windows-msvc
rustup home:  

stable-x86_64-pc-windows-msvc (default)
rustc 1.70.0 (90c541806 2023-05-31)
@hi-rustin
Copy link
Member

Duplicate of #988

@hi-rustin hi-rustin marked this as a duplicate of #988 Jun 5, 2023
@rbtcollins
Copy link
Contributor

@NishantJoshi00 please do discuss this in #988 - that bug is quite large, because its a complex topic, but it is the place where we are discussing what a solution looks like.

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

No branches or pull requests

4 participants
@rbtcollins @hi-rustin @NishantJoshi00 and others