-
Notifications
You must be signed in to change notification settings - Fork 925
Why fmt must use internet to fmt code? #3811
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
Comments
Sounds reasonable to me. I'll work on adding this. FWIW, |
@calebcartwright @topecongiro I think you don't understand what a bad network state is. I have seen the final solution of pr, but from the results, it can only solve the situation that there is no network at all. However, in China, a bad network does not mean that there is no network. In this case, the current #3813 cannot be solved.(Unless the network cable is disconnected or WiFi is turned off before calling The use of client request send -> gfw -> server response -> gfw -- some data can't send to client -> client Therefore, in the case of an appeal, the tcp access does not end, the client is waiting for a response, the server has sent a response message, but the message is intercepted by gfw, the client attempts to re-send, gfw continues to intercept。On Linux, default timeout seems 180 second,so client will wait util tcp shutdown(Maybe, waiting here is more than three minutes, it may have received some news, but not all), during this time, the user can't do anything. Fallback offline #3813 is no practical help for the appeal. To simulate this situation is very simple, you can use the firewall to intercept the return message or start a server, sleep for more than 3 minutes for each request. This way, you may understand why I need the default offline or provide options. Let's talk a little bit about the security of cargo not being connected to the Internet. I admit that under certain commands, if there is no default networking, there will be security issues, such as However, we must be clear that The source file is local, it does not require any resources on the network. I think the reason why In summary, I think there is no problem with offline as the default choice. |
Hi @driftluo! Thanks for following up. First I just want to note that with any changes, it's really important to make sure that those changes don't break anything. The decision to stick with I can definitely understand how this issue is frustrating for you, and I would certainly like to help get this resolved! However, we do need to be careful that the solution for this particular use case doesn't cause different problems for other users. IMO, using
Yup, we're aware 😉
The
I noted this over in #3183, but I don't know the answer to this. I don't know enough about the I don't personally have any objections to switching back to adding the I'd be more than happy to make any additional changes to resolve this (whether that's |
I don't consider this, this may be have a problem. The possibilities should be carefully considered. offline default fallback to inline? |
It's indeed a bit surprised that @calebcartwright, do you think we should open a separate issue for further discussion of switching the default? I can understand your concern that we may be breaking things if we don't take care. Are you aware of some way we can have people who have more knowledge around this involve in the discussion? |
I think it's fine to keep the discussion on this thread, at least for the time being
The only reason So the real connectivity question is about the IMHO (for whatever it's worth 😄), going with an approach to solve this one particular use case that would change the default behavior for every
When the Lines 379 to 418 in dbd8936
I imagine the folks on the cargo team would have the most insight into whether the All that being said, how we proceed from here is up to @topecongiro, and I'm willing to help any way I can! |
@driftluo Thank you for elaborating on your concern. I checked the source code of cargo. AFAICT, The usage of @calebcartwright Thank you for creating #3830 and #3831. As I noted above, I prefer to try removing the usage of |
That would also require a patch to We'd need cargo to be updated so that running I'll look into the viability of that, although I'm not sure how long it would it take to deliver such a patch for Edit: Removed some items I originally thought we'd need |
rustfmt use
cargo-metadata
to get all kinds of metadata, but default useonline
mode and can not change tooffline
.But it is well known that because of various network problems,
cargo
added the--offline
option,metadata
also supports this option, butfmt
does not support.I strongly recommend that
fmt
also have the offline parameter or default withoffline
.rustfmt/src/cargo-fmt/main.rs
Lines 511 to 526 in ee38d02
The text was updated successfully, but these errors were encountered: