Commit graph

23138 commits

Author SHA1 Message Date
Colin Cross
c3ad80467e Use inclusive language in build/make
Test: m checkbuild
Change-Id: I54a7e55d3fdd5571ef1ae33ebe443c10d138fd28
2020-06-11 14:37:54 -07:00
Colin Cross
bc1051d399 Merge "Add out/soong/late-${TARGET_PRODUCT}.mk" 2020-06-11 18:36:18 +00:00
Colin Cross
80ef0a212c Merge "Move definition of dist-for-goals before call." 2020-06-11 18:36:18 +00:00
Sophie Zheng
537aee38d5 Merge "Copy generated xml file for NDK api coverage to dist when CLANG_COVERAGE flag set." 2020-06-11 18:21:53 +00:00
J. Avila
b8d67f3722 Merge "Add LZ4 support to the release tools" 2020-06-11 14:56:38 +00:00
Ulyana Trafimovich
cd33e76411 Merge "Fix on-device paths to used libraries in dexpreopt." 2020-06-11 13:47:19 +00:00
Ulya Trafimovich
2311f61b12 Fix on-device paths to used libraries in dexpreopt.
Also, add function `install-path-to-on-device-path` that converts
its one argument from on-host install path to on-device path by
stripping PRODUCT_OUT prefix.

Test: lunch aosp_cf_x86_phone-userdebug && m
Test: Cherry-pick in internal master and check that on-device path to
    com.google.android.dialer.support.jar now is on /product partition
    (as it should be) and not on /system:
    $ oatdump \
        --instruction-set=x86 \
        --oat-file=out/target/product/vsoc_x86/product/priv-app/GoogleDialer/oat/x86/GoogleDialer.odex \
      | grep '^classpath' \
      | grep -o '[^[]*com.google.android.dialer.support.jar'
    /product/framework/com.google.android.dialer.support.jar

Bug: 132357300
Change-Id: I9bbe45ffbbed09186ac46e067da7ada599ef9678
2020-06-11 10:10:00 +01:00
Martin Stjernholm
f712ba95dc Disable dexpreopting when TARGET_BUILD_APPS is used.
This moves the condition from Soong to make, so that
config.UnbundledBuild() in Soong no longer implies disabling
dexpreopting.

Test: TH, in particular builds green on ub-launcher3-master
Bug: 157549171
Change-Id: I7273be8591c9d627d89e033b641139dacc275806
2020-06-11 01:09:53 +01:00
Martin Stjernholm
7a430fd4c8 Introduce TARGET_BUILD_UNBUNDLED.
Setting this flag enables unbundled building, i.e. without support for
building the system image and other platform targets. This
functionality was previously enabled by TARGET_BUILD_APPS, and setting
that still implies TARGET_BUILD_UNBUNDLED.

This helps unbundled builds that aren't apps, e.g. ART runtest builds.
Specifically, with the topic of the child CL
https://r.android.com/1324517 TARGET_BUILD_UNBUNDLED does not imply
disabling dexpreopting, unlike TARGET_BUILD_APPS.

TODO: There may still be app-specific conditions that are incorrectly
controlled by TARGET_BUILD_UNBUNDLED, in particular on the Soong side
through config.UnbundledBuild().

Test: Flash & boot
Test: TH, in particular builds green on ub-launcher3-master
Bug: 157549171
Change-Id: Ic09fc879117ee06cab5444edfc280ed2b52d2870
2020-06-11 01:09:07 +01:00
J. Avila
98cd4cc7a3 Add LZ4 support to the release tools
The core android build platform has changed to add support for LZ4
compression for ramdisks, but the release tools were not. Fix this.

Bug: 156129966
Change-Id: I39680b91930d2d3cbd0cd565beb78e1ee699397e
2020-06-10 21:51:19 +00:00
Elliott Hughes
9df45f6ec2 Merge "Remove TARGET_PREFER_32_BIT." 2020-06-10 18:07:06 +00:00
Treehugger Robot
8add8cb145 Merge "base_rules.mk optimizations" 2020-06-10 02:46:12 +00:00
Yo Chiang
988693fb00 Merge "Cleanup unused get-32-bit-modules" 2020-06-10 02:30:24 +00:00
Dan Willemsen
8447b8116a base_rules.mk optimizations
A few more misc improvements that I found while analyzing the
performance of base_rules.mk.

