Commit graph

491 commits

Author SHA1 Message Date
yangbill
6dd962fdda Preserve all COMPATIBILITY_SUITES values in module-info
Extend COMPATIBILITY_SUITES in module-info to avoid overwriting previous
values. In particular, this happens for the `host-unit-tests` suite
which is automatically added by Soong rules only to be clobbered by the
modules that have both device and host variants.

Bug: 209806322
Test: source build/envsetup.sh ; lunch aosp_cf_x86_64_phone ;
      m out/target/product/vsoc_x86_64/module-info.json
Change-Id: I56a2d4c9786ed3da1e788ba211ec1bcaa6559549
2021-12-14 05:54:30 +00:00
Colin Cross
802f2116ed Translate BUILT_INSTALLED to LOCAL_BUILT_MODULE
Soong creates install rules and lists them in LOCAL_SOONG_INSTALL_PAIRS,
where they get copied to ALL_MODULE.$(m).BUILT_INSTALLED.  BUILT_INSTALLED
is used by package-modules.mk to copy the built modules to alternate
install locations for building zips like continuous_native_tests.zip.

Translate Soong's built module location, which is listed in
LOCAL_PREBUILT_MODULE_FILE, into $(LOCAL_BUILT_MODULE) when setting
BUILT_INSTALLED so that package-modules.mk copies from
$(LOCAL_BUILT_MODULE) instead of $(LOCAL_PREBUILT_MODULE_FILE).  This
ensures that the transitive dependencies added to $(LOCAL_BUILT_MODULE),
for example the unstripped symbols files, are present when
continuous_native_tests.zip is built.

Bug: 206137439
Test: manual
Change-Id: I1a45cd6d3c81d6435a10f4d29557e521753068a4
2021-11-15 13:15:22 -08:00
Treehugger Robot
372d74a8c9 Merge "Record ALL_DEPS by default." 2021-11-11 04:48:16 +00:00
Jim Tang
5c6410edee Record ALL_DEPS by default.
Abandon the use of RECORD_ALL_DEPS to record ALL_DEPS.

BUG: 204397180

Test: m, and inspect module-info.json.
Change-Id: Iaf35580b52c11ad37017b1fb8e0937b859d3f55b
2021-11-11 10:24:51 +08:00
Treehugger Robot
585ec03c47 Merge changes from topic "soong-java-install"
* changes:
  Move java install rules into Soong
  Don't create compatibility suite copy rules for installed path
2021-11-10 17:05:51 +00:00
Colin Cross
a69b809425 Don't create compatibility suite copy rules for installed path
Don't create compatibility suite copy rules for $(LOCAL_BUILT_MODULE)
to $(LOCAL_INSTALLED_MODULE), as that could conflict with a Soong
install rule.  Instead, always create the install rule the normal way,
and replace the compatibility suite copy rule with a noop if it is the
same as the normal rule.

Bug: 204136549
Test: m checkbuild
Change-Id: Ic8ac80eda8554fae2b7ecc2516165da020bdaebe
2021-11-08 15:23:32 -08:00
Colin Cross
d954ea888a Add missing dependency from module name to symlinks
The rules to install the symlinks had dependencies from PRODUCT_PACKAGES
install rules, but from manual install requests like `m toybox`.  Add
the missing dependencies.  Also add the new declare-0p-target licensing
call.

Fixes: 205524422
Test: m toybox
Change-Id: Ie9a5e37b09250aa271ab153a13f41bc34fa4a38a
2021-11-08 19:40:22 +00:00
Steven Moreland
ec71cbf0c8 Merge "vintf recovery install parity w/ init_rc" 2021-11-04 22:28:51 +00:00
Bob Badour
879cfa867d Add macros for non-module license metadata and deps
Gets rid of .meta_module files and instead defers emitting rules until
after all the non-module targets have been processed. Allows direct
dependency on .meta_lic files, which in turn depend on license text
files.

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all
Test: m systemlicense
Test: m reportmissinglicenses

