-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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: Give a more helpful error message if curl isn't installed #71819
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
I'm not sure that the |
Hm, we can probably do the same thing we do for git? IIRC we run git --version and if that fails assume git isn't installed or won't do what we need. |
Ooh that looks like a good way to do it! I see that sort of thing is repeated a lot (also for |
Not at all, please do! |
The new output is
|
I realized that this will now give a misleading error if you have the command in path but the command failed (e.g. maybe |
New output:
|
Hm, can we perhaps say: ``
|
How does this look?
|
Please squash the commits into one; r=me after that. |
This also abstracts checking for a command into `require`. Before: ``` Updating only changed submodules Submodules updated in 0.01 seconds Traceback (most recent call last): File "./x.py", line 11, in <module> bootstrap.main() ... File "/home/joshua/src/rust/src/bootstrap/bootstrap.py", line 137, in run ret = subprocess.Popen(args, **kwargs) File "/usr/lib/python2.7/subprocess.py", line 394, in __init__ errread, errwrite) File "/usr/lib/python2.7/subprocess.py", line 1047, in _execute_child raise child_exception OSError: [Errno 2] No such file or directory ``` After: ``` error: unable to run `curl --version`: [Errno 2] No such file or directory Please make sure it's installed and in the path. ```
@bors r+ rollup |
📌 Commit 9bcf409 has been approved by |
…lacrum x.py: Give a more helpful error message if curl isn't installed Before: ``` Updating only changed submodules Submodules updated in 0.01 seconds Traceback (most recent call last): File "./x.py", line 11, in <module> bootstrap.main() ... File "/home/joshua/src/rust/src/bootstrap/bootstrap.py", line 137, in run ret = subprocess.Popen(args, **kwargs) File "/usr/lib/python2.7/subprocess.py", line 394, in __init__ errread, errwrite) File "/usr/lib/python2.7/subprocess.py", line 1047, in _execute_child raise child_exception OSError: [Errno 2] No such file or directory ``` After: ``` Updating only changed submodules Submodules updated in 0.01 seconds spurious failure, trying again spurious failure, trying again spurious failure, trying again spurious failure, trying again failed to run: curl -s -y 30 -Y 10 --connect-timeout 30 --retry 3 -Sf -o /tmp/tmpSWF21P.sha256 https://static.rust-lang.org/dist/2020-04-22/rust-std-beta-x86_64-unknown-linux-gnu.tar.gz.sha256: [Errno 2] No such file or directory Build completed unsuccessfully in 0:00:00 ```
…lacrum x.py: Give a more helpful error message if curl isn't installed Before: ``` Updating only changed submodules Submodules updated in 0.01 seconds Traceback (most recent call last): File "./x.py", line 11, in <module> bootstrap.main() ... File "/home/joshua/src/rust/src/bootstrap/bootstrap.py", line 137, in run ret = subprocess.Popen(args, **kwargs) File "/usr/lib/python2.7/subprocess.py", line 394, in __init__ errread, errwrite) File "/usr/lib/python2.7/subprocess.py", line 1047, in _execute_child raise child_exception OSError: [Errno 2] No such file or directory ``` After: ``` Updating only changed submodules Submodules updated in 0.01 seconds spurious failure, trying again spurious failure, trying again spurious failure, trying again spurious failure, trying again failed to run: curl -s -y 30 -Y 10 --connect-timeout 30 --retry 3 -Sf -o /tmp/tmpSWF21P.sha256 https://static.rust-lang.org/dist/2020-04-22/rust-std-beta-x86_64-unknown-linux-gnu.tar.gz.sha256: [Errno 2] No such file or directory Build completed unsuccessfully in 0:00:00 ```
…lacrum x.py: Give a more helpful error message if curl isn't installed Before: ``` Updating only changed submodules Submodules updated in 0.01 seconds Traceback (most recent call last): File "./x.py", line 11, in <module> bootstrap.main() ... File "/home/joshua/src/rust/src/bootstrap/bootstrap.py", line 137, in run ret = subprocess.Popen(args, **kwargs) File "/usr/lib/python2.7/subprocess.py", line 394, in __init__ errread, errwrite) File "/usr/lib/python2.7/subprocess.py", line 1047, in _execute_child raise child_exception OSError: [Errno 2] No such file or directory ``` After: ``` Updating only changed submodules Submodules updated in 0.01 seconds spurious failure, trying again spurious failure, trying again spurious failure, trying again spurious failure, trying again failed to run: curl -s -y 30 -Y 10 --connect-timeout 30 --retry 3 -Sf -o /tmp/tmpSWF21P.sha256 https://static.rust-lang.org/dist/2020-04-22/rust-std-beta-x86_64-unknown-linux-gnu.tar.gz.sha256: [Errno 2] No such file or directory Build completed unsuccessfully in 0:00:00 ```
…lacrum x.py: Give a more helpful error message if curl isn't installed Before: ``` Updating only changed submodules Submodules updated in 0.01 seconds Traceback (most recent call last): File "./x.py", line 11, in <module> bootstrap.main() ... File "/home/joshua/src/rust/src/bootstrap/bootstrap.py", line 137, in run ret = subprocess.Popen(args, **kwargs) File "/usr/lib/python2.7/subprocess.py", line 394, in __init__ errread, errwrite) File "/usr/lib/python2.7/subprocess.py", line 1047, in _execute_child raise child_exception OSError: [Errno 2] No such file or directory ``` After: ``` Updating only changed submodules Submodules updated in 0.01 seconds spurious failure, trying again spurious failure, trying again spurious failure, trying again spurious failure, trying again failed to run: curl -s -y 30 -Y 10 --connect-timeout 30 --retry 3 -Sf -o /tmp/tmpSWF21P.sha256 https://static.rust-lang.org/dist/2020-04-22/rust-std-beta-x86_64-unknown-linux-gnu.tar.gz.sha256: [Errno 2] No such file or directory Build completed unsuccessfully in 0:00:00 ```
Rollup of 7 pull requests Successful merges: - rust-lang#71269 (Define UB in float-to-int casts to saturate) - rust-lang#71591 (use new interface to create threads on HermitCore) - rust-lang#71819 (x.py: Give a more helpful error message if curl isn't installed) - rust-lang#71893 (Use the `impls` module to import pre-existing dataflow analyses) - rust-lang#71929 (Use -fvisibility=hidden for libunwind) - rust-lang#71937 (Ignore SGX on a few ui tests) - rust-lang#71944 (Add comment for `Ord` implementation for array) Failed merges: r? @ghost
Before:
After: