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

Issue 330513007: Fix sourcing envsetup.sh under zsh. (Closed)

Created:
6 years, 6 months ago by rickyz (Google)
Modified:
6 years, 6 months ago
Reviewers:
Nico
CC:
chromium-reviews, klundberg+watch_chromium.org, bulach+watch_chromium.org, yfriedman+watch_chromium.org, ilevy-cc_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

Fix sourcing envsetup.sh under zsh. r262292 moved much of the script under the android_envsetup_main function. Since zsh does not define BASH_SOURCE, SCRIPT_DIR ends up being set to $0, which contains the name of the function. As a result, the various paths are computed incorrectly under when envsetup.sh is sourced from zsh. BUG= Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=276931

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+5 lines, -2 lines) Patch
M build/android/envsetup.sh View 2 chunks +5 lines, -2 lines 0 comments Download

Messages

Total messages: 8 (0 generated)
rickyz (Google)
6 years, 6 months ago (2014-06-12 22:04:43 UTC) #1
Nico
lgtm, but you shouldn't have to source this file for much any more anyways
6 years, 6 months ago (2014-06-12 22:08:36 UTC) #2
rickyz (Google)
On 2014/06/12 22:08:36, Nico (away) wrote: > lgtm, but you shouldn't have to source this ...
6 years, 6 months ago (2014-06-12 22:27:00 UTC) #3
rickyz (Google)
The CQ bit was checked by rickyz@google.com
6 years, 6 months ago (2014-06-12 22:27:02 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rickyz@google.com/330513007/1
6 years, 6 months ago (2014-06-12 22:30:34 UTC) #5
commit-bot: I haz the power
Change committed as 276931
6 years, 6 months ago (2014-06-13 05:15:51 UTC) #6
Nico
On 2014/06/12 22:27:00, Ricky Zhou wrote: > On 2014/06/12 22:08:36, Nico (away) wrote: > > ...
6 years, 6 months ago (2014-06-20 18:13:11 UTC) #7
rickyz (Google)
6 years, 6 months ago (2014-06-23 22:04:25 UTC) #8
Message was sent while issue was closed.
On 2014/06/20 18:13:11, Nico (away) wrote:
> On 2014/06/12 22:27:00, Ricky Zhou wrote:
> > On 2014/06/12 22:08:36, Nico (away) wrote:
> > > lgtm, but you shouldn't have to source this file for much any more anyways
> > 
> > Thanks!  Out of curiosity, is there a newer way to run Android tests locally
> > that I might not know about?
> > 
> > I've been doing:
> > ./build/android/avd.py --abi arm
> > build/android/test_runner.py gtest -s sandbox_linux_unittests
> > 
> > which is why I was sourcing envsetup.sh.
> 
> What goes wrong if you don't source envsetup?

If I don't source envsetup, I get the following error because the script cannot
find adb (I do not have adb on my system other than the copy in
third_party/android_tools/sdk/platform-tools/adb):

% ./build/android/avd.py --abi arm
# 2014-06-23 14:57:06,234: [host]>
/usr/local/google/home/rickyz/chromium_android/src/android_emulator_sdk/sdk/tools/android
list
# 2014-06-23 14:57:18,061: Emulator launch 0 with avd_name=run_tests_avd_0 and
api=19
# 2014-06-23 14:57:18,061: Create AVD command:
/usr/local/google/home/rickyz/chromium_android/src/android_emulator_sdk/sdk/tools/android
--silent create avd --name run_tests_avd_0 --abi armeabi-v7a --target android-19
--sdcard 512M --force
# 2014-06-23 14:57:22,735: [host]> adb devices
Traceback (most recent call last):
  File "./build/android/avd.py", line 96, in <module>
    sys.exit(main(sys.argv))
  File "./build/android/avd.py", line 91, in main
    options.api_level, True)
  File
"/usr/local/google/home/rickyz/chromium_android/src/build/android/pylib/utils/emulator.py",
line 172, in LaunchTempEmulators
    emulator.Launch(kill_all_emulators=n == 0)
  File
"/usr/local/google/home/rickyz/chromium_android/src/build/android/pylib/utils/emulator.py",
line 336, in Launch
    _KillAllEmulators()  # just to be sure
  File
"/usr/local/google/home/rickyz/chromium_android/src/build/android/pylib/utils/emulator.py",
line 92, in _KillAllEmulators
    emulators = android_commands.GetAttachedDevices(hardware=False)
  File
"/usr/local/google/home/rickyz/chromium_android/src/build/android/pylib/android_commands.py",
line 157, in GetAttachedDevices
    'devices'])
  File
"/usr/local/google/home/rickyz/chromium_android/src/build/android/pylib/cmd_helper.py",
line 67, in GetCmdOutput
    (_, output) = GetCmdStatusAndOutput(args, cwd, shell)
  File
"/usr/local/google/home/rickyz/chromium_android/src/build/android/pylib/cmd_helper.py",
line 99, in GetCmdStatusAndOutput
    shell=shell, cwd=cwd)
  File
"/usr/local/google/home/rickyz/chromium_android/src/build/android/pylib/cmd_helper.py",
line 27, in Popen
    preexec_fn=lambda: signal.signal(signal.SIGPIPE, signal.SIG_DFL))
  File "/usr/lib/python2.7/subprocess.py", line 679, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1249, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory
zsh: exit 1     ./build/android/avd.py --abi arm

Powered by Google App Engine
This is Rietveld 408576698