Change-Id: I2c467feac6e13a9366ff66f924889f1dbd48c3f1
2021-11-03 00:52:25 +00:00
Treehugger Robot
dcb0e44c46 Merge "Add share_libs and system_share_libs to module-info" 2021-11-02 01:52:17 +00:00
Steven Moreland
b186183ae2 vintf recovery install parity w/ init_rc
There was a relatively recent change (id
I82d0f40d6d7047e271612204391c5a027f84f52f) which avoided installing
init_rc scripts to system when a module was installed to system. This
same bug also existed in VINTF installs.

Future consideration: macrotize behavior (delaying since there are some
subtle differences in paths/variables and given bazel efforts).

Fixes: 204270700
Test: boot
Test: 'mmma hardware/interfaces/health/aidl/default' installs vintf
fragments to '/system/etc/vintf/manifest' before this change but not
after.

Change-Id: Icf505af74c95386a0ed8cb4468dcf7c1122db847
2021-11-01 17:58:28 -07:00
yangbill
5f5e2362fa Add share_libs and system_share_libs to module-info
Bug: 202922558
Bug: 204269866
Test: m out/target/product/vsoc_x86_64/module-info.json

Change-Id: Idb4e66216cac4835968454f83196107f6bec4c1c
2021-11-01 06:38:43 +00:00
Colin Cross
23ee375a4a Support generating install rules in Soong
Support moving some install rules into Soong by allowing Soong to
provide a Makefile containing install rules, and by skipping parts
of base_rules.mk when Soong already created an install rule.

The install rules are exported as a Makefile instead of directly
in Soong's build.ninja file so that base_rules.mk can add dependencies
from the `required` property that are hard to resolve in Soong.

Bug: 204136549
Test: m checkbuild
Change-Id: Ife2964d76469b385e90c0c5f6adf21bd2b5e8bf6
2021-10-29 15:43:39 -07:00
Yuntao Xu
32a085c041 add LOCAL_DISABLE_TEST_CONFIG logic
Disable the generation of .config file when the variable
LOCAL_DISABLE_TEST_CONFIG is true.

Bug: 188927912
Test: rum 'm module-name' (`android_test_helper_app` type module)
Test: TreeHugger
Change-Id: I64372b4ba84fcf1af937abdee345ceb1d3c2f6c5
2021-05-27 10:19:48 -07:00
Treehugger Robot
207405719b Merge "Add LOCAL_FULL_VINTF_FRAGMENTS to handle full path" 2021-04-22 17:03:31 +00:00
yangbill
877586c8c8 Only allow LOCAL_IS_UNIT_TEST set to ALL_MODULES if defined.
To prevent the argument be cleaned if the same module name with
different unit_test value, treat it as unit test if one of the module is
treated as unit tests.

Bug: 176096135
Test: m out/target/product/generic/module-info.json
Change-Id: Iee4ee1063d47dcba1aaf915ec9e4e56f8c7df787
2021-04-19 20:34:07 +08:00
Liz Kammer
5b6f5a7bcc Add LOCAL_FULL_VINTF_FRAGMENTS to handle full path
Soong supports references to other modules for vintf_fragments property,
so full paths need to be passed from Soong to make rather than module
local paths.

Test: m droid
Bug: 184567830
Change-Id: Ia7f1cf977de8aeb08d41624277ff6231198222e5
2021-04-16 16:40:59 -04:00
Liz Kammer
382be36c43 Add LOCAL_FULL_INIT_RC to handle init_rc full path
Soong supports references to other modules for init_rc property, so full
paths need to be passed from Soong to make rather than module local
paths.

Test: m droid dist
Bug: 184567830
Change-Id: Ib1873a3418830f5cbf32e26f55d3ad0ab0d9c9c5
2021-04-08 11:33:46 -04:00
Bob Badour
17831e3da3 Remove LOCAL_LICENSE_KINDS from core makefiles.
Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all
Change-Id: I4deec3e07862e89dd32880774efb4624a9723cf2
2021-02-16 04:37:23 -08:00
Bob Badour
0390580262 [LSC] Add LOCAL_LICENSE_KINDS to build/make
Added SPDX-license-identifier-Apache-2.0 to:
  target/product/sysconfig/Android.bp
  tools/apicheck/Android.bp
  tools/product_config/Android.bp
  tools/releasetools/Android.bp
  tools/signapk/Android.bp
  tools/signtos/Android.bp
  tools/zipalign/Android.bp
  tools/ziptime/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD
    SPDX-license-identifier-CC-BY SPDX-license-identifier-GPL
    SPDX-license-identifier-GPL-2.0 SPDX-license-identifier-LGPL
    SPDX-license-identifier-MIT legacy_not_a_contribution
    legacy_restricted
to:
  Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD
    SPDX-license-identifier-CC-BY SPDX-license-identifier-GPL
    SPDX-license-identifier-MIT
to:
  tools/Android.bp
  tools/droiddoc/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD
    SPDX-license-identifier-GPL SPDX-license-identifier-GPL-2.0
    SPDX-license-identifier-LGPL SPDX-license-identifier-MIT
to:
  core/base_rules.mk
  core/dex_preopt_libart.mk
  core/package_internal.mk

Added SPDX-license-identifier-Apache-2.0 legacy_not_a_contribution
to:
  target/board/Android.mk

Added legacy_restricted
to:
  core/tasks/tools/package-modules.mk
  target/product/gsi/Android.bp
  target/product/gsi/Android.mk
  target/product/security/Android.bp
  target/product/security/Android.mk
  tools/acp/Android.bp
  tools/atree/Android.bp
  tools/fs_config/Android.bp
  tools/fs_config/Android.mk
  tools/fs_get_stats/Android.bp
  tools/libhost/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all

Exempt-From-Owner-Approval: janitorial work
Change-Id: Id67a4eb1312940f999643b2ae57f45f34f120724
2021-02-14 10:37:20 -08:00
Yifan Hong
83d1c2ed4b Install init_rc for recovery modules correctly.
If a module is installed to TARGET_RECOVERY_ROOT_OUT,
then its init rc file (declared in LOCAL_INIT_RC) is installed
to $OUT/recovery/root/system/etc/init instead of
$TARGET(partition)_OUT_ETC/init.

Fixes: 178859897
Test: m snapuserd.recovery

Change-Id: I82d0f40d6d7047e271612204391c5a027f84f52f
2021-02-02 17:04:53 -08:00
yangbill
732b858481 Add unit_test option to module-info.json
Bug: 176096135
Test: atest -m hello_world_test, check module-info.json
Change-Id: Id8bc2eb0d93896afcbe5ce87b0205528615f090e
2021-01-08 17:36:56 +08:00
Dan Shi
41f6291a9f Add unit tests to host-unit-tests suite
Bug: 172006742
Test: m
Change-Id: Id58f5a24df2fe61229ce2eae2d655f7aa31b6aba
2020-11-16 16:55:42 -08:00
Jooyung Han
b27c2e8af9 Use file_contexts for flattened apexes
Because flattened apexes are installed in /<partition>/apex, associated
file_contexts file should be modified to accommodate path changes and
also merged into target-wide file_contexts.bin file.

Soong now emits modified file_contexts via LOCAL_FILE_CONTEXTS, and
these files are collected into a temporary file_contexts.modules.tmp
file, which is used as an additional input of file_contexts.bin.

Bug: 166518492
Test: m file_contexts.bin
      check the contents of file_contexts.concat.tmp file
Change-Id: I002a2294af9e06baeaf54bc5a9a5380d23b8a3da
2020-09-23 15:43:58 +00:00
Dan Shi
22bc099c02 Force extra config file to be .config
TradeFed only supports .config file as test config.

Bug: 163344047
Test: m HelloWorldTests

