-
Notifications
You must be signed in to change notification settings - Fork 13.3k
rustbuild seems to deal badly with poor internet connections #32834
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
Ah we probably need to download to a temporary location and only when done move it over into where it's expected to be, that way we'll restart any failed download. |
Hi ! Anyone interested in taking this ? If not I'd like to try. |
@cyplo: Sure. Take it. |
If you have any questions, feel free to ask me @cyplo! |
Hi @alexcrichton, using your invite to ask here ;) I took a quick look there and it seems that the initial download is done via Do you maybe know if there any other downloads, not done during the Thanks a lot ! |
Yeah I believe that's the only location where we download anything. There's other downloads that Cargo does for the actual compilation of the build system itself but Cargo handles bad internet and things like that internally already. |
Hi ! I see that #32926 is merged now, I'm thinking on how to integrate the download resume/retry with it. @alexcrichton / @caipre Let me know what do you think of the following:
|
Isn't it possible to check checksum before downloading? It seems to be overkill otherwise (downloading something to just get "no, you're up to date finally" is really annoying). Or at least check the date or something equivalent which could prevent to download for nothing? |
Yes, totally, it would probably be like this:
thanks ! |
The logic to check whether the file exists and needs updated is already present: rust/src/bootstrap/bootstrap.py Lines 92 to 93 in 6fa61b8
My PR added the checksumming within the For this issue, you need to change the path that the tarball is downloaded to to use some temporary path, then move that to the correct path after the download is complete. An analogy to shell: curl -o file.tmp https://... && mv file.tmp file I suppose you might want to update the checksumming to be done on the temporary file, and only if that succeeds do the move. |
Yeah @caipre's thoughts are exactly my own, let's download to a temp location, verify the checksum, and once both are done we move it to the final location. |
Hey ! I need some more time to get to PR, as I'm quite tight on time lately. If it's not critical/needed quickly - I will come up with PR eventually. If it is - feel free to grab it. |
Get a file during bootstrap to a temp location first. When downloading a file in the bootstrap phase - get it to a temp location first. Verify it there and only if downloaded properly move it to the `cache` directory. This should prevent `make` being stuck if the download was interrupted or otherwise corrupted, as per discussion in #32834 The temporary files are deleted in case of an exception. I was looking for some unit/integration tests around this and couldn't find any - presumably because this is being tested by just Travis launching it ? Let me know if it would be good to try to write tests around this. Thanks !
Hi ! @durka: the fix should be merged now, could you see if this helps ? thanks ! |
I tried to build rust with rustbuild.
But after a few seconds it fails downloading the nightly with errno 104, which is connection reset by peer. If I run it again it sees the file is there and fails saying the checksum is wrong. I guess it needs to retry the download.
The text was updated successfully, but these errors were encountered: