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
It should happen after adjusting vendor and product variables.
Bug: 162476652
Test: see image variant with LOCAL_PROPRIETARY_MODULE := true
Change-Id: I071434916c9ad18572c559a26e3ef6abb8c47303
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
Test: Verified in conjunction with changes to soong (aosp/1359742)
Test: Treehugger to verify backwards compatibility
Change-Id: I39d2669ff74b4387606b6416e8afefc1f6507348
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
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
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
This reverts commit 6e1fa4452b.
Reason for revert: relanding a reverted changed
Bug: 153073816
Change-Id: I3735866776cf6eb0320c9fb8c6be8ac0c48baa1c
Test: m
This reverts commit f9e67a8980.
Reason for revert: broke some targets
Exempt-From-Owner-Approval: reverting
Change-Id: I10af29b0fcf564dba0c3dbc1951b660b24fc58bb
This change enables recording ALL_DEPS information
without having to specify the deps-license goal, which
can be useful to populate the dependencies field of
module-info.json for various types of post-processing.
Usage: `RECORD_ALL_DEPS=true make droid` (preferred), or
`make RECORD_ALL_DEPS=true droid`.
Test: make, inspect module-info.json
Test: RECORD_ALL_DEPS=true make, inspect module-info.json
Bug: 151755703
Change-Id: Ib81a8dfb0ecbe0b63be320a9d33e558b419cb4b2
A module is marked unavailable for platform when 1) it does not have
"//apex_available:platform" in its apex_available property, or 2)
it depends on another module that is unavailable for platform.
In that case, LOCAL_NOT_AVAILABLE_FOR_PLATFORM is set to true for the
module in the Make world. Later, that flag is used to ensure that there
is no module with the flag is installed to the device.
The reason why this isn't entirely done in Soong is because Soong
doesn't know if a module will be installed to the device or not. To
explain this, let's have an example.
cc_test { name: "mytest", static_libs: ["libfoo"]}
cc_library_static { name: "libfoo", static_libs: ["libbar"]}
cc_library { name: "libbar", apex_available: ["com.android.xxx"]}
Here, libbar is not available for platform, but is used by libfoo which
is available for platform (apex_available defaults to
"//apex_available:platform"). libfoo is again depended on by mytest
which again is available for platform. The use of libbar should be
allowed in the context of test; we don't want to make libbar available
to platform just for the dependency from test because it will allow
non-test uses of the library as well.
Soong by itself can't tell whether libfoo and libbar are used only in the
context of a test. There could be another module depending them, e.g.,
cc_library_shared { name: "mylib", static_libs: ["libfoo"] }
can exist and it might be installed to the device, in which case
we really should trigger an error.
Since Make has the knowledge of what's installed and what's not,
the check should be done there.
Bug: 153073816
Test: m
Change-Id: I14ddf0e5700d0a7bf60e4e41536efbd26ab5ed3d
This was deprecated in R, which has now branched, and there aren't any
users on master.
Test: build-aosp_crosshatch.ninja is the same (except for the removal of the empty auxiliary target)
Test: treehugger
Change-Id: I306156ab7f91cd4a2258554b4215766c99cd12d1
Don't copy tests or test data to the test suite directories if the
module is marked LOCAL_UNINSTALLABLE_MODULE := true.
Fixes: 153758132
Test: m checkbuild
Change-Id: Ibdf18807a2ffe9bb352d74880a802ad55b57f154
Propagate partition tag data to apexkeys.txt and
apkcerts.txt so that merge_target_files.py can build
merged versions of these files by filtering the
framework files for framework partitions and filtering
the vendor files for vendor partitions.
Bug: 138942268
Change-Id: Ic3226728e97dae84d38ec230ccc86d1b124bea94
The current test suite rule implementation has a bug where test data
files are excluded from the final suite zip files when a suite doesn't
have a designated testcases output directory, which is represented by
COMPATIBILITY_TESTCASES_OUT_$(suite_name).
Specifically, the rule that collects test data files for each suite
filters out suite output paths that conflict with module output paths,
which happens when a suite doesn't have its own testcases output
directory. It seems to have been done this way just to avoid make rule
conflict errors, but it ended up causing missing test data files.
This change fixes it by adding an indexing purpose only test suit file
variable.
Fixes: 140761783
Test: m general-tests
Test: Compared before vs after, no meaningful differences.
Test: Changed bc-tests to a device test and built general-tests.
Test: Before - data files missing, after - data files present
Change-Id: I2008992f4144c6ee115f4b4e4ac9caa4312bbe34
Similar to native:vendor, native:product can use VNDK libs but not
vndk_private.
It is activated when PRODUCT_PRODUCT_VNDK_VERSION is set.
This restores the reverted commit
4e7e76fe5a (aosp/1197274).
The problem of the original CL was assuming no modules have both
LOCAL_PRODUCT_MODULE and LOCAL_USE_VNDK in the old implementations.
But many vendor modules in the targets without setting
PRODUCT_PRODUCT_VNDK_VERSION in old branches had both flags that
caused link failures.
To make it no-op without PRODUCT_PRODUCT_VNDK_VERSION, I defined
LOCAL_USE_VNDK_PRODUCT that is set to true if
PRODUCT_PRODUCT_VNDK_VERSION is defined and LOCAL_PRODUCT_MODULE is
true.
Bug: 146620523
Test: build with PRODUCT_PRODUCT_VNDK_VERSION := current
Change-Id: I344c7dc1c47f08706c101e486ff07c3f10aff8ac
This reverts commit 4e7e76fe5a.
Reason for revert: build breaks (bid: 6147225) and postsubmit test fails.
There are some modules that have both "product_specific: true" and "vendor_available: true", which tags the module as "native:product" unintentionally.
We need to clean up these cases first and revisit this CL.
Bug: 146620523
Bug: 147987741
Change-Id: Ib07543235d72a135b6b732aaa909c147d2df832b
Similar to native:vendor, native:product can use VNDK libs but not
vndk_private.
It is activated when PRODUCT_PRODUCT_VNDK_VERSION is set.
Bug: 146620523
Test: build with PRODUCT_PRODUCT_VNDK_VERSION := current
Change-Id: Icfd94dfc30e77581991799d9e2f408f57da22cea
Adds the backend makefile parser for the LOCAL_FUZZ_DATA vars generated
by the cc_fuzz target.
Bug: 141026328
Test: m example_fuzzer, fuzz target should have adjacent corpus/dict
files.
Change-Id: Ide2c34318f11be132992650ce5cc1fd27895915c
TARGET_TRANSLATE_2ND_ARCH is never set to true any more,
TARGET_NATIVE_BRIDGE_ARCH := arm is always used instead.
Bug: 141242600
Test: m checkbuild
Change-Id: Id3e0614a1d8a088d37929655b74fecd812606db2
This reverts commit 068d101077.
Reason for revert: Caused a regression
Test: Added data to a sh_test and compared before vs after
Fixes: 140761783
Change-Id: Ied6427cb2dc3093fb88632eb8f337c2b76e86b95
Support for rust modules built in Soong.
Bug: 136189233
Test: Test module builds.
Test: crosvm builds.
Change-Id: Idf2e4a4f760cbcee1d35fe6567ef8e12d4855094
This saves another 5-15% of makefile eval time (depending on
target/branch).
I'm not sure if deps-license is still used at all, but we'll only save
the information for it if it's actually going to run now.
Since the default module tag is "optional", we really don't need to save
a list of most modules in another variable. I don't see anything that
really needs to see the list of optional modules.
Test: treehugger
Change-Id: Iaf54e9932fbe8e61f10bd0c9336fc4fdefea27ab
It turns out that this single line was responsible for 28-44% of the
time we spent parsing makefiles. So instead of filtering across
$(ALL_MODULES), check to see if a variable that we always would set is
set.
Test: treehugger
Test: check kati-build eval time before/after
Change-Id: I946c2efd060181a4ae9edd3409c53d9b49a58285
In the case of building a multilib library that defines LOCAL_VINTF_FRAGMENTS,
the previous code would create duplicate rules for the fragment. This change
uses the my_vintf_new_installed variable (which may be empty) to avoid the
duplication.
Bug: 139268165
Test: Verify that build warnings are gone, yet VINTF fragment still installed.
Change-Id: I579ec650019a29a6a105118ad5e5ae9376e8d9bc
my_installed_test_data (LOCAL_TEST_DATA) no present in test
suite zip files for device tests
Bug: 135957483
Test: 1. Remove the patch aosp/1008195
2. m general-tests
3. unzip general-tests.zip
4. data files should exist in target/testcases/toybox-tests
Change-Id: I3f0a4d87e284c809625843d55dc5d35ef77e79bb
When an Android.mk specifies a local path that is outside the current
directory, it uses '..', since we prepend $(LOCAL_PATH)/ to the given
path.
This path ('a/b/../c') gets inserted into command lines and
dependencies. For dependencies, when it gets to Ninja, Ninja calls
CanonicalizePath and removes those references ('a/c'), but the command
line is preserved.
So we've got a command line that references 'a/b', but no dependency on
it. Usually that's not a big problem, but it's an issue if we're trying
to only expose dependencies to the rule, like with RBE only sending the
dependencies to the remote workers. So use our 'clean-path' macro to
collapse the '..' references in Kati so that they don't show up in the
command line either.
Test: treehugger
Test: build a system image with RBE
Change-Id: I0706faa2ac15e9c12c720f43c7bb8171c5efd97c
All users have been removed.
Test: treehugger
Change-Id: I2cfe720bef88cc5485e90746d85a7e0a5d068ef7
Merged-In: I2cfe720bef88cc5485e90746d85a7e0a5d068ef7
So that we actually respect different LOCAL_REQUIRED_MODULES for the
host and device versions instead of unioning them. That got particularly
problematic when LOCAL_SHARED_LIBRARIES is implicitly added to
LOCAL_REQUIRED_MODULES. We also used to walk through device-only modules
when filling out the list of required modules, which triggered even more
extra installations.
This also changes the requirements for PRODUCT_HOST_PACKAGES so that it
no longer accepts target-only phony modules (since we can now
differentiate them). They were all removed in previous patches.
Test: treehugger; diff resulting builds
Test: diff list of product_target_FILES and product_host_FILES
Change-Id: I2ed8950320d31f5693323ad8cef6ec5b6780b7d4
We have developed a vendor module and set LOCAL_VENDOR_MODULE := true<space> (Added a space character at the end)
The android build system then can't installed it in the right partition until we removed the extra space character.
bug: 129725067
Change-Id: I081ffe7f39a9c850007ba304c815436500be694c
This is similar to module-built-files, except that it only returns
files built for the target, not the host.
Bug: 119423884
Test: Build with the no-vendor-variant VNDK change that uses this
function.
Change-Id: I2a3d99003b05999eae01c0b90bb62b5263d65592
After migrating the primary install location of test modules into a
generic testcase folder. All test modules will install to
out/target/product/<product>/testcase/<module_name>/ if they don't
specify their LOCAL_MODULE_PATH.
But the dependent test module should also be copied to testcase
folder even its LOCAL_MODULE_PATH be set.
BUG: 128815093
Test: 1. vi cts/tests/signature/api-check/Android.mk
add LOCAL_MODULE_PATH for cts-hiddenapi_flags-csv
2. m CtsHiddenApiBlacklistDebugClassTestCases
Then, hiddenapi_flags.csv should also be copied to testcase
folder.
Change-Id: Iff872447348e74b2728e0913d04e46ccbaa4e972