Commit graph

22295 commits

Author SHA1 Message Date
Yifan Hong
2e4f20f540 Merge "device_(manifest|matrix).xml -> vendor_*" 2020-01-16 04:09:08 +00:00
Ryan Mitchell
15e6042b29 Do not remove RRO resources
Resource configs should not be deduped when building RROs since it
would be impossible to override some resource configs with the same
value as the default config. Also, aapt2 removes resources that do not
have default configurations. If an overlay attempts to overlay a
non-default configuration without overlaying the default, the resource
will be removed and the value will not be overlaid at all.

Bug: 146227008
Test: m-j
Change-Id: I1465b599cbf7f464d1b5b75a87e7dafa2cf734b0
2020-01-14 17:00:13 -08:00
Yifan Hong
51be69f063 device_(manifest|matrix).xml -> vendor_*
Building device_manifest.xml or device_compatibility_matrix.xml only
builds vendor manifest / matrices, but not all device manifest /
matrices (e.g. vintf_fragments, ODM manifest, etc.). Make the name more
accurate.

Test: m check-vintf-all

Change-Id: Ib017507c421355263d53a9e5b357f169c77da36d
2020-01-14 14:24:51 -08:00
Harry Zhang
02e7851e02 Merge "Revert "Add check-vintf-all target."" 2020-01-14 21:34:51 +00:00
Harry Zhang
19705c6987 Merge "Revert "Improve BUILT_ASSEMBLED_*_MANIFEST checks"" 2020-01-14 21:12:40 +00:00
Harry Zhang
152a783e2b Revert "Add check-vintf-all target."
Revert submission 1202895-build_time_vintf

Reason for revert: Build breakage at b/147648187
Reverted Changes:
I9791abc44: Improve BUILT_ASSEMBLED_*_MANIFEST checks
I6ee79910d: Add check-vintf-all target.

Change-Id: I6d9fd1747eaea492a3ebfe98c13ea4a5a2d22a33
2020-01-14 18:40:23 +00:00
Harry Zhang
d00ebcd740 Revert "Improve BUILT_ASSEMBLED_*_MANIFEST checks"
Revert submission 1202895-build_time_vintf

Reason for revert: Build breakage at b/147648187
Reverted Changes:
I9791abc44: Improve BUILT_ASSEMBLED_*_MANIFEST checks
I6ee79910d: Add check-vintf-all target.

Change-Id: If580207415d6ca54eb5fc653efc54d07b086f804
2020-01-14 18:40:23 +00:00
Yifan Hong
997661002a Merge changes from topic "build_time_vintf"
* changes:
  Improve BUILT_ASSEMBLED_*_MANIFEST checks
  Add check-vintf-all target.
2020-01-14 01:29:47 +00:00
Ulyana Trafimovich
d99a1faccc Merge "Use boot image extension in the JIT-zygote experiment." 2020-01-13 10:38:01 +00:00
Jiyong Park
7434764cce Merge "Correctly gather boot jars from APEXes" 2020-01-13 01:16:16 +00:00
Yifan Hong
8bdfe365d6 Improve BUILT_ASSEMBLED_*_MANIFEST checks
They are moved into check-vintf-all, which is more
accurate and do not require building full OS images.

Also move kernel check code down to check_vintf_compatible. There
is no assembled manifest to put kernel configs now, but they are still
required for build time OTA VINTF checks.

Test: builds
Test: change a vintf_fragment file to cause a conflict with main manifest file
(add health@2.0 to boot@1.1.xml), and check_vintf_vendor_log fails

Change-Id: I9791abc440a40e1537b4387eb67575ff2e22df08
2020-01-11 19:06:18 +00:00
Treehugger Robot
56772d7213 Merge "Disallow unnamed package on the bootclasspath." 2020-01-11 16:42:21 +00:00
Tobias Thierer
af482ea053 Disallow unnamed package on the bootclasspath.
There are currently no classes on the bootclasspath that live in the
unnamed package (empty package name). This CL explicitly forbids it.
This has the side effect of guarding against some classes of bugs,
for example R8 has functionality to generate some helper classes in
the unnamed package that should not be on the to bootclasspath
because they would hide corresponding classes in Applications.

Strictly speaking I believe that the "not package_name or " part
of the condition in the touched script is not needed because
LoadWhitelist() already skips empty lines and doesn't add "^$" to
the whitelist regex, but relying on this seems very fragile. If
there ever is a need to have classes in the bootclasspath's
unnamed package in future then we can always change this again.

