Commit Graph

4255 Commits

Author SHA1 Message Date
Nick Glorioso 8a7b25c736 Update warn.py for new Error Prone diagnostics
Test: Local build, tee'd to file, ran warn.py and checked output HTML
Change-Id: Iee3386e88c73e4b8e0a1fcc60105ee5fb86e3cb0
2016-11-22 10:35:07 -08:00
Treehugger Robot 052a01958c Merge "fs_config: move sort to be consistent with other sort" 2016-11-18 00:29:53 +00:00
William Roberts 8cb6a1893e fs_config: move sort to be consistent with other sort
Test: Checked diff and hash of before and after output files, same.
Test: Tested build for basic boot and functionality.
Change-Id: If7806427e3a2a9ddb7a2c9aa14e1e4f9bf696acf
Signed-off-by: William Roberts <william.c.roberts@intel.com>
2016-11-17 14:18:38 -08:00
William Roberts db616f0091 fs_config: correct README
Testing on earlier versions of Python indicated an error in the
README. Python's ConfigParser prior to version 3.2 allows for
sections within the same file to override later sections.
Correct the README.

Test: Checked diff and hash of output file from before and after.
Change-Id: Ifd3f78414b4803e4b74decb1fdf6816d4902c4a2
Signed-off-by: William Roberts <william.c.roberts@intel.com>
2016-11-17 13:10:55 -08:00
Chih-Hung Hsieh 76d0065ef8 Separate parallel_classify_warnings out of parse_input_file.
* Allow other callers of this module to:
  * pass any input stream to parse_input_file,
  * pass any warning_lines to parallel_classify_warnings,
  * call dump_csv or dump_html to get output.
* No output change.
* Capture and ignore signal.SIGTERM at the end,
  to avoid bad warning/error messages from the exit clean-up process.

Test: run warn.py build.log.
Change-Id: I1414797a536c0ee622e2a34c226578621be1ddab
2016-11-09 18:19:05 -08:00
Billy Lamberta 4d41e26a54 Creates a css nowrap class for non-breaking elements
in source.android.com
Test: build2stage 36

Change-Id: I467cc66d5e205b00ed188180140b1ae972e2ebad
2016-11-09 21:17:41 +00:00
Tao Bao e95540e060 releasetools: Use java_path in sign_target_files_apks.py.
Prior to this CL, it was calling the hard-coded "java" although it was
accepting a "--java_path" option.

Also switch OPTIONS.java_args from string to list. Otherwise it won't
work when providing multiple args.

Bug: 32737832
Test: Specify "--java_path=" and "--java_args" when invoking
      sign_target_files_apks.py with "-v". Check the commands being
      called.
Change-Id: Id7ef98e778646d532027434de7fba9b7a104dbd0
2016-11-08 12:48:43 -08:00
Tao Bao 49758959f2 Merge "releasetools: compare size between compressed and patch while build otapackage" 2016-11-05 00:09:35 +00:00
Tao Bao b9bd78d110 Merge "releasetools: Make BBOTA incremental generation repeatable." 2016-11-04 21:26:13 +00:00
Colin Cross 7829ebfebd findleaves.py: prevent recursion into symlink loops
Keep a set of all visited inodes, and prevent recursing into a symlink
to an already visited inode.

Test: m -j
Test: compare `build/tools/findleaves.py --prune=.repo --prune=.git --mindepth=2 --dir=. Android.mk` before and after
Change-Id: Ied14c40d3066ef9f8e8a2b1535f56f7bbbbd0ab6
2016-11-03 14:29:40 -07:00
Chih-Hung Hsieh 63de300094 Do not use multiprocessing.Pool when --processes=1.
Purpose of this change is not to save some execution time,
but to avoid forking another process. In other applications
that use a wrapper to call this python script, it is difficult
to get overwritten file I/O functions work in a subprocess.
So the wrapper will call warn.py with --processes=1.

Test: run "warn.py --processes=1 build.log"
Change-Id: I5998d5c70d81a456c86eb4002f444a4a60135477
2016-10-28 10:53:34 -07:00
Tao Bao 3348228423 releasetools: Make BBOTA incremental generation repeatable.
set() doesn't keep elements according to the order of insertion. So
Transfers managed with set() in intermediate steps may not appear in the
same order across runs. This leads to slightly different output packages
when generating the same incremental OTA.

This CL fixes the issue by replacing set() with OrderedDict() in
blockimgdiff.GenerateDigraph() and blockimgdiff.FindVertexSequence().

It also adds a testcase that ensures blockimgdiff.GenerateDigraph()
preserves the insertion order for Transfer.goes_after set.

Bug: 32220816
Test: ota_from_target_files.py gives identical package when running
multiple times.

Change-Id: I56d551e5ca926993ab46896e33c80e0ce42e506a
2016-10-26 09:40:50 -07:00
Tao Bao 02d2d68aec Merge "releasetools: Support verity signer args." 2016-10-24 18:50:14 +00:00
YOUNG HO CHA ccc5c40523 releasetools: compare size between compressed and patch while build otapackage
Currently, whether contains patch or verbatim, compute with file size
and patch size.
But ota file must be compressed with zip, so it should be better with
compressed size than uncompressed.

Test: aosp_shamu-user build without proprietary blobs between MOB30P and NRD90S
$ du -k ota_shamu_old.zip ota_shamu_new.zip
217252	ota_shamu_old.zip
216520	ota_shamu_new.zip

Change-Id: If68cb1fbe2f7815067451915a0dcfe93ea5ba8d6
Signed-off-by: YOUNG HO CHA <ganadist@gmail.com>
2016-10-18 17:27:09 +09:00
Treehugger Robot 92396e1747 Merge "Use parallel subprocesses to classify warnings." 2016-10-18 03:49:49 +00:00
Chih-Hung Hsieh a6bd044ac1 Use parallel subprocesses to classify warnings.
* Add a --processes flag to specify number of parallel processes,
  with default multiprocessing.cpu_count().
* Wrap long line to suppress pylint warning.

Test: run warn.py with a large build.log file.
Change-Id: I9a93a9324bc531c1bce741367013051ce40a67fa
2016-10-17 17:47:20 -07:00
Tao Bao 458104266f releasetools: Support verity signer args.
system/extras/verity/build_verity_metadata.py now accepts
"--signer_args" to specify verity signer args.

Also remove the duplicate "--verity_signer_args" in
add_img_to_target_files.py, as we already have that in common.py.

Bug: 31500665
Test: Building and signing work w/ and w/o --signer_args.

Change-Id: I02f59c50a1ebf15c5505e9fffd5b9bbbbaa785be
2016-10-17 16:25:22 -07:00
Stephen Hines d0aec89d43 Split apart frameworks/compile into sub-projects.
These projects are all used by RenderScript, but it would be good to
differentiate warnings for each.

Change-Id: I983279d590630175a36075b01e8eec9100c07d26
Test: Ran warn.py
2016-10-17 15:40:38 -07:00
Mark Salyzyn 404fd5bc4a zipalign missing header
Remove assumptions about header side effects

Test: compile
Bug: 30465923
Change-Id: I117567b0f99814b9d9a955b39c56f43f7972cf62
2016-10-17 12:22:44 -07:00
Chih-hung Hsieh 8ef4397c22 Merge "Add more patterns for a finer project warning list." 2016-10-15 01:36:59 +00:00
Sasha Levitskiy 4a34533e11 build: tools: Add json collection of installed files with hashes.
Adds installed-files.json in addition to installed-files.txt
Further sorts the file list to be ordered within the same size bucket.

Test: manual, cross-checked checksums with sha256sum utility
      checked build outputs.

