Skip to content
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

mach: android install/run: infer adb path from SDK dir #20421

Merged
merged 1 commit into from Jun 19, 2018

Conversation

@talklittle
Copy link
Contributor

talklittle commented Mar 24, 2018

Infer Android adb path from SDK directory in environment variables.


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • These changes fix #20219 (github issue number if applicable).
  • There are tests for these changes OR
  • These changes do not require tests because it is a build script change

This change is Reviewable

@highfive
Copy link

highfive commented Mar 24, 2018

Heads up! This PR modifies the following files:

  • @wafflespeanut: python/servo/command_base.py, python/servo/package_commands.py, python/servo/post_build_commands.py
@SimonSapin
Copy link
Member

SimonSapin commented Mar 25, 2018

Should the SDK’s adb (when found) be preferred over what’s in $PATH? On my system I get version mismatch errors when I use adb from Ubuntu packages with an emulator in Android Studio downloaded from upstream.

@SimonSapin
Copy link
Member

SimonSapin commented Mar 25, 2018

CC @jdm

@talklittle
Copy link
Contributor Author

talklittle commented Mar 25, 2018

@SimonSapin I'm curious if you have a specific use case for having multiple installations of the Android tools? Without knowing the reason behind that setup, I'm tempted to say it's a broken environment, similarly to using Aptitude to install some application or library, and then doing a manual make && make install with the app/library sources to install a second copy. For Android, AFAIK it's best to use the Android Studio installation if you have it, and uninstall the Ubuntu packages.

@SimonSapin
Copy link
Member

SimonSapin commented Mar 25, 2018

It’s less a use case than the accidental result of blindly following multiple sets of instructions on getting started with Android dev. I can believe that it’s a totally broken setup. If it’s easy for people to accidentally end up in this situation and easy for us to work around it, maybe we should?

@talklittle talklittle force-pushed the talklittle:issue-20219 branch from 087e1a3 to 8ef920b Mar 25, 2018
@talklittle talklittle force-pushed the talklittle:issue-20219 branch from 8ef920b to a631cb6 Mar 25, 2018
@talklittle
Copy link
Contributor Author

talklittle commented Mar 25, 2018

Okay, good point. I've updated the PR to prefer the SDK adb, and fallback to path ADB.

Tested with and without adb in path, and with and without ANDROID_SDK env set.

If no adb anywhere, user still gets an ugly Python error OSError: [Errno 2] No such file or directory, but that's no worse than before. Can't help if they're not reading the build instructions.

@jdm jdm assigned jdm and unassigned mbrubeck May 2, 2018
@jdm
Copy link
Member

jdm commented May 2, 2018

I'll review this tomorrow.

@jdm
Copy link
Member

jdm commented May 29, 2018

Sorry about the delay; this looks great!
@bors-servo r+

@bors-servo
Copy link
Contributor

bors-servo commented May 29, 2018

📌 Commit a631cb6 has been approved by jdm

@bors-servo
Copy link
Contributor

bors-servo commented May 29, 2018

Testing commit a631cb6 with merge 5d97bc9...

bors-servo added a commit that referenced this pull request May 29, 2018
mach: android install/run: infer adb path from SDK dir

<!-- Please describe your changes on the following line: -->
Infer Android `adb` path from SDK directory in environment variables.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #20219 (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because it is a build script change

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/20421)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented May 29, 2018

💔 Test failed - linux-rel-wpt

@jdm
Copy link
Member

jdm commented Jun 19, 2018

@bors-servo retry

@jdm
Copy link
Member

jdm commented Jun 19, 2018

@bors-servo force

@bors-servo
Copy link
Contributor

bors-servo commented Jun 19, 2018

Testing commit a631cb6 with merge c2d3f2a...

bors-servo added a commit that referenced this pull request Jun 19, 2018
mach: android install/run: infer adb path from SDK dir

<!-- Please describe your changes on the following line: -->
Infer Android `adb` path from SDK directory in environment variables.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #20219 (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because it is a build script change

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/20421)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Jun 19, 2018

@bors-servo bors-servo merged commit a631cb6 into servo:master Jun 19, 2018
3 checks passed
3 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
@bors-servo bors-servo mentioned this pull request Jun 19, 2018
0 of 5 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

6 participants
You can’t perform that action at this time.