rust icon indicating copy to clipboard operation
rust copied to clipboard

rustfmt Not Downloaded Until Manual `x.py fmt`

Open asquared31415 opened this issue 3 years ago • 7 comments
trafficstars

As of #97507 rustfmt is not downloaded until the user runs x.py fmt. The rustc dev guide suggests setting the formatter to the rustfmt that is downloaded for stage0 in the build directory, but that is no longer downloaded with any other x.py commands.

@jyn514 (sorry for the delay in making this issue)

asquared31415 avatar Sep 02 '22 02:09 asquared31415

@rustbot claim

reez12g avatar Sep 08 '22 07:09 reez12g

Hi @reez12g, have you had time to work on this? Let me know if anything is confusing and I'm happy to help out :)

jyn514 avatar Sep 14 '22 23:09 jyn514

@jyn514 Thank you!! Sorry for the delay in catching up.

Am I correct that this Issue is about "at some point, make sure to automatically download rustfmt"? If so, I'm still not sure which file to fix.

I think I somehow understood that this Issue is related to this (i.e., no dependence on python scripts?)

reez12g avatar Sep 15 '22 08:09 reez12g

I think I somehow understood that this Issue is related to this (i.e., no dependence on python scripts?)

That was the motivation for https://github.com/rust-lang/rust/pull/97507, right, we want to move all the logic out of the python script eventually.

Am I correct that this Issue is about "at some point, make sure to automatically download rustfmt"?

Not just at some point - it should be done on every invocation of bootstrap (assuming it hasn't been downloaded yet). Right now we only download it when someone runs x.py fmt.

If so, I'm still not sure which file to fix.

If you look at the PR I linked, it's currently in format.rs - I think moving it a line early to https://github.com/rust-lang/rust/blob/6115f4eba458e763370119b2a10a73ef595583bc/src/bootstrap/lib.rs#L679 would be a good approach.

jyn514 avatar Sep 15 '22 14:09 jyn514

Is this picked up or shall i work on it? @jyn514

zsfVishnu avatar Sep 18 '22 07:09 zsfVishnu

@zsfVishnu no, @reez12g is already working on it.

jyn514 avatar Sep 18 '22 14:09 jyn514

cool

zsfVishnu avatar Sep 18 '22 15:09 zsfVishnu