Commit graph

34312 commits

Author SHA1 Message Date
Vishwath Mohan
d8eabaa6c7 Enable incremental builds for ASAN. (make)
This CL gets us closer to having incremental builds for ASAN by
separating the generation of sanitized intermediates from their
non-sanitized counterparts.

Bug: 38145756
Test: time (m -j40 && SANITIZE_TARGET="address" m -j40) # reduces from
17 mins to ~9 mins with these changes.

Change-Id: I7e3e7d88d276d834192b2e2427643f70e89d731e
2017-05-18 09:50:44 -07:00
Tobias Thierer
a0203a6544 Merge "Revert "build/make/core: Fix fragile assumptions about build toolchain."" 2017-05-18 14:25:15 +00:00
Tobias Thierer
4c764abf37 Revert "build/make/core: Fix fragile assumptions about build toolchain."
This reverts commit e2a8da2683.

Reason for revert: broke build. 

Change-Id: I951cc070adbbbd784aa4f8e171e543c35d0249de
2017-05-18 14:00:29 +00:00
Tobias Thierer
b371c7756a Merge "build/make/core: Fix fragile assumptions about build toolchain." 2017-05-18 12:04:31 +00:00
Tobias Thierer
e2a8da2683 build/make/core: Fix fragile assumptions about build toolchain.
- explicitly set the path where desugar will dump temporary class files.
  This ensures that the system property is set before it is read during
  InnerClassLambdaMetafactory.<clinit>. Before this CL, the system
  property was set by Desugar.createAndRegisterLambdaDumpDirectory(),
  which may run too late.

- explicitly specify -source 1.8 for droiddoc's javadoc run.
  Previously, the command used the language version of the build
  toolchain, which might fail due the backward-incompatible restrictions
  imposed by the proposed module system.

  Some Android build targets use LOCAL_JAVA_LANGUAGE_VERSION 1.7,
  but droiddoc combines sources from multiple build targets and there
  where no backwards incompatible changes in 1.8, so it should be fine
  to use 1.8 for code from either language level.

Bug: 38318052
Bug: 38225656
Bug: 38177295
Test: make clean && make checkbuild docs
      (using OpenJDK 8 toolchain)

Change-Id: Ie5fe0502dfe2f99fc58b1a723b7c18d5896a2646
2017-05-17 22:53:38 +01:00
Treehugger Robot
bbf833c7e1 Merge "Always use non-sanitized library locations for JNI." 2017-05-17 20:07:55 +00:00
Vishwath Mohan
d4dbf7921d Always use non-sanitized library locations for JNI.
This CL changes the build system to always look for shared JNI
libraries at their unsanitized install locations.

Bug: 38309771
Test: m -j40 && SANITIZE_TARGET="address" m -j40
Change-Id: Icb9d4f5365def6ea7a780553f455f41d2cb8b8bf
2017-05-17 11:02:20 -07:00
David Sehr
2f4e8f46e4 Merge "Add dexdiag tool to images" 2017-05-17 17:13:28 +00:00
Treehugger Robot
34b3a41217 Merge "Start deprecating OVERRIDE_BUILT_MODULE_PATH" 2017-05-16 23:59:25 +00:00
Treehugger Robot
26d769ea3f Merge "Allows DX alternative Jar." 2017-05-16 21:50:49 +00:00
Dan Willemsen
0cf52d84d3 Start deprecating OVERRIDE_BUILT_MODULE_PATH
We no longer need to use $PRODUCT_OUT/obj/lib as a linker path, we can
directly specify the shared libraries to the linker.

So install both into the standard built module path, and declare a copy
rule to the old OVERRIDE_BUILT_MODULE_PATH location. This way we can
incrementally move users from the old location to the standard path.

Test: m -j
Change-Id: I3c6140ac26e5e5ca486337ce0192e15e530da32c
Merged-In: I3c6140ac26e5e5ca486337ce0192e15e530da32c
2017-05-16 21:16:20 +00:00
Alan Leung
83857b6cbd Allows DX alternative Jar.
Test: m -j20 ANDROID_COMPILE_WITH_JACK=false DX_ALT_JAR=/mnt/m02/dx_alt.jar

Change-Id: I6163280101ff973bc8202a82d2fed42cf0ce6209
(cherry picked from commit b147846b67)
2017-05-16 13:34:42 -07:00
Treehugger Robot
90edf85667 Merge "Normalize timestamps in host java libraries" 2017-05-16 19:46:39 +00:00
David Sehr
5c2be9a291 Add dexdiag tool to images
Allow on-device analysis of dex memory usage by adding dexdiag to the
image.