Change-Id: Ib963d04fc308b9c319d5b59f50f9ca9b5b575b72
2020-09-16 15:52:13 -07:00
Treehugger Robot
897cfaee46 Merge "Add test_mainline_modules option support in mk" 2020-09-09 07:36:11 +00:00
kellyhung
0ba6ec6f49 Add test_mainline_modules option support in mk
Bug: 165425972
Test: Apply aosp/1418212
      atest -b hello_world_test
      Check module-info.json for hello_world_test HelloWorldTests and
HelloWorldHostTest

Change-Id: Ie30a09a54b0ae927ca4d8d1aaba2ac0cdb15233a
2020-09-03 02:37:44 +00:00
Martin Stjernholm
a24c0fe655 Merge "Preserve symlinks in the Soong prebuilt install steps for host binaries and shared libs." 2020-09-01 10:32:49 +00:00
Martin Stjernholm
49a4e9b52e Preserve symlinks in the Soong prebuilt install steps for host binaries
and shared libs.

If a prebuilt module file is a symlink in the .intermediates tree it is
preserved when copied to the final install location. This preserves
symlinks to prebuilt binaries, so that they are run from their prebuilt
source location and can find libraries in relative paths from there.

Symlinks are converted to absolute, to not fail if they are relative in
the source tree.

Test: m clean && m droid dist checkbuild
  with and without the change, then compare the lists of symlinks in
  the out/ trees
Test: build/soong/soong_ui.bash --make-mode \
    TARGET_PRODUCT=crosshatch_hwasan TARGET_BUILD_VARIANT=userdebug \
    droid SANITIZE_TARGET=hwaddress \
    continuous_instrumentation_tests_api_coverage \
    continuous_native_tests device-tests platform_tests
  check that libclang_rt.hwasan_static-aarch64-android.a isn't a
  symlink in out/target/product/crosshatch/obj
Bug: 145934348
Change-Id: I7600e5b0754f8ea6cd0ffc8e1ba6d39153f182aa
2020-09-01 00:24:54 +01:00
Treehugger Robot
947cb0fd87 Merge "Introduce BOARD_CURRENT_API_LEVEL_FOR_VENDOR_MODULES" 2020-08-28 04:26:49 +00:00
Jeongik Cha
0d1d98157a Introduce BOARD_CURRENT_API_LEVEL_FOR_VENDOR_MODULES
If BOARD_CURRENT_API_LEVEL_FOR_VENDOR_MODULES has a numeric value,
it replaces "current" or "system_current" with the version which
the flag indicates.

Bug: 163009188
Test: BOARD_CURRENT_API_LEVEL_FOR_VENDOR_MODULES=29 m, and then check if every vendor
java module's sdk_version is 29 if its sdk_version was current.

Change-Id: I8c7cf21563b984b8e9ef398192031b1f66d96494
2020-08-24 23:16:19 +09:00
Dan Shi
0c9a525b98 Add extra_test_configs option support in mk
Bug: 163344047
Test: m -j HelloWorldHostTest hello_world_test HelloWorldTests
Change-Id: Ie63c2a80e01984ac9941d0bad4ad7948e0bb8ac0
2020-08-19 21:22:50 -07:00
Yo Chiang
15fbad3dfa Merge "Don't call $(my_path_comp) if $(dir $(LOCAL_PATH)) is TOP" 2020-08-12 03:55:57 +00:00
Yo Chiang
b5bbe4bca0 Merge "Revert "Error if $(LOCAL_PATH) is empty"" 2020-08-11 10:21:24 +00:00
Yo Chiang
e01766433a Revert "Error if $(LOCAL_PATH) is empty"
This reverts commit 60052f3a9f.

Reason for revert: Breaks build_test

