Commit graph

34510 commits

Author SHA1 Message Date
Tianjie Xu
616fbeb144 Move recovery building from sign_target_files_apk to add_img_to_target_files
Currently we're building the boot/recovery image twice, which is
redundant. And b/38455129 shows a problematic case when the image
from two builds doesn't match. We should only build the recovery
image once in the add_img_to_target_files.

Bug: 62021378
Test: call sign_target_files_apk on an angler target file,
recovery-from-boot.p generates successfully; and SHA of recovery.img
matches the one in install-recovery.sh.

Change-Id: I01e033501d80c18a87cbb870300eee5c19a04441
2017-05-26 17:20:22 -07:00
Tianjie Xu
ada0854169 Merge "Update the recovery files under SYSTEM/ if recovery patch is rebuilt" 2017-05-27 00:15:58 +00:00
Jeff Gaston
143f2b1fe5 Add blueprint_tools as default target
Bug: 38351765
Test: rm out -rf && m -j && stat out/soong/host/*/bin/bpfmt

Change-Id: I60ededa1b13fb575616162d6dc1b0b8159f97f20
2017-05-26 17:12:40 -07:00
Tianjie Xu
38af07ff20 Update the recovery files under SYSTEM/ if recovery patch is rebuilt
If we pass "rebuild_recovery" to add_img_to_target_files, the recovery
patch is rebuilt. But related files under SYSTEM/ (e.g.
SYSTEM/recovery-from-boot.p && SYSTEM/bin/install-recovery.sh) are not
updated.

This may cause a mismatch between system.img and SYSTEM/, and
may lead to a failure in validate_target_files.py.

Bug: 62096364
Test: Rebuild the system image in the TF and observe the recovery files
under SYSTEM/ get updated.

Change-Id: I7d679a612a86d02cf2eff81d1d120c0067138ed9
2017-05-26 22:40:23 +00:00
Treehugger Robot
dddd7738d0 Merge "Update RenderScript build config and definitions." 2017-05-26 22:29:36 +00:00
Treehugger Robot
64caaf4679 Merge changes I73787aff,I0d149812
* changes:
  Move APP-% and PRODUCT-% implementation out of Kati
  Remove the rest of showcommands, dist goal
2017-05-26 22:08:49 +00:00
Miao Wang
a9fed83fae Update RenderScript build config and definitions.
Bug: 38342163

  - obj/lib is deprecated and TARGET_OUT_INTERMEDIATE_LIBRARIES will be
  removed. We need to use per-module intermediates directory instead.
  - prebuilts/ndk/current folder is gone. For libm and libc, we just
  need ndk/r10 as stub libs for linking.

Test: mm and made sure this does not affect on device target.
Test: make -j50 FORCE_BUILD_RS_COMPAT=true RSTest_Compat works as
expected.

Change-Id: I8fbf5c10322707849a23c6b0dacc28b028db451e
2017-05-26 13:48:08 -07:00
Dan Willemsen
9bfcbc8a71 Move APP-% and PRODUCT-% implementation out of Kati
This way we'll share ninja files with the equivalent normal configs. We
were already parsing them in the make config step in order to fix
TARGET_PRODUCT / TARGET_BUILD_VARIANT / TARGET_BUILD_APPS, now they
replace themselves in MAKECMDGOALS with the appropriate goals.

If we're not going to pass any goals to ninja, pass the default goal.

Test: ALLOW_MISSING_DEPENDENCIES=true m -j APP-Calculator
Test: m -j PRODUCT-aosp_fugu-eng
Test: m -j PRODUCT-aosp_fugu-eng sdk
Test: m -j PRODUCT-aosp_fugu-sdk
Test: lunch aosp_arm64-userdebug; m -j
Test: lunch aosp_arm64-userdebug; m -j dist
Test: lunch aosp_arm64-userdebug; m -j adb
Change-Id: I73787aff9f74aed328e3fa75c571ae15a28851b0
2017-05-26 12:57:04 -07:00
Dan Willemsen
562baccae8 Remove the rest of showcommands, dist goal
showcommands is all handled in soong_ui, make/kati/ninja never see the
argument.

Remove the dist goal, since we'll never pass it to ninja, only to Kati
as a modifier.

Remove DUMP_%, since that's not used anywhere (it appears to be in our
code search via the NDK build system)

Test: m -j showcommands dist
Change-Id: I0d1498128caece685e98c2c2b5b0c3f545da0e11
2017-05-26 12:57:04 -07:00
Colin Cross
7bc6eb12f4 Merge "Pass TARGET_BUILD_PDK to soong" 2017-05-26 19:34:32 +00:00
Tobias Thierer
bc8f82ff25 Merge changes from topic 'bug_38177295_checkbuild'
* changes:
  Let signapk access internal APIs under OpenJDK 9 toolchain
  Desugar: allow reflection over internal APIs.
2017-05-26 12:08:39 +00:00
Tobias Thierer
9cc3c76abd Let signapk access internal APIs under OpenJDK 9 toolchain
signapk relies on internal APIs sun.security.{pkcs,x509},
for example in com.android.apksig.internal.apk.v1.V1SchemeSigner.

This breaks at signapk runtime under OpenJDK 9 because those
packages are not exported by the java.base module.

This CL unbreaks signapk by allowing it to access these internal
packages. In the long term, signapk should migrate away from these
internal APIs (bug 37137869).

Test: make ANDROID_COMPILE_WITH_JACK=false checkbuild tests \
      && make checkbuild tests
      (with OpenJDK 8u45 toolchain on the PATH)
Test: make EXPERIMENTAL_USE_OPENJDK9=true \
      ANDROID_COMPILE_WITH_JACK=false checkbuild
      (with jdk 9-ea+170 toolchain on the PATH)

Bug: 37137869
Bug: 38177295
Change-Id: I64cab83e6eb7b135cf2ad7b523736cb409aaae02
2017-05-25 20:34:22 +01:00
Colin Cross
2ddbcdf3a7 Pass TARGET_BUILD_PDK to soong
Also enable ALLOW_MISSING_DEPENDENCIES when TARGET_BUILD_PDK is set
so that soong modules can reference modules that are disabled in the
PDK.

Test: builds
Bug: 62086238
Change-Id: Ic43e843a717b802ace0cee568b9e7e561a6c0868
2017-05-25 10:29:19 -07:00
Tobias Thierer
97479ccb7f Desugar: allow reflection over internal APIs.
Desugar reflects over internal APIs at runtime, using the
java.lang.invoke.MethodHandles.Lookup API.

On OpenJDK 9 toolchains, such reflection is only allowed
to packages to which the java.lang.invoke module is opened.

This CL adds an override to open the module to all unnamed
modules (i.e., to Desugar) when running Desugar.

Test: make checkbuild
      (with OpenJDK 8u45 toolchain on the PATH)
Test: make EXPERIMENTAL_USE_OPENJDK9=true checkbuild
      (with OpenJDK 9-ea toolchain on the PATH)

Bug: 38177295

Change-Id: I2cf74a96ea17366dd50b8d92af8e41e812247ef7
2017-05-25 18:14:27 +01:00
Tobias Thierer
5368131063 Merge "Drop build support for LEGACY_USE_JAVA7." 2017-05-24 10:24:53 +00:00
Bowgo Tsai
7ea994b21c Support signing custom images with AVB HASH or AVB HASHTREE
`make custom_images` supports to build different kinds of *non-droid* images,
e.g., odm.img. Adding the support of signing them with either AVB HASH footer
or AVB HASHTREE footer. The user can use HASH for small images and
HASHTREE for large images.

Sample signing configurations:
 * AVB HASH footer:
   - CUSTOM_IMAGE_AVB_HASH_ENABLE := true
   - CUSTOM_IMAGE_AVB_ADD_HASH_FOOTER_ARGS := --append_to_release_string my_odm_image

 * AVB HASHTREE footer:
   - CUSTOM_IMAGE_AVB_HASHTREE_ENABLE := true
   - CUSTOM_IMAGE_AVB_ADD_HASHTREE_FOOTER_ARGS := --fec_num_roots 8

 * Using custom signing key:
   - CUSTOM_IMAGE_AVB_ALGORITHM := SHA256_RSA2048
   - CUSTOM_IMAGE_AVB_KEY_PATH := external/avb/test/data/testkey_rsa2048.pem

Bug: 36701014
Test: `make custom_images` with AVB HASH footer
Test: `make custom_images` with AVB HASHTREE footer
Test: `make droid` to check system.img is still properly signed with AVB HASHTREE
Test: `make droid` to check vendor.img is still properly signed with AVB HASHTREE

Change-Id: I8dc420e12e37e9a631345c0cd883339db05d489f
2017-05-24 14:21:03 +08:00
Dan Willemsen
5f4274609f Merge "Fix override warnings when two test suites share an output" 2017-05-24 03:32:21 +00:00
Tao Bao
e8ef8f70f8 Makefile: Add the dependency for BUILT_OTATOOLS_PACKAGE.
$ lunch aosp_marlin-userdebug
$ m otatools-package
$ echo "TEST" >> device/google/marlin/sepolicy/certs/app.x509.pem
$ m otatools-package

out/target/product/marlin/otatools.zip now contains an updated
app.x509.pem file.

Test: see above
Change-Id: I78a165e12a07c1b86a671a7ee1863a97fdea18c5
2017-05-23 18:25:29 -07:00
Dan Willemsen
988a08d009 Fix override warnings when two test suites share an output
Test: (internal master); m -j nothing, check warnings
Test: Spot check differences in build-*.ninja
Change-Id: I160583faa69d090f9b97a8a600598a39a8b1ed9c
2017-05-24 00:42:23 +00:00
Tianjie Xu
6a324ba588 Remove the obsolete UnpackPackageDir() in edify generator
package_extract_dir is used in file based OTA only and should be killed.

Bug: 37959785
Test: code search shows no usage of this function in aosp.
Change-Id: Id3719b969c24b7ecef0c7f0e4a3af09a72be54d4
2017-05-23 17:15:14 -07:00
Treehugger Robot
5d80b734f2 Merge "Move dataclean and installclean to soong_ui" 2017-05-23 22:32:34 +00:00
Treehugger Robot
d5f8deb3ac Merge "Makefile: copy mke2fs.conf to ota root" 2017-05-23 19:45:37 +00:00
Tao Bao
78a41f6553 Merge "Fix the symlink detection when signing TF.zip." 2017-05-23 18:15:44 +00:00
Tobias Thierer
c61bd998b5 Drop build support for LEGACY_USE_JAVA7.
This flag allowed for building with an OpenJDK 7 toolchain. It was
used for build bot builds that now work with an OpenJDK 8 toolchain.
Hence, this feature is no longer required. This CL drops it.

Bug: 27583810
Test: Treehugger build succeeds.
Change-Id: I7efca363d665292bfb88f4a4d6f3a120fc8f93f3
2017-05-23 14:17:48 +01:00
Tobias Thierer
48ee187e98 Merge "Fix fragile assumptions about build toolchain. (attempt #2)" 2017-05-23 12:14:54 +00:00
Tao Bao
406050bdb6 Fix the symlink detection when signing TF.zip.
We used to check for 'attr >> 16 == 0xa1ff' (i.e. 0o120777) to detect
symlinks in the input target_files zip (TF.zip). This becomes broken
after we switch to soong_zip, which packs symlinks with 0o120700.

This CL fixes the issue by using stat.S_ISLNK() instead.

Note that we don't need to stage the files with the exact permission
bits as in the input TF.zip. Because this part is covered by mkbootfs
by using the canned or the compiled-in fs_config - as long as the
files/directories are accessible and the symlinks are created.

Bug: 38455129
Test: sign_target_files_apks.py on bullhead TF.zip. Check the
      checksums in SYSTEM/bin/install-recovery.sh.
Change-Id: I51c1fc9a257fb3f18c16c2ed71528abaa6f7d9c9
2017-05-22 23:33:11 -07:00
Treehugger Robot
9f52f0d17d Merge "Add LOCAL_JAR_PROCESSOR" 2017-05-23 02:03:09 +00:00
Colin Cross
f8a49c5a37 Add LOCAL_JAR_PROCESSOR
Allow using a host java library as an intermediate processor step
after javac but before desugar, proguard, or dx.

Test: manual
Change-Id: I7fb843e10d96c0167f6e4371582fabcc1454521f
2017-05-22 17:30:13 -07:00
Tobias Thierer
0ed47f7fd1 Fix fragile assumptions about build toolchain. (attempt #2)
This CL resubmits a fixed version of commit
e2a8da2683.

This CL applies the following changes:

- 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 ANDROID_COMPILE_WITH_JACK=false checkbuild tests \
      && make checkbuild tests
      (using OpenJDK 8 toolchain)

Change-Id: I2fffe6668747f48be44e34c67332af9b8a996d2a
2017-05-22 23:03:24 +01:00
Tobias Thierer
00e3bd93da Merge "Make: Don't rely on presence of tools.jar in toolchain." 2017-05-22 09:33:31 +00:00
Tobias Thierer
3c4c0b6ab3 Make: Don't rely on presence of tools.jar in toolchain.
Some cts, doclava and javassist code uses private APIs that require
tools.jar to be on the classpath when building with the standard
OpenJDK 8 toolchain. However, OpenJDK 9 toolchains do not have this
file nor require it to be on the classpath. The reliance on the
presence of tools.jar means that AOSP can currently not build on
such toolchains.

After this CL, when EXPERIMENTAL_USE_OPENJDK9 is set, the value of
HOST_JDK_TOOLS_JAR is empty.

That flag can be set via:

export EXPERIMENTAL_USE_OPENJDK9=true

and unset via:

unset EXPERIMENTAL_USE_OPENJDK9

Test: make checkbuild (using OpenJDK 8 toolchain)
Test: manually confirmed that device boots
Bug: 38177295
Change-Id: Icc5451b51e44a574fd21024d434ed1fa8711de17
2017-05-20 14:17:05 +01:00
Treehugger Robot
ec0dec8599 Merge "Add soong variable for PRODUCT_FULL_TREBLE." 2017-05-20 00:05:51 +00:00
Treehugger Robot
1c7debc95c Merge "Use installed module stem for .so soname" 2017-05-19 23:34:58 +00:00
Dan Willemsen
50e8753686 Use installed module stem for .so soname
So that the SONAME will match the actual installed name. This allows two
shared libraries (with different LOCAL_MODULE names) to be built with
the same name, but in different locations. So to partially emulate
Soong's vendor_available, you could define:

  include $(CLEAR_VARS)
  LOCAL_MODULE := libmyutils
  ...
  include $(BUILD_SHARED_LIBRARY)

  include $(CLEAR_VARS)
  LOCAL_MODULE := libmyutils_vendor
  LOCAL_VENDOR_MODULE := true
  LOCAL_INSTALLED_MODULE_STEM := libmyutils.so
  ...
  include $(BUILD_SHARED_LIBRARY)

All of the users would need to explicitly use libmyutils vs
libmyutils_vendor based on how their runtime lookup paths are going to
work, but it will install into both places:

  /system/lib/libmyutils.so
  /vendor/lib/libmyutils.so

Bug: 38225484
Test: Example similar to above, ensure DT_NEEDED / DT_SONAME are correct
Test: multiproduct_kati to verify the only module this changes on
      master is libart_fake
Change-Id: Ifa4b8adff50d8b5a754c70ce8e865b05f9889c6c
2017-05-19 14:30:12 -07:00
Mark Salyzyn
5d9c1e7430 Merge "Android.mk: clear variable at end of use" 2017-05-19 20:47:32 +00:00
William Roberts
6b19e495b1 Android.mk: clear variable at end of use
Clear fs_config_generate_extra_partition_list after use.

Test: build fs_config_files and fs_config_dirs targets.

Change-Id: Ie18bcd2df2ff1becb178e9ba45d226e2e9a8faab
Signed-off-by: William Roberts <william.c.roberts@intel.com>
2017-05-19 20:14:27 +00:00
Vishwath Mohan
1c84862c36 Merge "Enable incremental builds for ASAN. (make)" 2017-05-19 19:07:41 +00:00
Steven Moreland
2b32469c47 Add soong variable for PRODUCT_FULL_TREBLE.
Required to preserve sane defaults for old codebases.

Test: inspect soong.variables
Test: ensure PRODUCT_SHIPPING_API_LEVEL is set in config.mk
Bug: 38415912
Change-Id: I0244fb02754663be3106391c9360fd1b2cc00d4a
2017-05-18 17:16:09 -07:00
Treehugger Robot
dd51cfc9a2 Merge "Recognize new clang and make warnings." 2017-05-18 23:19:08 +00:00
Chih-Hung Hsieh
8ef1aae6d3 Recognize new clang and make warnings.
Test: warn.py build.log
Change-Id: I078b3cc35a00590312208cb90af0a1f2431abf09
2017-05-18 14:29:59 -07:00
Dan Willemsen
0f2ab46038 Move dataclean and installclean to soong_ui
This can be a little faster, but also means that we don't need to call
kati/ninja twice when we need to handle the automatic installclean.

Test: m -j installclean
Test: m -j dataclean
Change-Id: I8f5e5544bcf30c58bf9abee30a37256cb18436ac
2017-05-18 13:42:40 -07:00
David Gross
46d9bf8f9a Merge "Teach mgrep to find soong/*.go files." 2017-05-18 18:13:03 +00:00
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