Bug: 147480264
Test: Treehugger

Change-Id: Ic310dd0779dde133b3a5c3039ea5b70d31331a9b
2020-01-11 16:07:13 +00:00
Justin Yun
66c7af81f3 Define PRODUCT_PRODUCT_VNDK_VERSION automatically
PRODUCT_PRODUCT_VNDK_VERSION will be automatically set to true for
the devices with PRODUCT_SHIPPING_API_LEVEL newer than 29.

Bug: 146621746
Test: build with PRODUCT_SHIPPING_API_LEVEL set to 30
Change-Id: I78cd81d1d61e9089b163169bc495df8a880463da
2020-01-11 12:44:08 +00:00
Yifan Hong
850f8b5d77 Add check-vintf-all target.
Add target that checks VINTF compatibility of the current build
(in $PRODUCT_OUT) properly. The target:

- Doesn't require a full build
- Won't run for system-only AOSP targets

A verbose log is printed if `m check-vintf-compatible` is executed,
but it won't show up if `m` is executed.

(After this patch, adding product / system_ext matrices is as simple
as defining a vintf_compatibility_matrix in Soong, and VINTF
compatibility is properly checked.)

Test: m check-vintf-all
Test: delete */etc/vintf and m check-vintf-all
Test: m
Test: m check-vintf-all on device with vendor/odm and ODM SKU-specific
      manifests

Test: change manifest.xml to be incompatible and m check-vintf-all fails

Bug: 140280874
Bug: 140360109

Change-Id: I6ee79910d745d29cfc9b05b1435e26f91b7c10f7
2020-01-10 13:17:56 -08:00
Ulya Trafimovich
bd98b55100 Use boot image extension in the JIT-zygote experiment.
Test: temporarily enable JIT-zygote configuration, build, boot the
  device and ensure that the JIT-zygote specific boot image
  apex-framework.art is mapped in the zygote address space:

  1. enable Jit zygote in the product device config (in my case
    device/google/muskie/aosp_walleye.mk):

    +# System server should not contain compiled code.
    +PRODUCT_SYSTEM_SERVER_COMPILER_FILTER := verify
    +
    +# Use the apex image for preopting.
    +DEXPREOPT_USE_APEX_IMAGE := true
    +
    +# Have the runtime pick up the apex image.
    +PRODUCT_PROPERTY_OVERRIDES += \
    +    dalvik.vm.boot-image=/apex/com.android.art/javalib/apex.art:/system/framework/apex-framework.art

  2. lunch aosp_walleye-userdebug \
    && m \
    && adb reboot bootloader \
    && fastboot flashall -w

  3. adb shell cat /proc/`adb shell ps | grep zygote64 | awk {'print $2'}`/maps | grep apex-framework.art
  6fe44000-7025c000 rw-p 00000000 fc:02 1179718                            /data/dalvik-cache/arm64/apex@com.android.art@javalib@apex-framework.art
  70571000-70696000 rw-p 0072d000 fc:02 1179718                            /data/dalvik-cache/arm64/apex@com.android.art@javalib@apex-framework.art
  75a339f000-75a33ac000 r--p 00852000 fc:02 1179718                        /data/dalvik-cache/arm64/apex@com.android.art@javalib@apex-framework.art

Change-Id: I6818fde087ec562057631003265bc1ec0e91688c
2020-01-10 15:29:42 +00:00
Jiyong Park
ee75813162 Correctly gather boot jars from APEXes
Jars in APEXes have Make module names <jar_name>.<apex_name>. e.g.
updatable-apex.com.android.media. Previously, we have used <jar_name>
which actually meant the platform variant of the jar. This is not only
incorrect, but also is causing problem as the platform variant is no
longer available when the jar is configured to be available only for the
corresponding APEX (via the apex_available property).

Fixing the problem by correctly using <jar_name>.<apex_name> scheme.

Bug: N/A
Test: m

Change-Id: I6e255ce88c9bd80120b29197fb2637a64010f531
Merged-In: I6e255ce88c9bd80120b29197fb2637a64010f531
2020-01-10 15:15:47 +00:00
Dan Willemsen
38dc09d39a Use our prebuilt M4 for flex and bison
And ensure we've got all the proper dependencies.

Bug: 117561006
Test: treehugger
Change-Id: Ia9690b2c0d73a48744c8e33fe83196d02b1e904d
2020-01-08 22:31:12 -08:00
Treehugger Robot
3801c82e33 Merge "jacoco-report-classes-all.jar includes jar from other partitions" 2020-01-09 00:45:11 +00:00
Xin Li
2cfd952682 Merge "DO NOT MERGE - Merge January 2020 Security Release into master" 2020-01-08 17:39:17 +00:00
Martin Stjernholm
2e31874c7a Merge "Remove generation of the dexpreopt tool paths from make." 2020-01-08 10:40:28 +00:00
Jiyong Park
bee946e8eb jacoco-report-classes-all.jar includes jar from other partitions
jacoco-report-classes-all.jar now depends on all installed files
including apks in /apex. Previously, it depended only on files under
system.img and as a result jacoco for other partitions were missing.

Bug: 147296855
Test: m

Change-Id: I755de1205ebc43c197af36a13cca5f4b49e275e8
2020-01-08 14:41:45 +09:00
Dan Willemsen
13f8dc992e Merge "Use symlinks in the build graph for jni libs"
am: 7d44f2d01d

Change-Id: I43f3bcce4569a72beaf4772008afda1bf3aebf90
2020-01-07 06:47:56 -08:00
Treehugger Robot
7d44f2d01d Merge "Use symlinks in the build graph for jni libs" 2020-01-07 14:42:51 +00:00
Martin Stjernholm
46f6017064 Merge "Remove DEX2OAT_DEPENDENCY which is the same as DEX2OAT."
am: 8da546b295

Change-Id: I93776b805dc23b4c5496f255e1e228b544017ac3
2020-01-07 05:02:13 -08:00
Martin Stjernholm
1e5581749d Remove generation of the dexpreopt tool paths from make.
They are now created from Soong, and therefore put in a separate config file
out/soong/dexpreopt_soong.config.

Test: m
Bug: 145934348
Change-Id: I27e710f09c37e64e8975b8e763d13434e5de71b3
2020-01-07 13:00:38 +00:00
Martin Stjernholm
8da546b295 Merge "Remove DEX2OAT_DEPENDENCY which is the same as DEX2OAT." 2020-01-07 12:37:07 +00:00
Ulyana Trafimovich
bedd2a57f9 Merge "Respect JIT-zygote config when generating boot image location."
am: 5268bfa61e

Change-Id: I4cf43302005c80d543f24a45520fd0f7d3a9c14b
2020-01-07 03:01:03 -08:00
Ulyana Trafimovich
5268bfa61e Merge "Respect JIT-zygote config when generating boot image location." 2020-01-07 10:48:45 +00:00
Martin Stjernholm
388a71f092 Remove DEX2OAT_DEPENDENCY which is the same as DEX2OAT.
Small cleanup to simplify the move of it into Soong.

Test: presubmits
Bug: 145934348
Change-Id: Ib4a0b69279f63d53405509b2d1529d9e60d46858
2020-01-07 00:00:29 +00:00
Daniel Mentz
e91b131bf6 Merge "Add unpack_bootimg to otatools to modify boot.img"
am: eb28123fef

Change-Id: Id475852d32699e3e263be46614a99962d42f773e
2020-01-06 10:53:03 -08:00
Dan Willemsen
b195e7ab04 Use symlinks in the build graph for jni libs
Now that ninja uses lstat and can support installing arbitrary symlinks,
switch jni lib symlinks from LOCAL_POST_INSTALL_CMDS to real rules.

Bug: 128577186
Test: List of files under PRODUCT_OUT is the same before/after this change
Test: out/target/product/generic/.installable_files now includes the symlinks
Test: m installclean; m NfcNci -> symlinks installed with correct dest
Test: m NfcNci; m NfcNci -> ninja: no work to do
Change-Id: I078dca53ab3d93f74c36fa66d5577e6e3e0640d6
2020-01-06 10:25:56 -08:00
Ulya Trafimovich
d1c9bfe87a Respect JIT-zygote config when generating boot image location.
Earlier CL Ida40dfae8c83bf7c2e737d5c7ea418e1197ad826 introduced
Soong-generated Make variable 'DEXPREOPT_IMAGE_LOCATIONS'. That CL was
erroneous in that it did not take JIT-zygote config into account and
generated identical location for "boot" and "apex" boot images.