This brings an aosp-master/aosp_crosshatch-userdebug kati run from 33.3s
to 28.6s

Bug: 158488548
Test: build-aosp_crosshatch.ninja is the same before/after
Change-Id: If99c31cc7b5d7133d70eb644c6095f19060b71e5
2020-06-09 09:59:24 -07:00
Yo Chiang
1e55e74acc Cleanup unused get-32-bit-modules
These are no longer used by anyone:
* get-32-bit-modules
* get-32-bit-modules-if-we-can
* get-host-32-bit-modules
* get-host-32-bit-modules-if-we-can

Bug: 155869107
Test: TH
Change-Id: I441de7f94061efd40186b80d1a2ead11669a5753
2020-06-09 03:28:26 +00:00
Dan Willemsen
fd1e67b8ce More performance improvements
Instead of using `x := $(x) foo`, make sure `x` is initialized first,
then use `x += foo`.

For a aosp-master/aosp_crosshatch-userdebug build, this takes the build
from 49s to 33s (no significant difference in peak memory)

Bug: 158488548
Test: build-aosp_crosshatch.ninja is the same before/after
Change-Id: I41fb7611030dd3ba824f896a9c9eadbdd218f464
2020-06-08 19:10:23 -07:00
Treehugger Robot
83e9cfe291 Merge "Rewrite test data logic to make it faster" 2020-06-09 01:00:52 +00:00
Elliott Hughes
9b824d5ceb Remove TARGET_PREFER_32_BIT.
Bug: https://issuetracker.google.com/138812821
Test: builds
Change-Id: I2ff7793c8b1eb56f6be63375cc7b70aa44254443
2020-06-08 16:36:52 -07:00
Frank Feng
e4d2ccee92 Merge "Add test config template for sh_test." 2020-06-08 21:05:31 +00:00
Dan Willemsen
c5ec8e95bc Rewrite test data logic to make it faster
It turns out we have a few tests with thousands of test data files,
which this logic does not handle very well. Just switching from `x :=
$(x) ...` to `x += ...` accomplishes the majority of these gains, but I
rewrote the logic to be less function-call+eval based to hopefully make
it easier to understand.

For an aosp-master/aosp_coral-eng build, this brings the time spent in
this logic from 7.6s to 0.3s (total kati runtime of 54s to 46s). Kati's
peak memory use (maxrss) also shrunk from 6.1GB to 3.8GB.

Bug: 158488548
Test: build-aosp_coral.ninja is the same before/after
Change-Id: Ia2ec8b29b5c1dd12fa7ea10b4f80fe802c692725
2020-06-08 11:42:51 -07:00
Colin Cross
8ca4092ab4 Add out/soong/late-${TARGET_PRODUCT}.mk
Read out/soong/late-${TARGET_PRODUCT}.mk after reading Android.mk files
to allow Soong's makevars singleton to use $(call dist-for-goals).

Test: m lint-check dist
Change-Id: I7754fd1b8dab508c96ad59beed67f0d6c4ff75f0
2020-06-07 18:16:38 -07:00
Jiyong Park
bb26c6f2bf Rule for system/build.prop is also from macro
Like other <partition>/build.prop files, the build rule for
system/build.prop is also created using the build-properties macro.

system/build.prop has a few number of auto-generate properties that the
macro doesn't create. Those properties are emitted to intermediate files
using manually crafted rules, the paths to the files are fed to the
macro, where their contents are copied to system/build.prop.

This change also refactors the code fragment that defines BUILD_*
variables that identifes the given build.

Bug: 117892318
Test: m

