Skip to content

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

Merged
bors-servo merged 1 commit into
servo:masterfrom
talklittle:issue-20219
Jun 19, 2018
Merged

bors-servo merged 1 commit into
servo:masterfrom
talklittle:issue-20219

Conversation

@talklittle

@talklittle talklittle commented Mar 24, 2018 •

Copy link
Copy Markdown
Contributor

Infer Android adb path from SDK directory in environment variables.


  • 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
Copy Markdown

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

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Mar 24, 2018
@SimonSapin

Copy link
Copy Markdown
Member

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
Copy Markdown
Member

CC @jdm

@talklittle

Copy link
Copy Markdown
Contributor Author

@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
Copy Markdown
Member

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

Copy link
Copy Markdown
Contributor Author

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

jdm commented May 2, 2018

Copy link
Copy Markdown
Member

I'll review this tomorrow.

@jdm

jdm commented May 29, 2018

Copy link
Copy Markdown
Member

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

@bors-servo

Copy link
Copy Markdown
Contributor

📌 Commit a631cb6 has been approved by jdm

@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-awaiting-review There is new code that needs to be reviewed. labels May 29, 2018
@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit a631cb6 with merge 5d97bc9...

bors-servo pushed 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
Copy Markdown
Contributor

💔 Test failed - linux-rel-wpt

@highfive highfive added S-tests-failed The changes caused existing tests to fail. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels May 29, 2018
@jdm

jdm commented Jun 19, 2018

Copy link
Copy Markdown
Member

@bors-servo retry

@jdm

jdm commented Jun 19, 2018

Copy link
Copy Markdown
Member

@bors-servo force

@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit a631cb6 with merge c2d3f2a...

bors-servo pushed 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 -->
@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-tests-failed The changes caused existing tests to fail. labels Jun 19, 2018
@bors-servo

Copy link
Copy Markdown
Contributor

☀️ Test successful - android, arm32, arm64, linux-dev, linux-rel-css, linux-rel-wpt, mac-dev-unit, mac-rel-css1, mac-rel-css2, mac-rel-wpt1, mac-rel-wpt2, mac-rel-wpt3, mac-rel-wpt4, windows-msvc-dev
Approved by: jdm
Pushing c2d3f2a to master...

@bors-servo
bors-servo merged commit a631cb6 into servo:master Jun 19, 2018
@highfive highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Jun 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make android install and run commands infer location of adb from SDK

6 participants