Bug: 38181622
Test: adb shell "dexdiag"
Change-Id: I2142b5e42eae8cc01755d0e86c179c2fa86be00c
(cherry picked from commit 76f5fe5b63)
2017-05-16 11:41:49 -07:00
Colin Cross
1664b90d67 Normalize timestamps in host java libraries
Remove timestamps from jar files in host java libraries to get
consistent results between builds to help with build artifact
caching.

Bug: 38215808
Test: sha1sum desugar.jar && touch Desugar.java && m -j desugar && sha1sum desugar.jar
Change-Id: I1ecac9b2b80f673937086686540ab0736259df1b
2017-05-16 11:07:28 -07:00
Dan Willemsen
212c418ee7 Merge changes from topics 'soong_ui_installclean', 'soong_ui_version', 'soong_ui_clean'
* changes:
  Move auto installclean to soong_ui
  Move version checking to soong_ui
  Move clean/clobber to soong_ui
  Allow disabling of CleanSpec functionality
2017-05-16 18:02:04 +00:00
Sen Jiang
8a8ca3438b Merge "Add support for avbtool in custom_images." 2017-05-16 17:55:54 +00:00
Sen Jiang
5b0fe18feb Add support for avbtool in custom_images.
Set CUSTOM_IMAGE_AVB_ENABLE := true to enable avb, add_hashtree_footer
args can be added in CUSTOM_IMAGE_AVB_ADD_HASHTREE_FOOTER_ARGS.

Bug: 38319818
Test: m custom_images

Change-Id: Ia452dc5ce8b55bcbd3abba9e965b72e78fd8c104
2017-05-15 17:34:42 -07:00
Dan Willemsen
85e55ceff2 Move auto installclean to soong_ui
This way kati doesn't need to keep state for which build got run last,
and we have to run kati less often. This was forcing another kati run
for an empty out directory, and a kati run (or two) every time you
switched products that shared a device.

Bug: 35970961
Test: m clean; m -j blueprint_tools; m -j blueprint_tools; m -j blueprint_tools
Test: lunch aosp_arm-eng; m -j blueprint_tools; lunch full-eng; m -j blueprint_tools; <repeat>
Change-Id: I825a0868fb7059016a940c76244527432e3e7cff
2017-05-15 14:18:10 -07:00
Dan Willemsen
3eb44160e0 Move version checking to soong_ui
This removes versions_checked.mk that caused kati to regenerate the
ninja file 3 times for a clean out directory. Kati needs to regenerate
every time that we write a file that we also read. soong_ui doesn't have
this problem.

Bug: 35970961
Test: m clean; m -j blueprint_tools; m -j blueprint_tools; m -j blueprint_tools
Test: $OUT_DIR/versions_checked.mk no longer exists
Change-Id: I14b67dc275ea3daa77a7315c2985dc73d77fd07c
2017-05-15 14:02:38 -07:00
Dan Willemsen
bd8ac3284d Move clean/clobber to soong_ui
So that we don't have to load up all the makefile state just to remove
the output directory.

Starting from a completely empty out directory:
 kati:    16s
 soong_ui: 2.0s

From a minimal out directory (m -j blueprint_tools):
 kati:     3.8s
 soong_ui: 0.4s

Test: m -j clean
Test: m -j clobber
Change-Id: Iec1ce032c7cc7ed102430080e857fc421b66309c
2017-05-15 14:02:38 -07:00
Dan Willemsen
3715001fe5 Allow disabling of CleanSpec functionality
This is only intended for testing purposes -- so that we can run build
system tests and verify that kati only gets run once for each
configuration. CleanSpecs necessarily write state that require us to
re-run kati twice.