Change-Id: Ic218283b40fedeaddacb3fda93167edbec86094c
2020-06-08 10:09:12 +09:00
Jiyong Park
c844de4241 Merge changes I4d88733c,I61943476,Ibed9c96d
* changes:
  remove buildinfo_common.sh
  Partial cherry-pick of ag/10260813
  <partition>/build.prop rules are defined using macro
2020-06-08 00:58:48 +00:00
Treehugger Robot
208689cca8 Merge "fix spurious / on toplevel kernel module installations" 2020-06-06 01:53:24 +00:00
Xin Li
6e30a3fc86 Merge "Merge QQ3A.200605.002 into master" 2020-06-06 01:41:29 +00:00
Steve Muckle
950d723b9d fix spurious / on toplevel kernel module installations
When kernel modules are being put directly into lib/modules/ (as opposed
to lib/modules/<subdir>/), the empty part of the destination path causes
a target containing a redundant /. If the target is also added elsewhere
in the build without the redundant /, then rule merging will miss it,
and a build error will occur.

Bug: 158158635
Change-Id: I797addce760f4886166efa283302a53783581625
2020-06-05 12:10:56 -07:00
Ulyana Trafimovich
660edfdc4a Merge "Refactor library path representation in dexpreopt." 2020-06-05 10:46:01 +00:00
Yo Chiang
f9d1eee9b9 Merge changes I47d523e4,Ib2f4b548
* changes:
  Make required modules support :32 and :64 suffix
  Refactor *-select-bitness-of-required-modules
2020-06-05 05:12:23 +00:00
Treehugger Robot
173149f177 Merge "Strip debug symbols from modules (fixup)" 2020-06-05 03:51:09 +00:00
Jiyong Park
35a83d1a5a remove buildinfo_common.sh
The shell script was responsible for appending some system properties
that are common to <partition>/build.prop files. The values of the
system properties were given via environment variables whose names were
slightly different from their corresponding make var names.

This change removes the script and instead write the system properties
directly in Make, thus eliminating the need to keep track of the mapping
across sysprop names, environment variable names, and make var names.

Bug: 117892318
Test: m