Bug: 163473133
Change-Id: Ib5a8030f7b49b131f912e2df8026d3e2107c87a4
2020-08-11 10:19:32 +00:00
Yo Chiang
cbdfc3a5ed Merge "Error if $(LOCAL_PATH) is empty" 2020-08-11 07:58:57 +00:00
Yo Chiang
60052f3a9f Error if $(LOCAL_PATH) is empty
Bug: 162918277
Test: m com.android.art
Test: m MODULES-IN-art
Change-Id: I7c35dba22385e89313ea7210e9b1db15c7f6af86
2020-08-11 11:23:08 +08:00
Yo Chiang
150a1ca0c2 Don't call $(my_path_comp) if $(dir $(LOCAL_PATH)) is TOP
So we don't accidentally create phony rules like
`MODULES-IN-: MODULES-IN-` and `MODULES-IN-.: MODULES-IN-*`

Bug: 162918277
Test: m com.android.art
Test: ninja -t browse
Change-Id: Id0656d1b08bc933df57914df162853934352593b
2020-08-11 11:22:36 +08:00
Inseob Kim
ce83956fa9 Fix broken my_image_variant
It should happen after adjusting vendor and product variables.

Bug: 162476652
Test: see image variant with LOCAL_PROPRIETARY_MODULE := true
Change-Id: I071434916c9ad18572c559a26e3ef6abb8c47303
2020-08-10 13:04:23 +09:00
Inseob Kim
8b0ccdafbb Separate lists of soong sanitize modules
Dependencies of makefile modules are being redirected according to
SOONG_CFI_STATIC_LIBRARIES and SOONG_HWASAN_STATIC_LIBRARIES. But the
variables are shared among all variants (e.g. core, vendor, product,
arch), which can cause build error.

This splits the Makefile variables into several lists, one list per each
arch and each image variant, to correctly make the redirection.

Bug: 162476652
Test: build and inspect ninja
Change-Id: I8a46804d4b7c1c485e59e10710cc514a89333fa4
2020-08-04 17:18:01 +09:00
Chris Parsons
1abe7ef455 Add optional relative path to LOCAL_TEST_DATA processing
Test: Verified in conjunction with changes to soong (aosp/1359742)
Test: Treehugger to verify backwards compatibility
Change-Id: I39d2669ff74b4387606b6416e8afefc1f6507348
2020-07-17 17:09:21 -04:00
Dan Willemsen
343caec30c Refactor how MODULES-IN-* is defined
Unlike the previous performance patches, this does change the ninja
file, shrinking build-aosp_crosshatch.ninja on aosp-master from 393MB to
387MB, while reducing kati runtime from 28.6s to 27.7s.

Previously, MODULES-IN-art would depend on every target defined under
art/***. After this change, it only depends on the modules names that
were directly defined under it, and depends on the MODULES-IN-art-*
for its subfolders.

Bug: 158488548
Test: mmma system/core/adb
Test: mmma system/core
Change-Id: Idfe80f707738faae4777e0d6dc9fd08014775696
2020-06-16 15:35:37 -07: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
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
Sasha Smundak
f15ff83b07 Editorial: fix indentation
Test: treehugger
Change-Id: Ie461f7244c52c0ea5f463409290901c16e424636
2020-05-06 13:46:30 -07:00
Treehugger Robot
dcdd0db41a Merge "Reland "mark platform un-availability""" 2020-05-06 12:28:02 +00:00
Jiyong Park
403c255b6f Reland "mark platform un-availability""
This reverts commit 6e1fa4452b.

Reason for revert: relanding a reverted changed

Bug: 153073816
Change-Id: I3735866776cf6eb0320c9fb8c6be8ac0c48baa1c
Test: m
2020-05-04 11:12:00 +00:00
Jiyong Park
af4c62f78a Merge "Revert "mark platform un-availability"" 2020-05-04 10:58:24 +00:00
Jiyong Park
6e1fa4452b Revert "mark platform un-availability"
This reverts commit f9e67a8980.

Reason for revert: broke some targets

Exempt-From-Owner-Approval: reverting

Change-Id: I10af29b0fcf564dba0c3dbc1951b660b24fc58bb
2020-05-04 10:57:26 +00:00
Jiyong Park
8023018b0c Merge "mark platform un-availability" 2020-05-04 10:10:24 +00:00