This caused build breakages, because in case of JIT-zygote config the
two variables 'DexPreoptImages' and 'DexPreoptImageLocations' in the
module's dexpreopt.config were out of sync: 'DexPreoptImages' was
for the "apex" image, and 'DexPreoptImageLocations' was for the "boot"
image.

CL I9a91fc48e54d7d43abec2cb2b5a11e3581db380b introduced a workaround
for this problem: incorrect 'DexPreoptImageLocations' from the module
dexpreopt.config was ignored, and instead boot image location was
manually reconstructed from 'DexPreoptImages'. This workaround would
not work when we start using boot image extension and location will
become more complex.

This CL fixes the way 'DexPreoptImageLocations' is generated by
spliting the 'DEXPREOPT_IMAGE_LOCATIONS' variable in two variables
depending on the boot image flavour "boot" of "apex". This is
aligned with the way other similar variables are generated.

Test: aosp_walleye-userdebug boots.
Test: walleye_jitzygote-userdebug builds
  (on git_rvc-release branch with this CL cherry-picked).

Change-Id: I449c968909635dd8cc431323fccbc7fce440fea5
2020-01-06 15:58:52 +00:00
Daniel Mentz
30652b3380 Add unpack_bootimg to otatools to modify boot.img
unpack_bootimg in conjunction with mkbootimg can be used to re-create
boot.img with a different kernel image and ramdisk.

Change-Id: I9615facc9335885989772a0dd7f08217e2143a45
2020-01-04 15:25:42 -08:00
Dan Willemsen
8e080ccefe Merge "Export list of "installable" files to soong_ui"
am: 99202ec0a6

Change-Id: I252f4748396572d4b6c0f26148dc51b0c01b2f9e
2020-01-03 21:19:55 -08:00
Treehugger Robot
99202ec0a6 Merge "Export list of "installable" files to soong_ui" 2020-01-04 05:16:24 +00:00
Dan Willemsen
dec6e8e056 Export list of "installable" files to soong_ui
These are a (partial) list of files that we'd install with a default
build. The idea is that if something is removed from this list, soong_ui
can remove it from the installed location before running ninja.

It's okay if there are things missing from this list, it's not intended
to be a 100% solution replacing installclean / CleanSpec.mk, just
something that handles 80% of the cases without user involvement.

In particular, if something is removed from PRODUCT_PACKAGES, we'll
remove it from disk, but not necessarily rebuild the image files. That's
the same as most use cases of CleanSpec.mk today, and often some other
change will trigger the necessary images to be rebuilt.

We should be able to fix that by changing all of the image creation
rules to depend on the (partial) list of files they care about, or by
fixing ninja to rebuild things when their list of dependencies change.
(Other tools run into this same problem)

The list of test files is also included so that we can remove obsolete
tests from their "installed" locations within test suites and the
testcases folders.

Test: remove a module from PRODUCT_PACKAGES, see the print and file removed
Test: change the name of a cts test, see the old one removed from cts
Change-Id: I67f270a6713369099ca523aaf991ee3beb815c0a
2020-01-03 19:19:11 -08:00
Dan Willemsen
a9bfb4faba Merge "Add BUILD_BROKEN_NINJA_USES_ENV_VARS"
am: f29df793c9

Change-Id: Iae9ee9bbb18a153000e37204236e653465aba018
2020-01-03 18:04:04 -08:00
Treehugger Robot
f29df793c9 Merge "Add BUILD_BROKEN_NINJA_USES_ENV_VARS" 2020-01-04 01:32:40 +00:00
Colin Cross
253f31621e Merge "Add Soong android_app and android_test modules to javac-check"
am: 6e54952b44

Change-Id: I5ca7e4bd210a66aaeb305ab7ab326683ef89ea0b
2020-01-03 11:23:43 -08:00
Dan Willemsen
2607625f8b Add BUILD_BROKEN_NINJA_USES_ENV_VARS
See the Changes.md and the paired soong change for more information.

Test: Add BUILD_BROKEN_NINJA_USES_ENV_VARS := OLDPWD
      ALLOW_NINJA_ENV=false m nothing; check out/soong.log