Change-Id: I4d88733c1afa30ea0c0c4fcfc2b349f07f7fc090
2020-06-05 10:50:15 +09:00
Jiyong Park
e28fa80e12 <partition>/build.prop rules are defined using macro
The macro `build-properties' is defined to generate build rules to
create <partition>/build.prop.

build.prop files in all partitions except for the system partition are
now build using the macro.

system partition will use the macro in the following changes.

Bug: 117892318
Test: m

Change-Id: Ibed9c96dac4366251ec59a0b1317aa92f501c9a3
2020-06-05 10:47:34 +09:00
frankfeng
7e32b34ed3 Add test config template for sh_test.
Verification of compatibility with existing sh_test targets is in progress.

Bug: 148805488
Bug: 151761373

Test: make
Test: unit tests
Test: verified test config auto-gen for bc-tests and toybox-tests
Change-Id: Id8ce5dd0723e8c95921e2e20bff72fc828d47d87
2020-06-04 10:35:53 -07:00
Ulya Trafimovich
77a78fca4e Refactor library path representation in dexpreopt.
This is a preliminary CL before fixing on-device paths to DEX jars.
It groups together the inormation about on-host build paths and
on-device install paths to library DEX jars.

This CL changes the structure of module dexpreopt.config files
generated by the build system. Aside of that, no functional changes.

Test: lunch aosp_cf_x86_phone-userdebug && m
Change-Id: I8e92829885f26522aa2b936e77e91ce91593b27c
2020-06-04 17:33:22 +01:00
Ulyana Trafimovich
4c5ed87faa Merge "Add product variable PRODUCT_BROKEN_SUBOPTIMAL_ORDER_OF_SYSTEM_SERVER_JARS." 2020-06-04 08:56:04 +00:00
Pierre Couillaud
d99da8fa17 Strip debug symbols from modules (fixup)
allow to also skip the stripping of the modules present in vendor
ramdisk when the BOARD configuration is set to skip the strip step.

there is also a shortcoming of this functionality: it currently assumes
the modules to strip are all created equal against the same arch in
particular, however this does not work for kernel modules which are
for mixed mode platforms, as example {kernel,android} == {aarch64,armv7}
because it will select the "android" mode strip which is unaware of the
kernel mode architecture.

Bug: 156395749
Bug: 155193290
Change-Id: I35ef51845224e94e3e253acdeb6bb14b990a401b
2020-06-04 00:17:58 +00:00
Treehugger Robot
49efd2aad0 Merge "Re-enable link type checking" 2020-06-03 21:30:22 +00:00
Dan Willemsen
be15ded040 Re-enable link type checking
When I removed the actions that ran the python link type checker, I
forgot that the Make version hadn't been enabled yet. Enable the Make
version.

Bug: 143748700
Test: treehugger (particularly, build_test on the downstream branches)
Change-Id: I293b3be5ca7828c9d7148e13d88b0f0bba54d964
Merged-In: I293b3be5ca7828c9d7148e13d88b0f0bba54d964
Merged-In: I08090db44d47f809fbaa0c4ad373e46e6a3fbe2e
2020-06-03 21:09:32 +00:00
Treehugger Robot
8c6c2cd3de Merge "refactor kernel module build, add version support" 2020-06-03 18:10:52 +00:00
Treehugger Robot
aa62df07cf Merge changes Ia1392b7d,I199788d4,I9c8ac0e6
* changes:
  move BOARD_RECOVERY_KERNEL_MODULES_LOAD default
  move module list creation outside conditionals
  fix reference to BOARD_ODM_MODULES_LOAD
2020-06-03 18:10:44 +00:00
Ulya Trafimovich
40e55c20eb Add product variable PRODUCT_BROKEN_SUBOPTIMAL_ORDER_OF_SYSTEM_SERVER_JARS.
If true, incorrect order of system server jars does not cause a build
error. The order is non-optimal if some jar X precedes its dependency Y.
In that case dexpreopt will be unable to resolve any rerefences from X
to Y.

Test: lunch cf_x86_phone-userdebug && m nothing
Test: lunch aosp_car_arm && m nothing

Bug: 140451054

Change-Id: I70efd365fa9fbd9e40792d646f8471d009164924
Merged-In: I70efd365fa9fbd9e40792d646f8471d009164924
(cherry picked from commit 17715b48f0)
2020-06-03 17:38:26 +01:00
Yo Chiang
60da88da55 Make required modules support :32 and :64 suffix
Support specifying bitness of required modules with :32 and :64 suffix,
like in PRODUCT_PACKAGES.

Bug: 155869107
Bug: 129323707
Test: TH noop
Change-Id: I47d523e4e57cb8a99629fd241a16069c0be55903
2020-06-03 18:27:42 +08:00
Yo Chiang
1b8283358e Refactor *-select-bitness-of-required-modules
* Streamline required module bitness resolution

If a module is for cross host OS, the required modules are also for that
OS.
Otherwise if the requirer module is native and the required module is
shared library or native test, then the required module resolves to the
same bitness.
Otherwise the required module resolves to both variants, if they exist.

* Factor out the common logic and merge
  <target|host|host-cross>-select-bitness-of-required-modules

This lays the road for follow-up changes to add bitness suffix support.
This slightly reduces readibility. To make up for the loss, the
bitness-resolving logic is easier to maintain since we don't have
multiple copies of *-select-bitness-of-required-modules.

Bug: 155869107
Test: check the diff of product_target_FILES and product_host_FILES
Test: check the diff of ALL_MODULES.*.REQUIRED_FROM_(TARGET|HOST)
Change-Id: Ib2f4b548535e983d621dad71cb920101111140f2
2020-06-03 18:27:20 +08:00
Steve Muckle
2335d76ada refactor kernel module build, add version support
Refactor the build support for kernel modules. This refactoring is
leveraged to add support for directories of kernel modules in each
partition. To add a directory of kernel modules, define
BOARD_KERNEL_MODULE_DIRS to include the directory name, for example:

BOARD_KERNEL_MODULE_DIRS := 5.4

The build will then check all the usual kernel module related macros
with an extension of _5.4, for example you can define

BOARD_VENDOR_KERNEL_MODULES_5.4 := <modules to copy>
BOARD_VENDOR_KERNEL_MODULES_ARCHIVE_5.4 = <path to archive file>
BOARD_VENDOR_KERNEL_MODULES_LOAD_5.4 := <modules for load list>

Bug: 157645635
Change-Id: I1687d0ec85c1dcf21350350623b4689aba3f6717
2020-06-02 15:17:26 -07:00
Steve Muckle
c88a8c88e4 move BOARD_RECOVERY_KERNEL_MODULES_LOAD default
Moving this makes each of the partition's kernel module Makefile
generation more similar, enabling a forthcoming cleanup/refactoring.

If recovery-is-boot and there are kernel modules defined in
BOARD_GENERIC_RAMDISK_KERNEL_MODULES, those kernel modules will
now be included in the default assignment to
BOARD_RECOVERY_KERNEL_MODULES_LOAD. If this is not desired then
BOARD_RECOVERY_KERNEL_MODULES_LOAD may simply be set to
BOARD_RECOVERY_KERNEL_MODULES (or a custom list of recovery kernel
modules to load).

Bug: 157645635
Change-Id: Ia1392b7d20d07cee75420edd95dcee1dc825516e
2020-06-02 15:17:15 -07:00
Steve Muckle
1013d789de move module list creation outside conditionals
Currently the two special-case calls to create just a module load list
(as opposed to copying a set of modules and creating a module load list)
are inside checks that the related board macro for the module set is not
empty.

While it would be incorrect to create a non-empty module load list with
an empty set of modules, this error would quickly surface at runtime.
More importantly, moving these out will permit refactoring this code to
clean it up.

Bug: 157645635
Change-Id: I199788d49072d4c59737b3ef2c75546852cf3e36
2020-06-02 15:17:04 -07:00
Steve Muckle
f291097221 fix reference to BOARD_ODM_MODULES_LOAD
This check is meant to initialize BOARD_ODM_KERNEL_MODULES_LOAD to
BOARD_ODM_KERNEL_MODULES if BOARD_ODM_KERNEL_MODULES_LOAD is empty.

Bug: 157645635
Change-Id: I9c8ac0e64bb002e926d15b446a63801d7cfa9911
2020-06-02 15:16:54 -07:00
Treehugger Robot
6231dd8584 Merge "Remove unused check-api rule" am: fa9ea4b8b0
Original change: https://android-review.googlesource.com/c/platform/build/+/1322795

Change-Id: I5e1d6dd6629d51410a15620e22d0460d9c39c68b
2020-06-02 19:27:03 +00:00
Aurimas Liutikas
9c5b07966e Remove unused check-api rule
Change-Id: I0297b226d066e99ee4fc4c2b22e160eafc7f5a8a
Test: Treehugger?
2020-06-02 17:01:52 +00:00
sophiez
a81ee59b74 Copy generated xml file for NDK api coverage to dist when CLANG_COVERAGE flag set.
Test: build/soong/soong_ui.bash --make-mode SKIP_ABI_CHECKS=true TARGET_PRODUCT=aosp_cf_x86_phone TARGET_BUILD_VARIANT=userdebug droid dist DIST_DIR=/usr/local/google/home/sophiez/my_dist_dir EMMA_INSTRUMENT=true EMMA_INSTRUMENT_FRAMEWORK=true CLANG_COVERAGE=true SKIP_BOOT_JARS_CHECK=true tests

Change-Id: I778da9ca7897752274744eca5530412c146fac96
2020-06-01 12:18:54 -07:00
Ulyana Trafimovich
25ed6113d5 Merge "Provide library path to android.test.base for dexpreopt." am: 1c294551b4
Change-Id: Ia307ddb9cffe74e9eaf7009924617b41d4facb76
2020-06-01 15:18:13 +00:00