-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
x.py fails all downloads that use a tempdir with snap curl #107722
Comments
Is there a proper way to detect current |
We could call snap to check if it is installed, but I don't think the snap cli is stable |
What if we could follow this format of cli: curl url > filepath Which can be achieved by below code in python: with open(path, "wb") as outfile:
run(["curl", option,
"-L", # Follow redirect.
"-y", "30", "-Y", "10", # timeout if speed is < 10 bytes/sec for > 30 seconds
"--connect-timeout", "30", # timeout if cannot connect within 30 seconds
"--retry", "3", "-Sf", url], #modified line
stdout=outfile, #modified line
verbose=verbose,
exception=True, # Will raise RuntimeError on failure
) This works for both snap and apt curl commands on Kubuntu. |
I think it's reasonable to store it in a relative path compared to the root dir of rustc source code, do we have such a temporary directory in the bootstrap now? |
I don't see a reason to use the rust/src/bootstrap/bootstrap.py Line 94 in dffea43
|
@tharunsuresh-code are you interested in making a PR with that change? :) |
I'd like to take this up if @tharunsuresh-code does not take it up, if that's alright. |
@jyn514 Sure, I will make the necessary changes and raise a PR |
So I guess one of the downloads tries to directly store in the source directory of rust (which can be in any user path) Finished dev [unoptimized] target(s) in 21.19s
downloading https://static.rust-lang.org/dist/2023-01-30/rustfmt-nightly-x86_64-unknown-linux-gnu.tar.xz
Warning: Failed to open the file /media/d_drive/My_files/Visual Studio
Warning: Code/github/rust_commit/rust/build/tmp/rustfmt-nightly-x86_64-unknown-
Warning: linux-gnu.tar.xz: Permission denied
curl: (23) Failure writing output to destination Actual path - This is because the command did not execute successfully: "curl" "-#" "-y" "30" "-Y" "10" "--connect-timeout" "30" "--retry" "3" "-Sf" "-o" "/media/d_drive/My_files/Visual Studio Code/github/rust/build/tmp/rustfmt-nightly-x86_64-unknown-linux-gnu.tar.xz" "https://static.rust-lang.org/dist/2023-01-30/rustfmt-nightly-x86_64-unknown-linux-gnu.tar.xz" I am investigating on this |
Okay, I guess it is due to the bootstrapping process of using the existing version of bootstrap to compile the current version? So I can ignore this and go ahead to commit our discussed change? |
@tharunsuresh-code there are two languages used in bootstrap, Python and rust. You've fixed a bug in the python code, but it looks like the rust code has a different bug that coincidentally is also related to downloads. I don't have time to look into it right now, but fixing both bugs at once seems reasonable. https://github.com/rust-lang/rust/blob/master/src/bootstrap/README.md#build-phases |
Oh, alright, I will try to check it! |
x.py fails all downloads that use a tempdir with snap curl rust-lang#107722 Have used the open() library from python to capture the binary output of the curl command and write it to a file using stdout of the subprocess. Added a single-line comment mentioning the redirect operator.
…mpiler-errors Rollup of 9 pull requests Successful merges: - rust-lang#107317 (Implement `AsFd` and `AsRawFd` for `Rc`) - rust-lang#107429 (Stabilize feature `cstr_from_bytes_until_nul`) - rust-lang#107713 (Extend `BYTE_SLICE_IN_PACKED_STRUCT_WITH_DERIVE`.) - rust-lang#107761 (Replace a command line flag with an env var to allow tools to initialize the tracing loggers at their own discretion) - rust-lang#107790 ( x.py fails all downloads that use a tempdir with snap curl rust-lang#107722) - rust-lang#107799 (correctly update goals in the cache) - rust-lang#107813 (Do not eagerly recover for bad `impl Trait` types in macros) - rust-lang#107817 (rustdoc: use svgo to shrink `wheel.svg`) - rust-lang#107819 (Set `rust-analyzer.check.invocationLocation` to `root`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Fixed in #107790 |
Hey everyone,
First time setting up Rust for development in my local system. OS version - Kubuntu 22.10
I installed curl using snap then ran the setup script x as follows:
It resulted in the following error message -
This is primarily due to the "tmp" folder location of curl installed through snap being "/tmp/snap-private-tmp/snap.curl/tmp" which is not the path that x.py is looking for. Alternatively installing curl using "apt install curl", I was able to get x.py setup to run properly.
A message on Zulip discussing this -> https://rust-lang.zulipchat.com/#narrow/stream/122652-new-members/topic/frozendroid/near/285039893
An existing issue #86708
I would like to ask if we can elegantly instruct new users about this issue and guide them in a better way?
The text was updated successfully, but these errors were encountered: