Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign up#7630 Adding better error messaging in mach bootstrap for missing virtualenv/pip dependencies #7678
Conversation
highfive
commented
Sep 18, 2015
|
Thanks for the pull request, and welcome! The Servo team is excited to review your changes, and you should hear from @jdm (or someone else) soon. |
|
So your current solution will indeed warn if the user doesn't have pip or virtualenv installed, though I'm a little worried an
|
|
@frewsxcv That makes sense, let me take a stab at it. Additionally, are there unit tests for these scripts? I couldn't find any. |
|
I am not aware of any unit tests for these bootstrapping scripts. That said, if you're considering adding some, I might recommend opening a dedicated GitHub Issue for it so others can chime in their opinions. |
|
@frewsxcv I've made some changes to the code and pushed up to this branch. I went down the path of expanding the scope on the method _get_exec as you suggested however, while digging into the documentation for subprocess.check_call I realized we are really dealing with three scenarios
Digging into the documentation on subprocess.check_call I found that it will return two types of errors
Given that, thought it might be a less invasive change if we expand our exception handling and messaging for the use-cases around our use of check_call. So, my proposed change is to
I'm still 100% open to going down the other path (and to be clear, I did) but it seemed like I was really expanding scope on those functions when this might be less invasive change that helps make the error messages more user friendly when these executables are not installed on their machine. Thoughts? |
|
python/mach_bootstrap.py, line 95 [r2] (raw file): Comments from the review on Reviewable.io |
|
That all seems alright to me. I left a comment on Reviewable before that needs to be addressed |
|
@frewsxcv Fixed the indentation issue. My apologies, still refreshing myself on Python as it has been a while. |
|
@AnthonyBroadCrawford Thanks! It looks like there is a 'tidy' failure (check the Travis CI failure for more information)
You should be able to do something like this: sys.exit("Python virtualenv not found. Please install virtualenv and ensure "
"permissions prior to running mach.") |
|
@frewsxcv on it. |
|
@frewsxcv Fixed. Thanks for pointing that out. |
|
Looks great! Can you squash your commits into one? If you need help with this, let me know |
…ithout python's virtualenv or pip installed
97a0722
to
2e0e228
|
@frewsxcv squashed down into a single commit. |
|
@AnthonyBroadCrawford Thanks for your contribution, great work! @bors-servo r+ |
|
|
…ach-bootstrap, r=frewsxcv #7630 Adding better error messaging in mach bootstrap for missing virtualenv/pip dependencies This PR is in reference to #7630 I've added a simple try catch around our use of subprocess.check_all when trying to invoke and use python's - virtualenv - pip Upon failure, I use sys.exit with an error message for the user. Exit seemed appropriate as anything beneath those dependencies will fail to execute and result in a non friendly error message <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7678) <!-- Reviewable:end -->
|
|
|
@AnthonyBroadCrawford Don't worry, there's an issue with the builders right now. Once the issue is worked out, I'll tell the builders to retry your changes |
|
@bors-servo retry |
…ach-bootstrap, r=frewsxcv #7630 Adding better error messaging in mach bootstrap for missing virtualenv/pip dependencies This PR is in reference to #7630 I've added a simple try catch around our use of subprocess.check_all when trying to invoke and use python's - virtualenv - pip Upon failure, I use sys.exit with an error message for the user. Exit seemed appropriate as anything beneath those dependencies will fail to execute and result in a non friendly error message <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7678) <!-- Reviewable:end -->
|
|
AnthonyBroadCrawford commentedSep 18, 2015
This PR is in reference to #7630
I've added a simple try catch around our use of subprocess.check_all when trying to invoke and use python's
Upon failure, I use sys.exit with an error message for the user. Exit seemed appropriate as anything beneath those dependencies will fail to execute and result in a non friendly error message