Open
Bug 1482008
Opened 6 years ago
Updated 2 years ago
Enable all tests in adb_test.js on Windows
Categories
(DevTools :: about:debugging, enhancement, P3)
DevTools
about:debugging
Tracking
(Not tracked)
NEW
People
(Reporter: hiro, Unassigned, NeedInfo)
References
Details
Attachments
(4 files)
We will skip three test cases in test_adb.js on Windows in bug 1469054.
This bug is for the purpose of enabling them.
Reporter | ||
Comment 1•6 years ago
|
||
I had totally forgotten that Windows doesn't have fork(). We should add another python module (adb-server.py?) and use spawn with P_DETACH instead.
[1] https://docs.python.org/2.6/library/os.html#os.P_DETACH
Reporter | ||
Comment 2•6 years ago
|
||
Another problem I noticed is that it seems that 'adb.exe' should be a binary on Windows, in the test cases we use a python script 'adb.py' as 'adb.exe', it can't be launched.
I'd want to avoid modifying implementation only for the test cases, so I did start writing a simple program in C++ that the program uses nsIProcess.run, but it needs to link libxul.so and I haven't succeeded to do that.
This morning, I came up with another idea that is to write the program in Rust! It should work.
Reporter | ||
Comment 3•6 years ago
|
||
While writing the rust program on Windows, I noticed on Windows we need to run adb-server.py with 'Python.exe' because I guess shebang doesn't work on Windows either. So we can probably write the program in Python rather than Rust.
Reporter | ||
Comment 4•6 years ago
|
||
'adb.py' which is pretending 'adb.exe' doesn't work on Windows because Windows thinks the 'adb.exe' is a 16-bit apllication so that it cannot be launched on Windows 64. Instead the Rust program works fine there. A rest of issues is how to build the Rust program in our tree.
Reporter | ||
Comment 5•6 years ago
|
||
The Rust binary worked fine on Windows;
https://treeherder.mozilla.org/#/jobs?repo=try&revision=fedfd032d93c759f2032501ae2086c3df476f982&selectedJob=194227632
But it failed to build on MacOSX.
https://treeherder.mozilla.org/#/jobs?repo=try&revision=fedfd032d93c759f2032501ae2086c3df476f982&selectedJob=194222595
Reporter | ||
Comment 6•6 years ago
|
||
(In reply to Hiroyuki Ikezoe (:hiro) (PTO on Aug 20) from comment #5)
> But it failed to build on MacOSX.
> https://treeherder.mozilla.org/#/
> jobs?repo=try&revision=fedfd032d93c759f2032501ae2086c3df476f982&selectedJob=1
> 94222595
The error is;
error: failed to run dsymutil: No such file or directory (os error 2)
And it seems to be the same as bug 951758.
And from a comment by Ted in bug 951758 comment 3;
> Comments in the clang source indicate that it runs dsymutil when you compile and link in one command line (like `clang -o foo foo.cpp`) because otherwise the debug info would be lost in the temp object file:
So I guess, if we build the adb fake binary as an opt build even if it's on debug build, we can avoid the error.
Reporter | ||
Comment 7•6 years ago
|
||
I did split the single source file (adb.rb) into two files, but it still failed [1].
https://treeherder.mozilla.org/#/jobs?repo=try&author=hikezoe@mozilla.com&selectedJob=195004452
Reporter | ||
Comment 8•6 years ago
|
||
Cross-compiling the adb binary for MacOSX works fine with a patch for bug 1417646, but there is another failure in repackage job;
https://treeherder.mozilla.org/#/jobs?repo=try&revision=ad80893bf1e76de1cfc24b02350d7ecb48e69de0&selectedJob=195436341
Reporter | ||
Comment 9•6 years ago
|
||
Finally I found a workaround to avoid the "KeyError: u'RUST_TARGET" on L10n or Rpk jobs in bug 1341041 comment 3. It's `CONFIG['COMPILE_ENVIRONMENT']` check.
https://treeherder.mozilla.org/#/jobs?repo=try&revision=273a9c930ce95753cd5940ab639447b3881050fb
Reporter | ||
Comment 10•6 years ago
|
||
The fake adb binary just spawns adb-server.py which is a mock of adb for
automation tests.
Originally the python script was supposed to be spawned as 'adb.exe' from JS on
Windows but it didn't work for some reasons (exe file should have specific
header, I guess). So here we introduce a Rust program behaves just like what
'adb start-server' does.
Reporter | ||
Comment 11•6 years ago
|
||
Depends on D5486
Reporter | ||
Comment 12•6 years ago
|
||
Also rename adb.py to adb-server.py since now it just behaves as an adb server.
Depends on D5487
Reporter | ||
Comment 13•6 years ago
|
||
Depends on D5488
Comment 14•6 years ago
|
||
Comment on attachment 9007945 [details]
Bug 1482008 - Use readInputStream instead of readInputStreamString to support binary files. r=jdescottes
Julian Descottes [:jdescottes][:julian] has approved the revision.
Attachment #9007945 -
Flags: review+
Comment 15•6 years ago
|
||
Comment on attachment 9007946 [details]
Bug 1482008 - Use the fake adb binary in tests. r=jdescottes
Julian Descottes [:jdescottes][:julian] has approved the revision.
Attachment #9007946 -
Flags: review+
Comment 16•6 years ago
|
||
Comment on attachment 9007947 [details]
Bug 1482008 - Enable testStartAndStop and testTrackDevices on Windows. r=jdescottes
Julian Descottes [:jdescottes][:julian] has approved the revision.
Attachment #9007947 -
Flags: review+
Comment 17•6 years ago
|
||
Comment on attachment 9007944 [details]
Bug 1482008 - Build a fake adb binary written in Rust. r=glandium
Mike Hommey [:glandium] has approved the revision.
Attachment #9007944 -
Flags: review+
Updated•6 years ago
|
Priority: -- → P3
Comment 18•6 years ago
|
||
This bug has not been updated in the last 3 months. Resetting the assignee field.
Please, feel free to pick it up again and add a comment outlining your plans for it if you do still intend to work on it.
This is just trying to clean our backlog of bugs and make bugs available for people.
Assignee: hikezoe → nobody
Status: ASSIGNED → NEW
Comment 19•6 years ago
|
||
There are some r+ patches which didn't land and no activity in this bug for 2 weeks.
:hiro, could you have a look please?
Flags: needinfo?(hikezoe)
Reporter | ||
Comment 20•6 years ago
|
||
Huh, I don't recall what the blocker was for landing... Will check later.
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•