Test: export NO_ANDROID_CLEANSPEC=true; rm -rf out; m -j; m -j
Change-Id: I635a8d8b6754dff82fbc7f20c500d06d7cf6c4f2
2017-05-15 14:02:38 -07:00
Treehugger Robot
294d5c5f07 Merge "add dtbo support for ota" 2017-05-15 16:49:46 +00:00
Treehugger Robot
9198da8c21 Merge "Add c/a/i/u/* to the list of injar filters" 2017-05-15 15:44:04 +00:00
Paul Duffin
e949585a62 Add c/a/i/u/* to the list of injar filters
Previous change that moved com.android.internal.util.Predicate
to the legacy-android-test JAR caused a proguard build breakage
due to duplicate classes in the application and library. This
fixes it in the same way as previous issues with junit and
android.test classes were resolved by excluding those classes
from the application JAR.

Bug: 30188076
Test: make checkbuild and make -j ANDROID_FORCE_JACK_ENABLED=disabled checkbuild
Change-Id: Ica0089607187f970251ddba339a1f71d4cad80cc
2017-05-15 15:17:55 +01:00
Treehugger Robot
bba00b2cb9 Merge "Add the option to reserve headroom for partition images. This is useful for devices with low disk space with different build variants." 2017-05-13 01:37:25 +00:00
Yueyao Zhu
889ee5e7d3 add dtbo support for ota
Test: make dist and locally push ota on a device
Change-Id: I920b98f20e248b437955b2a963eb69ed2ddb8d45
2017-05-12 17:50:46 -07:00
Tianjie Xu
f34d435925 Merge "Add a script to parse an block-based ota package" 2017-05-11 21:52:10 +00:00
Tao Bao
4e1c113554 Merge "OTA Tools: Handle password encrypted keys" 2017-05-11 19:28:07 +00:00
Christian Oder
f63e2cd47b OTA Tools: Handle password encrypted keys
* Add logic to handle decrypted keys from common.GetKeyPassword in
WriteABOTAPackageWithBrilloScript.

* Get the keys passwords in main and store them in OPTIONS.key_passwords.
This allows accessing them in WriteABOTAPackageWithBrilloScript and SignOutput
so it's only required to ask for the password once, while allowing to use
decrypted signing keys.

Test: ota_from_target_files.py on marlin and angler respectively.
Change-Id: I7c9b0198855a4b630c52b8552e904f312f09c4ce
2017-05-10 16:54:42 -07:00
Treehugger Robot
57273013cf Merge "make: add __clang_analyzer__ to clang-tidy" 2017-05-10 04:34:42 +00:00
Treehugger Robot
90573e75a8 Merge changes Id0d167e6,I290a02b0
* changes:
  Clean LOCAL_RESOURCE_DIR paths
  Implement clean-path
2017-05-10 02:22:17 +00:00
Treehugger Robot
e5143608df Merge "Selectively add _asan flavor suffix." 2017-05-09 23:52:24 +00:00
Tianjie Xu
ce9d78fcd9 Add a script to parse an block-based ota package
The script prints the meta info, new/patch data size. It also simulates
the transfer commands and calculates amount of I/O as well as cache
needed.

We can add the more options to parse system/vendor.map so that we can
analyze the location change of files.

Bug: 31514709
Test: parse a bullhead incremental/full ota.
Change-Id: I70ed4f4c15e595b1851109e9799d44ac4e815c16
2017-05-09 21:01:19 +00:00
Vishwath Mohan
9ebc278f91 Selectively add _asan flavor suffix.
This CL ensures that the _asan suffix is added to the build flavor
only when it doesn't already contain _asan (or _asan_coverage). This
correctly prevents it from appending an extra _asan to ASAN lunch
configs that already include it in the flavor, while allowing
sanitized targets for generic configs to behave as they used to.

Bug: 38145756
Test: _asan is correctly appended only for lunch configs that don't
already specify it in the build flavor.

Change-Id: Ia7d9356f717b97d1c64e3237ca31cc507f27734f
2017-05-09 09:54:49 -07:00
Julius D'souza
001c676b81 Add the option to reserve headroom for partition images.
This is useful for devices with low disk space with different
build variants.

Bug: 37469715
Test: Regular image builds successfully, errors occur when
the headroom size is greater than available partition space.

Change-Id: I526cdd0f84981bbd16e3afcfe1cd7fc43dce98ef
2017-05-08 11:59:25 -07:00
Nicolas Geoffray
a65a41dcdb Merge "Pass --force-determinism to prebuilts." 2017-05-08 09:29:55 +00:00
Dan Willemsen
fa7ecfb752 Clean LOCAL_RESOURCE_DIR paths
With LOCAL_USE_AAPT2, resource directories like a/b/../res cause
problems, since ninja will canonicalize the path before creating the
intermediate resource directory, so it creates <intermediates>/a/res
while we give AAPT2 <intermediates>/a/b/../res, which fails to open.

Bug: 37716307
Test: Switch LOCAL_USE_AAPT2:=true for TelecommUnitTests, mma
Test: lunch aosp_marlin-userdebug; m -j
Change-Id: Id0d167e68185a119390e7b7e3c344895e77ca0e3
2017-05-05 20:50:54 -07:00
Dan Willemsen
5ec6bbc3d5 Implement clean-path
We shouldn't give non-clean paths to tools -- if a/b/../file was
specified, we can simplify that path to a/file, and not need to create
a/b just to make the path name work.

The testcases come from golang's filepath.Clean tests, this should be
compatible with that implementation.

Bug: 37716307
Test: TEST_MAKE_clean_path=true m -j blueprint_tools
Change-Id: I290a02b0a1e4a7c2b9255bca3c881589b521c402
2017-05-05 20:50:47 -07:00
Treehugger Robot
52d6a0d4cb Merge "Export OVERRIDE_RS_DRIVER to soong" 2017-05-06 01:19:44 +00:00
Tao Bao
a149a83e24 Merge "releasetools: Add a verbose parameter to common.Run()." 2017-05-05 22:29:52 +00:00
Colin Cross
7932f9bc5d Export OVERRIDE_RS_DRIVER to soong
Test: examine RS cflags
Change-Id: I0c1cc54f3f7f860895322d2825c7168c93a84ef5
2017-05-05 15:22:33 -07:00
Treehugger Robot
e3f07c2adb Merge "core/Makefile: add AVBTOOL deps to boot.img for BOARD_AVB_ENABLE" 2017-05-04 22:31:22 +00:00
Thierry Strudel
d7bd1f216f core/Makefile: add AVBTOOL deps to boot.img for BOARD_AVB_ENABLE
Bug: 37960599
Test: 'make bootimage' works when BOARD_AVB_ENABLE is true
Change-Id: I02c2fa16c9df988fbe1e1d6cd13a62278fedea45
Signed-off-by: Thierry Strudel <tstrudel@google.com>
2017-05-04 14:00:50 -07:00
Tao Bao
39451582c4 releasetools: Add a verbose parameter to common.Run().
Caller can optionally specify the verbose flag which overrides
OPTIONS.verbose. The command line won't be outputed with verbose=False.
This is useful for cases that a) those command lines are less useful
(but will spam the output otherwise); b) sensitive info is part of the
invocation.

'verbose=False' will be consumed by common.Run() only, instead of being
passed to subprocess.Popen().

Test: ota_from_target_files.py on a block based OTA.
Change-Id: I7d5b4094d756a60f84f89c6a965e7ccc68e435f8
2017-05-04 11:18:56 -07:00
Treehugger Robot
2be7eb9161 Merge changes Idf48f45f,Id2a72fe7,If83e1df2
* changes:
  Build: Disable leak sanitizer for ijar
  Build: Disable leak sanitizer for llvm-rs-cc
  Build: Disable leak sanitizer for aapt
2017-05-04 04:47:04 +00:00
George Burgess IV
5ab07d4f14 make: add __clang_analyzer__ to clang-tidy
We have code that acts slightly differently when the static analyzer is
running, so that it can produce more accurate diagnostics (e.g. less
false positives). It uses __clang_analyzer__ to detect the static
analyzer.

When the static analyzer is run via clang-tidy, __clang_analyzer__
doesn't get defined.

Bug: None
Test: WITH_TIDY=1 m. clang-tidy now acts as expected in code made for
the static analyzer

Change-Id: Ib2a815c0bd67553af465b64207bb480fb52cfaf8
2017-05-03 18:10:47 -07:00
Treehugger Robot
4a3dc1458f Merge "Only set TARGET_PLATFORM version in lunch when explicitly requested" 2017-05-03 04:36:56 +00:00
Colin Cross
4b7074e249 Merge "Clear LOCAL_JACK_ENABLED for ANDROID_COMPILE_WITH_JACK=false" 2017-05-03 04:36:28 +00:00
Colin Cross
1c1e142199 Only set TARGET_PLATFORM version in lunch when explicitly requested
Setting TARGET_PLATFORM_VERSION to DEFAULT_PLATFORM_VERSION during
"lunch sailfish-userdebug" causes unnecessary pain when
DEFAULT_PLATFORM_VERSION becomes invalid after branching.  Only
set TARGET_PLATFORM_VERSION if it was explicitly requested with
lunch sailfish-userdebug-OPR1.

Test: build/make/tests/envsetup_tests.sh
Bug: 34972208
Bug: 37208937
Change-Id: I40ba4617e73803c5bec1a8d317382f70fb3ec3a2
Merged-In: I40ba4617e73803c5bec1a8d317382f70fb3ec3a2
2017-05-03 02:47:59 +00:00