Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(350)

Issue 751063002: Allow RunShellCommand to work even with very large commands (Closed)

Created:
6 years ago by perezju
Modified:
6 years ago
Reviewers:
jbudorick
CC:
chromium-reviews, klundberg+watch_chromium.org, yfriedman+watch_chromium.org, jbudorick+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

Allow RunShellCommand to work even with very large commands Currently RunShellCommand may not work if the command passed to adb.Shell is too large (e.g. > 1024). This CL addresses this issue, allowing to run even very large commands, by first writing the command as a shell script and then running it. BUG=436133 Committed: https://crrev.com/b35110e91edb38ec81c84e188b35012492bbcc28 Cr-Commit-Position: refs/heads/master@{#307223}

Patch Set 1 #

Patch Set 2 : less mind-bendy version #

Total comments: 8

Patch Set 3 : no minds bent #

Total comments: 2

Patch Set 4 : clients of DeviceTempFile should pass adb #

Total comments: 15

Patch Set 5 : fixes w.r.t. latest comments #

Total comments: 1

Patch Set 6 : comment implementation of WriteFile #

Unified diffs Side-by-side diffs Delta from patch set Stats (+173 lines, -80 lines) Patch
M build/android/pylib/device/device_utils.py View 1 2 3 4 5 5 chunks +37 lines, -21 lines 0 comments Download
M build/android/pylib/device/device_utils_test.py View 1 2 3 4 5 4 chunks +50 lines, -24 lines 0 comments Download
M build/android/pylib/utils/device_temp_file.py View 1 2 3 1 chunk +23 lines, -15 lines 0 comments Download
M build/android/pylib/utils/device_temp_file_test.py View 1 1 chunk +61 lines, -19 lines 0 comments Download
M build/android/pylib/utils/md5sum.py View 1 2 3 1 chunk +2 lines, -1 line 0 comments Download

Messages

Total messages: 25 (5 generated)
perezju
The code is actually quite simple, and works beautifully, but I know it introduces some ...
6 years ago (2014-11-24 19:40:14 UTC) #2
perezju
Agh, as much as I love the fact that this actually works with such little ...
6 years ago (2014-11-24 20:57:20 UTC) #3
mikecase (-- gone --)
From looking at this code, it looks like if the code.. (1) if the command ...
6 years ago (2014-11-24 20:59:19 UTC) #4
perezju
On 2014/11/24 20:59:19, mikecase wrote: > From looking at this code, it looks like if ...
6 years ago (2014-11-24 22:02:02 UTC) #5
jbudorick
On 2014/11/24 20:57:20, perezju wrote: > Agh, as much as I love the fact that ...
6 years ago (2014-11-24 22:52:05 UTC) #6
perezju
Please have a look. I removed all cyclic dependencies except for a very small one ...
6 years ago (2014-11-25 16:25:33 UTC) #7
jbudorick
https://codereview.chromium.org/751063002/diff/20001/build/android/pylib/device/device_utils.py File build/android/pylib/device/device_utils.py (right): https://codereview.chromium.org/751063002/diff/20001/build/android/pylib/device/device_utils.py#newcode452 build/android/pylib/device/device_utils.py:452: if len(cmd) < 512: We should de-magic 512. "MAX_ADB_COMMAND_LENGTH" ...
6 years ago (2014-11-25 17:05:26 UTC) #8
perezju
https://codereview.chromium.org/751063002/diff/40001/build/android/pylib/device/device_utils.py File build/android/pylib/device/device_utils.py (right): https://codereview.chromium.org/751063002/diff/40001/build/android/pylib/device/device_utils.py#newcode900 build/android/pylib/device/device_utils.py:900: def PushContents(self, contents, device_path, timeout=None, retries=None): Turns out we ...
6 years ago (2014-11-26 10:33:29 UTC) #9
jbudorick
https://codereview.chromium.org/751063002/diff/60001/build/android/pylib/device/device_utils.py File build/android/pylib/device/device_utils.py (right): https://codereview.chromium.org/751063002/diff/60001/build/android/pylib/device/device_utils.py#newcode373 build/android/pylib/device/device_utils.py:373: def _PrepareShellCommand(self, cmd, cwd=None, env=None, as_root=False): Why is this ...
6 years ago (2014-11-27 17:17:34 UTC) #10
perezju
just replying to the comments https://codereview.chromium.org/751063002/diff/60001/build/android/pylib/device/device_utils.py File build/android/pylib/device/device_utils.py (right): https://codereview.chromium.org/751063002/diff/60001/build/android/pylib/device/device_utils.py#newcode373 build/android/pylib/device/device_utils.py:373: def _PrepareShellCommand(self, cmd, cwd=None, ...
6 years ago (2014-11-28 15:39:34 UTC) #11
jbudorick
This CL is continuing a worrying trend of adding more and more complexity to the ...
6 years ago (2014-11-28 18:49:01 UTC) #12
perezju
I'll prepare a new CL on monday. Just quickly replying now to some of the ...
6 years ago (2014-11-28 19:43:37 UTC) #13
perezju
John, ping me when you're online so we can chat a bit more about this. ...
6 years ago (2014-12-02 11:39:06 UTC) #14
jbudorick
On 2014/12/02 11:39:06, perezju wrote: > John, ping me when you're online so we can ...
6 years ago (2014-12-02 15:36:55 UTC) #15
perezju
So, latest changes: - _PrepareShellCommand is no longer split from _RunShellCommand - _WriteFileWithPush(device_path, contents) replaces ...
6 years ago (2014-12-02 16:39:00 UTC) #16
jbudorick
lgtm w/ nit https://codereview.chromium.org/751063002/diff/80001/build/android/pylib/device/device_utils.py File build/android/pylib/device/device_utils.py (right): https://codereview.chromium.org/751063002/diff/80001/build/android/pylib/device/device_utils.py#newcode927 build/android/pylib/device/device_utils.py:927: if not force_push and len(contents) < ...
6 years ago (2014-12-04 15:34:01 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/751063002/100001
6 years ago (2014-12-08 09:52:39 UTC) #21
commit-bot: I haz the power
Committed patchset #6 (id:100001)
6 years ago (2014-12-08 11:37:12 UTC) #22
commit-bot: I haz the power
Patchset 6 (id:??) landed as https://crrev.com/b35110e91edb38ec81c84e188b35012492bbcc28 Cr-Commit-Position: refs/heads/master@{#307223}
6 years ago (2014-12-08 11:37:54 UTC) #23
perezju
6 years ago (2014-12-08 16:58:04 UTC) #24
Message was sent while issue was closed.
A revert of this CL (patchset #6 id:100001) has been created in
https://codereview.chromium.org/773043005/ by perezju@chromium.org.

The reason for reverting is: Broke provision_devices on android perf bots.

Powered by Google App Engine
This is Rietveld 408576698