Bug: 19988819
Merged-in: Ifb632eb4df65ec48645c8f93e36bae44ccc52ba8
Change-Id: Ifb632eb4df65ec48645c8f93e36bae44ccc52ba8
Signed-off-by: Sasha Levitskiy <sanek@google.com>
2016-10-14 16:29:16 -07:00
Chih-Hung Hsieh 144864eed0 Add more patterns for a finer project warning list.
Bug: 31377083
Test: run warn.py --byproject build.log
Change-Id: I3cad8e24bc97a84f067a162ff728e30fde3c7197
2016-10-14 12:27:17 -07:00
Alex Deymo 3b54b69205 Merge changes Ie3d82cfa,I2f808896,I587f400d
* changes:
  fat16copy: Fix allocation logic when extending directories.
  fat16copy: Sort new directory entries.
  Make fat16copy.py add . and .. entries to directories
2016-10-14 03:19:55 +00:00
Clay Murphy f8d8458edd Merge "Update droiddoc templates for build/make move" 2016-10-12 18:34:23 +00:00
Treehugger Robot 6949e7ecba Merge "Better pattern matching and dump of warning messages." 2016-10-12 16:35:34 +00:00
Dan Willemsen 82be5468c3 Update droiddoc templates for build/make move
Since build/ was moved to build/make/, the droiddoc templates now need
another ../ to reach the android root.

Test: m online-sac-docs
Change-Id: I2393f6c791df9b67ccafb4eb047fd8ccc52481cb
2016-10-12 00:10:33 -07:00
Chih-Hung Hsieh 5722f9247b Better pattern matching and dump of warning messages.
* Warning messages must start with source file path.
  This will reject lines containing only 'warning:'
  but not a source file path prefix.
* Escape both backslash and quotation marks in the
  dump of strings to JavaScript string literals.

Bug: 32060052
Test: run through build.log files
Change-Id: Ib064768b1ba2954f974604ea054f7a6d2ad15ae7
2016-10-11 15:33:19 -07:00
Chih-Hung Hsieh a45c5c1cf9 Normalize warning source file path to relative path.
Remove Android root directory path from long
absolute source file path.

Test: run warn.py with build.log
Bug: 32059187
Change-Id: Ib630cebd8c56a9fef443139ca502d97e59c7b42e
2016-10-11 15:30:26 -07:00
Treehugger Robot b37e81d3cd Merge "Fix a nullness warning." 2016-10-11 19:29:37 +00:00
Treehugger Robot f943e138d7 Merge "Fix an uninitialized value warning." 2016-10-11 02:43:47 +00:00
Yunlian Jiang 221c1c027a Fix an uninitialized value warning.
Warning from the static analyzer:

build/tools/zipalign/ZipFile.cpp:503:5: warning: Function call argument
is an uninitialized value
pEntry->setDataInfo(uncompressedLen, endPosn - startPosn, crc,

Specifically, it's referencing `crc`, which would be uninitialized if we
hit either of these two error cases, since we'd return `NO_ERROR`.

Note that the warning is still there, but that's only because the static
analyzer can't see the asserts. If we #undef NDEBUG in the file, then
the warning disappears.

Bug: none
Test: With NDEBUG undefined, the warning is gone.
Change-Id: Iaed66127746c38add2c842ab027f2e1982d0e2fd
2016-10-10 17:31:06 -07:00
Chih-hung Hsieh 89244619ad Merge "Add a new ANALYZER severity group." 2016-10-05 23:31:43 +00:00
Dan Willemsen 4c364620ac Add tool to run kati for all products
Test: get_build_var all_named_products
Test: build/tools/kati_all_products.sh
Change-Id: I3496cb4c59a1edb11c9149b95ecabd3a828b8972
2016-10-05 14:04:21 -07:00
Chih-Hung Hsieh 1eabb0ecb2 Add a new ANALYZER severity group.
* Separate clang-tidy's clang-analyzer-* warnings from
  other clang-tidy warnings.

Bug: 31559947
Test: build with WITH_TIDY=1 and DEFAULT_GLOBAL_TIDY_CHECKS=*,-readability-*,-google-readability-*
Change-Id: If03c421c9319741ef6588bc0d803b6da0cc4433a
2016-10-05 11:53:20 -07:00
Yunlian Jiang 4f1a91cbac Fix a nullness warning.
This silences a warning null pointer passed as an argument to a
'nonnull' parameter

BUG=None
Test: The warning is gone.

Change-Id: I10a17d4674bfb373d7fe8666863abd5f10a4d11f
2016-10-05 10:52:35 -07:00
David Zeuthen 70209ad9f0 Merge "Make room for AVB hashtree and metadata." 2016-10-04 22:32:27 +00:00
David Zeuthen 4014a9daa7 Make room for AVB hashtree and metadata.
While the system.img images currently built with AVB support verify
correctly, mounting the filesystem content fails. This is because
'avbtool add_hashtree_footer' used to claim some of the unused /
DONT_CARE space for stashing the verity tables and this resulting in the
mapped device ending up being smaller causing the mount failure.

Fix this by leaving enough room for AVB hashtree and metadata before
building the image. This is achieved by moving the AVB hashtree support
into build_image.py and using a just added '--calc_max_image_size'
option to 'avbtool add_hashtree_footer' to figure out how much space to
leave out.

This depends on https://android-review.googlesource.com/#/c/281821/

Bug: 31264226
Test: Mounting dm-verity set up from system.img now works.

Merged-In: I4c5de1004c1059f8c582e76b3b8517d427aa1a87

Change-Id: I945a5f1f6782791736cd319f216cfa6b448fb04d
2016-10-04 17:32:16 -04:00
Przemyslaw Szczepaniak a8c8dadd09 Merge "Fix for non-empty a[name] tags in openJdk based javadocs." 2016-10-04 11:35:58 +00:00
Przemyslaw Szczepaniak 4bce2866fb Fix for non-empty a[name] tags in openJdk based javadocs.
openJdk based android javadoc contains <a name=... tags
that are non-empty. Currently they are being hidden,
causing badly formatted pages for some java.* classes
(missing text and random whitespace blocks).

This change makes the existing a[name] hiding rule
apply only to empty tags.

Test: make docs
Bug: 31700998
Change-Id: Ifa75bbabe308d7aed0cce6165c1113e5a382a121
(cherry picked from commit a7edd92c45)
2016-10-04 10:31:54 +00:00
Colin Cross 49c45aecc4 Propagate signals through makeparallel
Set up a signal handler in makeparallel that will forward SIGHUP,
SIGINT, SIGQUIT, and SIGTERM to the child process.

Bug: 31907490
Test: m -j & killall make; pgrep -a ninja
Test: make makeparallel_test
Change-Id: I306e5335ed1b2c7056804d5da377a2f283877f30
2016-10-03 15:33:11 -07:00
Tao Bao 9aa4b9b1b6 releasetools: Clean up sign_target_files_apks.py.
Remove the obsolete workaround for API 24. Also make it pylint clean.

Test: 1. Sign a target_files.zip and get identical results.
      2. `pylint --rcfile=pylintrc sign_target_files_apks.py` gives 10.00/10.

Change-Id: I21736f959c5182486fd8ccebea9bbc594edef9fb
2016-09-30 15:29:09 -07:00
Tao Bao b31b94e159 releasetools: Fix the reference to OPTIONS.info_dict.
sign_target_files_apks.py calls common.GetBootableImage() but without
calling 'OPTIONS = common.OPTIONS' first. In common.GetBootableImage(),
we should use the local info_dict parameter instead of OPTIONS.info_dict.

Test: sign_target_files_apks.py generates signed-TF.zip successfully.

Change-Id: Ia3d32b88691c26e5fb98feea709e3e3c3eb70fdb
2016-09-29 22:04:50 -07:00
David Zeuthen 8ee6d119d1 Merge "Update for new Android Verified Boot (AVB)." 2016-09-29 17:48:40 +00:00
David Zeuthen 2ce63edab7 Update for new Android Verified Boot (AVB).
This updates the build system for the new Android Verified Boot
codebase. As this is based on Brillo Verified Boot, this change replaces
the existing BVB support.

Android Verified Boot is enabled by the BOARD_AVB_ENABLE variable

 BOARD_AVB_ENABLE := true

This will make the build system create vbmeta.img which will contain a
hash descriptor for boot.img, a hashtree descriptor for system.img, a
kernel-cmdline descriptor for setting up dm-verity for system.img and
append a hash-tree to system.img.

Additionally, the descriptors are left in boot.img and system.img so a
third party can create their own vbmeta.img file linking - using the
option --chain_partition - to these images. If this is not needed
footers can be erased using the 'avbtool erase_footer' command. It's
also harmless to just leave them in the images.

By default, the algorithm SHA256_RSA4096 is used with a test key from
the AVB source directory. This can be overriden by the
BOARD_AVB_ALGORITHM and BOARD_AVB_KEY_PATH variables to use e.g. a
4096-bit RSA key and SHA-512:

 BOARD_AVB_ALGORITHM := SHA512_RSA4096
 BOARD_AVB_KEY_PATH := /path/to/rsa_key_4096bits.pem

To prevent rollback attacks, the rollback index should be increased on a
regular basis. The rollback index can be set with the
BOARD_AVB_ROLLBACK_INDEX variable:

 BOARD_AVB_ROLLBACK_INDEX := 5

If this is not set, the rollback index defaults to 0.

The variable BOARD_AVB_MAKE_VBMETA_IMAGE_ARGS can be used to specify
additional options passed to 'avbtool make_vbmeta_image'. Typical
options to be used here include '--prop', '--prop_from_file', and
'--chain_partition'.

The variable BOARD_AVBTOOL_BOOT_ADD_HASH_FOOTER_ARGS can be used to
specify additional options passed to 'avbtool add_hash_footer' for
boot.img. Typical options to be used here include '--hash_algorithm' and
'--salt'.

The variable BOARD_AVBTOOL_SYSTEM_ADD_HASHTREE_FOOTER_ARGS can be used
to specify additional options passed to 'avbtool add_hashtree_footer'
for systems.img. Typical options to be used here include
'--hash_algorithm', '--salt', and '--block_size'.

BUG=31264226
TEST=Manually tested on edison-eng by inspecting {boot, system,
  vbmeta}.img in out/ directory as well as their counterparts in
  the IMAGES/ directory of edision-target_files-eng.zeuthen.zip

Merged-In: Ic9a61cfc65c148b12996e57f04da5432eef6b982

Change-Id: I97042655bca15e7eac899f12c5bada2f6184d307
2016-09-29 11:19:36 -04:00
Treehugger Robot 312c310f7c Merge "Only run warn.py's main function if it is the main program." 2016-09-29 03:58:07 +00:00
Meike Baumgärtner ac9d5df349 Only run warn.py's main function if it is the main program.
Test: run warn.py --byproject build.log
Change-Id: I155cce8c952d6d8a02c8e1809bf61a46c847c26e
2016-09-28 17:59:08 -07:00
Treehugger Robot 6784a3fcdd Merge "Fix pylint warning and refactor project_list." 2016-09-28 17:47:41 +00:00
Tao Bao 6e12b72966 Merge "Analyze unchanged blocks in odex files." 2016-09-28 17:08:10 +00:00
Chih-Hung Hsieh 9f766239f0 Fix pylint warning and refactor project_list.
Bug: 31377083
Test: run warn.py --byproject build.log
Change-Id: Id442cf6608bf5c14784063c05f5ff0b731f17486
2016-09-27 21:13:52 -07:00
Chih-Hung Hsieh b426c54e8a Fix Google pylint warnings.
* Rename 'severity' to 'Severity'.
* Fix bad line indentations and space.

Test: run warn.py --byproject build.log
Change-Id: I33d701cca408b5ca4715be8d44c890942b7d132a
2016-09-27 18:15:40 -07:00