Change-Id: I2167eac52166b513318bc48feb71c9d0b80e5fd4
2020-01-02 20:09:25 -08:00
Xin Li
68446d2662 DO NOT MERGE - Merge QQ1A.200105.003 into stage-aosp-master
Merged-In: I7e4e99e0da7387b13c94059b7ab1beb98ac47591
Change-Id: I2b18bf376c9d5ce988be10cabdf328f53a78ecab
2020-01-02 23:03:40 +00:00
Colin Cross
8e28a17bfe Add Soong android_app and android_test modules to javac-check
android_app and android_test modules were not built as part of
javac-check, which resulted in not running them in the Error Prone
build.

Fixes: 146455923
Test: m RUN_ERROR_PRONE=true javac-check
Change-Id: I278d7ee0cdc3f49aa8fa4d4f13309e29d700f2ba
2019-12-30 22:08:07 -08:00
Dan Willemsen
13cb165b91 Stop removing valid copy headers
My change to clean up obsolete copy headers would remove valid ones if
thhe LOCAL_COPY_HEADERS_TO path wasn't cleaned. I'm seeing this most
with values that just end in '/', so we end up with a '//' in the path,
which isn't textually equivalent, and we remove it.

Test: No longer seeing constant removals on internal products
Test: Set LOCAL_COPY_HEADERS_TO := ..
Test: Set LOCAL_COPY_HEADERS_TO := ../foo
Test: Set LOCAL_COPY_HEADERS_TO := /foo
Change-Id: Idbeeb207a2bb2a8da766473dbded877cec7c9cc1
2019-12-26 16:52:34 -08:00
Justin Yun
04e5a40f2c Define ro.product.vndk.version
Use ro.product.vndk.version to show the VNDK version that the product
partition is using.
When PRODUCT_PRODUCT_VNDK_VERSION is set, add ro.product.vndk.version
in /product/build.prop.
If PRODUCT_PRODUCT_VNDK_VERSION is "current", ro.product.vndk.version
will have the VNDK version in PLATFORM_VNDK_VERSION. Otherwise, it
will have the value defined in PRODUCT_PRODUCT_VNDK_VERSION.

Bug: 144534640
Test: Check if /product/build.prop has "ro.product.vndk.version"
Change-Id: If5e7e3a6c155de45f88f68700f16175656896afe
2019-12-24 07:20:43 +00:00
Daniel Mentz
5a8feb5422 Only dist recovery_ramdisk if BOARD_USES_RECOVERY_AS_BOOT
Bug: 146798070
Change-Id: I9e9d313b8ca097b4930fc2c99800772c6bdcbb9e
2019-12-23 14:08:31 -08:00
Daniel Mentz
4d6017d519 Dist ramdisk-recovery.img and misc_info.txt
Dist ramdisk-recovery.img and misc_info.txt. This is useful for
re-creating boot.img without having to download a huge target_files zip
file.

Change-Id: I2e1c1d547c95ca3433f89c68428c0c98fa4d19cd
2019-12-23 18:35:17 +00:00
Treehugger Robot
982da2812f Merge changes from topic "runtime_apex_available"
* changes:
  apex-libs-absence checks are removed
  Remove bionic libs from APEX_MODULE_LIBS check
  Use apex_available property
2019-12-23 04:50:53 +00:00
Jiyong Park
22195346dd apex-libs-absence checks are removed
The check is implemented in Soong via the apex_available property.
For a module that should be in the APEX named "foo" and shouldn't be in
any other APEX and also in the platform (the non-updatable part), the
property can be set to "foo" (without "//apex_available:platform")
to express the restriction and then Soong will enforce it.

Bug: 128708192
Test: m
Change-Id: Ia1aaaacd685f466447b61deae2849cb0aa83def3
2019-12-23 03:41:59 +00:00
Jiyong Park
be77c453a7 Remove bionic libs from APEX_MODULE_LIBS check
The test was to ensure that bionic libs are not installed to the
non-updatable part of the platform (e.g. system/lib). However, for
bionic libs, we actually have been installing them for bootstrapping.
Specifically, they are installed to /system/lib/bootstrap, not
/system/lib. The test has passed just because it didn't look into
/system/lib/bootstrap. Removing the unnecessary check.

Bug: 128708192
Bug: 133140750
Test: m
Test: m out/target/prduct/$(TARGET_DEVICE)/system/lib/libc.so doesn't
work
Change-Id: I93cbd74972cdd2daea45612136d5133fa49ab76a
2019-12-22 12:25:48 +09:00