Commit Graph

24 Commits

Author SHA1 Message Date
Mike Frysinger
c17a493bcc setup DEFAULT_BOARD by default
Rather than forcing all consumers of DEFAULT_BOARD to remember to call
get_default_board, just do it for them automatically.

BUG=None
TEST=`cbuildbot {arm,amd64,x86}-generic-full` works
TEST=`./build_packages --help` shows correct default

Change-Id: I8d6ccb83babb2764a50692318eb9193c45fb3b39
Reviewed-on: https://gerrit.chromium.org/gerrit/17868
Reviewed-by: David James <davidjames@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2012-08-14 10:17:31 -07:00
David James
359d3e119d Simplify boilerplate common.sh code in src/scripts.
Currently, the scripts in src/scripts have multiple implementations
for handling when common.sh fails to load, some of which are buggy.
To simplify the boilerplate, these scripts now just exit if common.sh
fails to load. The shell itself will print the following message if
common.sh is not found:
  /usr/lib/crosutils/common.sh: No such file or directory

BUG=chromium-os:32442
TEST=Run these scripts with and without common.sh installed.

Change-Id: Ie54420b6c649774f9cb039c14c80f4cf6c6ebc07
Reviewed-on: https://gerrit.chromium.org/gerrit/27058
Reviewed-by: David James <davidjames@chromium.org>
Tested-by: David James <davidjames@chromium.org>
Commit-Ready: David James <davidjames@chromium.org>
2012-07-12 10:55:37 -07:00
Michael Krebs
11454a191d scripts: Remove call to switch_to_strict_mode
My change in https://gerrit.chromium.org/gerrit/19795 had removed the "set
-e", but https://gerrit.chromium.org/gerrit/17225 re-enabled it --
presumably because that was originally written when the "set -e" was still
there.  The strict mode causes the script to exit when sym_upload fails
(which is often).

BUG=chromium-os:30878
TEST=Basic run of script

Change-Id: I2398341505eb9e375f5cb9e008d6c342e4f3b072
Reviewed-on: https://gerrit.chromium.org/gerrit/22617
Commit-Ready: Michael Krebs <mkrebs@chromium.org>
Tested-by: Michael Krebs <mkrebs@chromium.org>
Reviewed-by: Brian Harring <ferringb@chromium.org>
2012-05-14 17:09:06 -07:00
Mike Frysinger
6b1abb2a6f fix up function style
The "function" keyword is superfluous, not in POSIX, is inconsistent
between bash files, and generally makes me angry.  So convert every
instance to the form:
	foo() {

BUG=None
TEST=`cbuildbot x86-generic-paladin` works

Change-Id: I97f5ca30a3edfef7222b1e08ac23917dc613b556
Reviewed-on: https://gerrit.chromium.org/gerrit/22467
Reviewed-by: David James <davidjames@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2012-05-11 14:10:38 -07:00
Brian Harring
7f175a59e1 common.sh: output a backtrace and debug information on failure.
Currently, if set -e spots a nonzero exit we basically have
no real debug information- it just stops immediately without stating
where or why.  This forces our scripts to be stupidly verbose so
we can track roughly where they were, thus when they fail we can
use that information to localize the rough exit point.

Instead we should be traping that set -e induced exit and
outputing necessary debug information to run it down.  This includes
outputing the relevant stack trace, or at least what we can get of
it.

The 'die' function is now enhanced to automatically dump the trace
that lead to it.  For most consumers this is desired- however for
commandline parsing induced dies ("--board is missing" for example),
the trace is noise.  For those cases, a 'die_notrace' function was
added that retains the original non-backtrace behaviour.

Example output via instrumenting cros_generate_breakpad_symbols
w/ the failing command '/bin/false' (nonzero exit code).

Before:
./cros_generate_breakpad_symbols  monkeys --board=x86-alex
<no output at all, just exit code 1>

With this CL:
./cros_generate_breakpad_symbols  monkeys --board=x86-alex
ERROR   : script called: ./cros_generate_breakpad_symbols 'monkeys' '--board=x86-alex'
ERROR   : Backtrace:  (most recent call is last)
ERROR   :   file cros_generate_breakpad_symbols, line 207, called: main 'monkeys' '--board=x86-alex'
ERROR   :   file cros_generate_breakpad_symbols, line 163, called: die_err_trap '/bin/false' '1'
ERROR   :
ERROR   : Command failed:
ERROR   :   Command '/bin/false' exited with nonzero code: 1

BUG=chromium-os:30598
TEST=inject a failing command into a script, verify the output.
TEST=inject a 'command not found', verify the output
TEST=cbuildbot x86-generic-full --remote
TEST=cbuildbot arm-tegra2-full --remote
TEST=cbuildbot chromiumos-sdk --remote

Change-Id: I517ffde4d1bb7e2310a74f5a6455b53ba2dea86c
Reviewed-on: https://gerrit.chromium.org/gerrit/17225
Reviewed-by: Brian Harring <ferringb@chromium.org>
Tested-by: Brian Harring <ferringb@chromium.org>
Commit-Ready: Brian Harring <ferringb@chromium.org>
2012-05-07 17:19:41 -07:00
Michael Krebs
dc7b317587 scripts: Sleep for 200ms between symbol uploads
To avoid looking like we're DoS'ing the symbol server, force a delay between
symbol uploads.  If this becomes a bottleneck for buildbots, this should be
modified to only upload symbol files that have changed, by checking against
the buildbot's previous debug.tgz.

BUG=chromium-os:26596
TEST=Manually ran upload_symbols against staging symbol server

Change-Id: Iecf11e26a70f0c44838fb13e2ebc6ebb78336c50
Reviewed-on: https://gerrit.chromium.org/gerrit/19566
Commit-Ready: Michael Krebs <mkrebs@chromium.org>
Reviewed-by: Michael Krebs <mkrebs@chromium.org>
Tested-by: Michael Krebs <mkrebs@chromium.org>
2012-04-25 18:41:47 -07:00
Michael Krebs
a7056f1b07 buildbot scripts: Increase number of retries for uploading
Delay up to 63 seconds when trying to upload a symbol file.  My default of
15 seconds before turned out to not be enough to cover at least one case
that davidjames@ found in ToT buildbots.

BUG=chromium-os:29963
TEST=Ran upload_symbols --testing

Change-Id: I82b038f8845c3f2aaba0ee95f40efd4b70e2ffb1
Reviewed-on: https://gerrit.chromium.org/gerrit/21016
Commit-Ready: Michael Krebs <mkrebs@chromium.org>
Tested-by: Michael Krebs <mkrebs@chromium.org>
Reviewed-by: David James <davidjames@chromium.org>
2012-04-24 21:04:18 -07:00
Michael Krebs
c91d3ebb17 scripts: Show an error if a symbol file is too big
If the symbol file to be uploaded to the symbol server is close to the limit
at which the symbol server will reject it, show an error so we can do
something about it before it's too late.  This also prints the special
"@@@STEP_WARNINGS@@@" line to make the buildbot show the step as orange.

BUG=chromium-os:19194
TEST=Manually ran upload_symbols to make sure it worked with/without an error

Change-Id: I7942ba20f7bc83d66036f9f9fe66403083b1a1f1
Reviewed-on: https://gerrit.chromium.org/gerrit/20664
Commit-Ready: Michael Krebs <mkrebs@chromium.org>
Tested-by: Michael Krebs <mkrebs@chromium.org>
Reviewed-by: David James <davidjames@chromium.org>
2012-04-20 19:39:31 -07:00
Michael Krebs
44a3b35f44 scripts: Don't exit when the sym_upload command fails
My previous commit fixed a presumed oversight where the "set -e"
functionality had been disabled for the upload_file() function.  But
enabling it caused a problem for when sym_upload failed to upload the file
-- which is why I had written all that retry code in the first place.  We
could trap the shell's "ERR" signal instead of exiting, but rather than
complicating the script too much, I'm just removing the check.

I also added a rudimentary testing mode to the script.  I had a basic one
that I used locally, but when I had to expand it to mimic a non-zero exit
status, etc. I figured I might as well productize it.  This can be enabled
by passing "--testing" as the first argument to the script.

BUG=chromium-os:29103
TEST=Ran with new --testing option and various parameters

Change-Id: Ia10b4225d2db026839730510b31f7f4cdd101b98
Reviewed-on: https://gerrit.chromium.org/gerrit/19795
Tested-by: Michael Krebs <mkrebs@chromium.org>
Reviewed-by: David James <davidjames@chromium.org>
Commit-Ready: Michael Krebs <mkrebs@chromium.org>
2012-04-17 14:44:23 -07:00
Michael Krebs
fbc6ca69fd scripts: Retry uploading symbol files
If there's an error uploading a symbol file, retry it up to four times
before giving an error.

BUG=chromium-os:28985
TEST=Manually ran upload_symbols to make sure it worked with/without errors

Change-Id: Ia2159d96d0fae9042c81147249986e39f05ca398
Reviewed-on: https://gerrit.chromium.org/gerrit/19625
Commit-Ready: Michael Krebs <mkrebs@chromium.org>
Tested-by: Michael Krebs <mkrebs@chromium.org>
Reviewed-by: David James <davidjames@chromium.org>
2012-04-05 17:39:41 -07:00
Michael Krebs
32294abc01 scripts: Increase size limit at which CFI is stripped
Crash server file size limit has been increased to 300MB

BUG=chromium-os:23765
TEST=Manually ran upload_symbols for chrome.sym

Change-Id: I9c683ad057abda1f8df7550243cd5c870228257c
Reviewed-on: https://gerrit.chromium.org/gerrit/19569
Commit-Ready: Michael Krebs <mkrebs@chromium.org>
Tested-by: Michael Krebs <mkrebs@chromium.org>
Reviewed-by: Eric Blake <eblake@chromium.org>
2012-04-03 21:30:42 -07:00
Brian Harring
aa13ea4658 Shift crosutils scripts to use the common.sh they were written against.
Rather than trying to use an old/stale common.sh, use the common.sh
from the invocation point- if invoked via /usr/lib/crosutils, use that
common.sh.  If invoked via src/scripts/, use that, etc.

Trying to intermix it just introduces potential for bugs and invalidly
freezes common.sh api, thus the efforts to revert this and ultimately
revert the existing of a crosutils ebuild.

BUG=chromium-os:27201
TEST=cbuildbot x86-generic-full

Change-Id: I4c6c5fbade3d28c71752bd4c44dccad49af52ec0
Reviewed-on: https://gerrit.chromium.org/gerrit/18303
Reviewed-by: David James <davidjames@chromium.org>
Commit-Ready: Brian Harring <ferringb@chromium.org>
Tested-by: Brian Harring <ferringb@chromium.org>
2012-03-15 23:35:06 -07:00
Ken Mixter
d8f9130863 scripts: fall back to linkage symbols when debug info not present
dump_syms bails if you give it a debug info path and the file there
does not have debug info, instead of falling back to dumping
public/linkage symbols (and more importantly, call frame info).
Give it the chance to redeem itself.

Also, instead of not ever uploading CFI for x86 modules, strip it
for any architecture but only when the file is above some
threshold.

BUG=chromium-os:22373 chromium-os:22741

Change-Id: Iad6981efec537868296a6713b1d9ca0cdb750d28
Reviewed-on: https://gerrit.chromium.org/gerrit/11443
Commit-Ready: Ken Mixter <kmixter@chromium.org>
Reviewed-by: Ken Mixter <kmixter@chromium.org>
Tested-by: Ken Mixter <kmixter@chromium.org>
2011-11-09 18:27:05 -08:00
Ken Mixter
243590f4ba crosutil: automatically strip CFI when uploading x86 symbols
BUG=chromium-os:21030 chromium-os:21417
TEST=test uploads with ARM and x86 targets
test that Chrome symbols are ~87M when stripped down from ~160MB

Change-Id: I9207b3f6a5b757ffa58468c58b4440467dc44738
Reviewed-on: http://gerrit.chromium.org/gerrit/8777
Reviewed-by: David James <davidjames@chromium.org>
Reviewed-by: Michael Krebs <mkrebs@chromium.org>
Reviewed-by: Ken Mixter <kmixter@chromium.org>
Tested-by: Ken Mixter <kmixter@chromium.org>
Commit-Ready: Ken Mixter <kmixter@chromium.org>
2011-10-11 10:00:48 -07:00
Chris Sosa
c2a60e2e03 Another copyright fix to test the Commit Queue.
BUG=None
TEST=Visual inspection

Change-Id: I5e3911fca26386a8eea4cc77dd6603b3631a02a4
Reviewed-on: http://gerrit.chromium.org/gerrit/7143
Reviewed-by: Chris Sosa <sosa@chromium.org>
Tested-by: Chris Sosa <sosa@chromium.org>
2011-09-02 03:24:51 -07:00
Brian Harring
d5d5dbffa1 Fix/standardize exiting if common.sh can't be found
The problem here is that most were doing their exiting w/in a subshell;
exit within a subshell kills the subshell, not the parent.  Not all scripts
were using set -e (which would pick up the failing subshell); as such
just rewriting them to remove the potential via eliminateing the subshelling.

Beyond that, removed a couple of custom (working, although non-standard)
approaches, and removed a duplicate common.sh sourc'ing w/in mk_memento_images.sh

TEST=force 'find_common_sh' to fail, note the scripts fails to exit
BUG=none

Change-Id: Ia1108a091a6399ad6aedd3cade4a107f4411686c
Reviewed-on: http://gerrit.chromium.org/gerrit/3905
Reviewed-by: Brian Harring <ferringb@chromium.org>
Tested-by: Brian Harring <ferringb@chromium.org>
2011-07-22 12:06:59 -07:00
Greg Spencer
798d75f3be This starts to fix the scripts so that they load from /usr/lib/crosutils
from within the chroot.

It also fixes a number of style issues.

It changes the meaning of cros_workon "list-all" to list all available
packages, and adds "list-live" to list all live packages.

It changes things that load chromeos-common.sh from the installer to
load it from /usr/lib/installer.

BUG=chromium-os:4230
TEST=synced, rebuilt chroot, made packages, made images, built chrome
from source, and wrote an image to a USB stick.

Review URL: http://codereview.chromium.org/6240018

Change-Id: I90c34420af1a64020402bafef8e9e77f56837c02
2011-02-01 22:04:49 -08:00
Ken Mixter
f5adf798f0 crosutils: Detect sym_upload errors by its stdout instead of return value
Change-Id: If649d355f3d9cb2650613e4eb6d34813216c0b61

BUG=7516
TEST=Change hardcoded URL to illegal URL and verify symbol sends fail

Review URL: http://codereview.chromium.org/3635001
2010-10-07 17:54:04 -07:00
Ken Mixter
8899d5a90b Store away breakpad symbols in debug.tgz
BUG=5355

Change-Id: I1f6dff3808c5bfaf4b7ed6ba75e4d19b196d749c

Review URL: http://codereview.chromium.org/3166029
2010-08-25 09:17:38 -07:00
Ken Mixter
bc69d7bae4 Utility to generate minidump symbols for developer diagnostics
BUG=4882, 4886

Review URL: http://codereview.chromium.org/2825054
2010-08-12 17:03:47 -07:00
Ken Mixter
10b62483ec Use hard host depends emerged breakpad binaries
BUG=3437

Review URL: http://codereview.chromium.org/2873037
2010-07-09 12:55:47 -07:00
David McMahon
edf039490e Use --official_build boolean.
Review URL: http://codereview.chromium.org/2843051
2010-07-07 12:48:36 -07:00
Ken Mixter
0fafa9edfc Fix problems with return codes
BUG=4112

Review URL: http://codereview.chromium.org/2819021
2010-06-23 14:41:37 -07:00
Ken Mixter
7d724559be Add symbol uploader
Review URL: http://codereview.chromium.org/2812012
2010-06-22 15:56:17 -07:00