apex now respects stem of java_library modules.
As a follow-up we need to suppor the same for other types of modules.
Exempt-From-Owner-Approval: cherry-pick from AOSP
Bug: 157638999
Test: m
Merged-In: Iaf5023020b5440f1ffd4f5414b5a7864655fc22a
(cherry picked from commit a62aa23990)
Change-Id: Iaf5023020b5440f1ffd4f5414b5a7864655fc22a
apex now respects stem of java_library modules.
As a follow-up we need to suppor the same for other types of modules.
Bug: 157638999
Test: m
Change-Id: Iaf5023020b5440f1ffd4f5414b5a7864655fc22a
The marked library(ies) were available to the APEX via the
hand-written whitelist in build/soong/apex/apex.go. Trying to remove the
whitelist by adding apex_available property to the Android.bp of the
libraries.
Exempt-From-Owner-Approval: cherry-pick from internal
Bug: 150999716
Test: m
Merged-In: I2b792657b444f0c963e1e92b7c91f6a0cfe1688c
(cherry picked from commit be6e2b6a18)
Change-Id: I2b792657b444f0c963e1e92b7c91f6a0cfe1688c
Introduce a singleton apex rule to merge contents of individual
deps-info results into a single output file.
Bug: 149622332
Test: m
Change-Id: I4ab7e1a3527fead97a81a5a2cb0e1e93a429117c
Merged-In: I4ab7e1a3527fead97a81a5a2cb0e1e93a429117c
Exempt-From-Owner-Approval: cp from aosp
(cherry picked from commit 849f844252)
For a given variant of a module that implements ApexModule interface,
the "updatable" property tests if this variant comes from an updatable
apex. For platform variants it is always false.
Test: lunch aosp_walleye-userdebug && m nothing
Bug: 138994281
Merged-In: I2d4c54fb397e29dc9b3203be7fb17be4536529f7
Change-Id: I2d4c54fb397e29dc9b3203be7fb17be4536529f7
Exempt-From-Owner-Approval: cp from aosp
(cherry picked from commit 7c140d828a)
This reverts commit c9c7116721.
This revert is to avoid merge conflict when ag/11299431 is auto-merged
to master.
This change will again be reverted when ag/11299431 lands.
Bug: 150999716
Test: m
Change-Id: Ia0f7a0e0eb8cf6f6f4d0693de01777a8a750c769
The marked library(ies) were available to the APEX via the
hand-written whitelist in build/soong/apex/apex.go. Trying to remove the
whitelist by adding apex_available property to the Android.bp of the
libraries.
Bug: 150999716
Test: m
Change-Id: I2b792657b444f0c963e1e92b7c91f6a0cfe1688c
The android_library module type can be used within an android_app that
can itself be added to an apex but android_library does not call
android.InitApexModule(module) and so it does not support apex variants
and so is treated as if it cannot be part of an APEX even though it
actually is.
Now, android_library supports AEPX variants.
Due to this change, the whilelist for apex_available got bigger.
Exempt-From-Owner-Approval: cherry-pick from internal
Bug: 156978407
Test: m
Merged-In: I3a21d653fe9c4159e3a89791fe1a8597865eeae6
Change-Id: I3a21d653fe9c4159e3a89791fe1a8597865eeae6
(cherry picked from commit bd133b1bdc)
The android_library module type can be used within an android_app that
can itself be added to an apex but android_library does not call
android.InitApexModule(module) and so it does not support apex variants
and so is treated as if it cannot be part of an APEX even though it
actually is.
Now, android_library supports AEPX variants.
Due to this change, the whilelist for apex_available got bigger.
Exempt-From-Owner-Approval: approved in rvc-dev
Bug: 156978407
Test: m
Merged-In: I3a21d653fe9c4159e3a89791fe1a8597865eeae6
Change-Id: I3a21d653fe9c4159e3a89791fe1a8597865eeae6
The android_library module type can be used within an android_app that
can itself be added to an apex but android_library does not call
android.InitApexModule(module) and so it does not support apex variants
and so is treated as if it cannot be part of an APEX even though it
actually is.
Now, android_library supports AEPX variants.
Due to this change, the whilelist for apex_available got bigger.
Bug: 156978407
Test: m
Merged-In: I3a21d653fe9c4159e3a89791fe1a8597865eeae6
Change-Id: I3a21d653fe9c4159e3a89791fe1a8597865eeae6
The marked library(ies) were available to the APEX via the
hand-written whitelist in build/soong/apex/apex.go. Trying to remove the
whitelist by adding apex_available property to the Android.bp of the
libraries.
Bug: 150999716
Test: m
Merged-In: I827d604c7e5a469a8b8a6d5a4b7917f2eaca48ca
Change-Id: I827d604c7e5a469a8b8a6d5a4b7917f2eaca48ca
apex_set takes an .apks file that contains a set of prebuilt apexes with
different configurations. It uses extract_apks to select and install the
best matching one for the current target.
Bug: 153456259
Test: apex_test.go
Test: com.android.media.apks
Change-Id: I1da8bbcf1611b7c580a0cb225856cbd7029cc0a7
Merged-In: I1da8bbcf1611b7c580a0cb225856cbd7029cc0a7
Introduce a singleton apex rule to merge contents of individual
deps-info results into a single output file.
Bug: 149622332
Test: m
Change-Id: I4ab7e1a3527fead97a81a5a2cb0e1e93a429117c
apex_set takes an .apks file that contains a set of prebuilt apexes with
different configurations. It uses extract_apks to select and install the
best matching one for the current target.
Bug: 153456259
Test: apex_test.go
Test: com.android.media.apks
Change-Id: I1da8bbcf1611b7c580a0cb225856cbd7029cc0a7
Passes an additional android.Module parameter through to avoid having
to use javaLibrary interface.
Bug: 146586360
Test: m nothing
Merged-In: Ie533c16c753dc9c43171d0223953adea7b2b5ee6
Change-Id: Ie533c16c753dc9c43171d0223953adea7b2b5ee6
(cherry picked from commit 581bbbe8cb)
There're two ways to enable hwasan:
- global setting: TARGET_SANITIZE=hwaddress
- individual setting: sanitize: { hwaddress: true }
This change covers both cases by looking up if com.android.runtime is
hwaddress santized or not.
Bug: 156678661
Test: m (soong test added)
Change-Id: I67c382c3e76a06f4b27f221eebd153c698647227
Passes an additional android.Module parameter through to avoid having
to use javaLibrary interface.
Bug: 146586360
Test: m nothing
Change-Id: Ie533c16c753dc9c43171d0223953adea7b2b5ee6
The marked library(ies) were available to the APEX via the
hand-written whitelist in build/soong/apex/apex.go. Trying to remove the
whitelist by adding apex_available property to the Android.bp of the
libraries.
Bug: 150999716
Test: m
Change-Id: I827d604c7e5a469a8b8a6d5a4b7917f2eaca48ca
A lib providing stable C APIs should be available only to the APEX
containing the library. It shouldn't be available to other APEXes,
especially via static linking.
This change also fixes a bug that llndkImplDep (the dependency from
llndk stub to its implementation library) was recognized as being in the
same APEX.
Bug: 151051671
Test: m
Change-Id: Ifda7f4a367f68afcde93c86cda45a28cacd91f99
The method is a thin wrapper around GetWalkPath and GetTagPath to make
it easy to construct a string representation of the current path.
It was originally inlined in the apex package. This change makes it a
function and moves it to the android package so make it more useful.
Bug: N/A
Test: m
Change-Id: I7e2bc2074baed759d67d9097151c9ac10e34ed31
networkstack-aidl-interfaces-*java has explicit apex_available now.
Accordingly, remove it from the whitelist
Bug: 133526962
Test: m nothing
Change-Id: If5427afb2470a7dffbd418e1c405af508577ad93
Move depsInfo into android for easier sharing with APK code.
Bug: 149622332
Test: m, diff'ing outputs for conscrypt module.
Change-Id: If0ee967d37425540e69b4ce9304229d9f2cd86bd
Merged-In: If0ee967d37425540e69b4ce9304229d9f2cd86bd
Exempt-From-Owner-Approval: cp from aosp
(cherry picked from commit 872a144dca)
This adds gcov coverage support for Rust device library and binary
modules (including test modules). Support is provided to pass Rust
static library gcno files to CC modules and visa versa.
Additional changes:
* Begin mutator added for Rust modules.
* SuffixInList added to android package.
* CoverageEnabled added to Coverage interface.
* CoverageFiles added to LinkableLibrary interface.
* Fix in coverage mutator for non-CC modules which marked the wrong
variant as the coverage variant.
* Added coverage libraries to the cc.GatherRequiredDepsForTest.
Bug: 146448203
Test: NATIVE_COVERAGE=true COVERAGE_PATHS='*' m -j <rust_module>
Change-Id: If20728bdde42a1dd544a35a40f0d981b80a5835f
Move depsInfo into android for easier sharing with APK code.
Bug: 149622332
Test: m, diff'ing outputs for conscrypt module.
Change-Id: If0ee967d37425540e69b4ce9304229d9f2cd86bd
networkstack-aidl-interfaces-*java has explicit apex_available now.
Accordingly, remove it from the whitelist
Bug: 133526962
Test: m nothing
Change-Id: If5427afb2470a7dffbd418e1c405af508577ad93
Merged-In: If5427afb2470a7dffbd418e1c405af508577ad93
Shared lib dependencies of a test is included in the APEX regardless of
whether the test has test_per_srcs or not.
Bug: N/A
Test: m (apex_test.go amended)
Change-Id: I6b16843cc7467c42e250aba88d79d5580ba47324
runtime_resource_overlay is put to an APEX via 'apps' property. It is
placed under ./overlay directory in it.
Bug: 154822536
Test: m
Change-Id: I8edf4a26c26368c52fb7b327b2ecc829f21ea148
The marked library(ies) were available to the APEXes via the
hand-written whitelist in build/soong/apex/apex.go. Trying to remove the
whitelist by adding apex_available property to the Android.bp of the
libraries.
Exempt-From-Owner-Approval: cherry-pick from AOSP
Bug: 150999716
Test: m
Merged-In: I11a4e877ee27f7c55e2f00371c6fa58daedb1a9f
(cherry picked from commit 601d31c234)
Change-Id: I11a4e877ee27f7c55e2f00371c6fa58daedb1a9f
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.
Exempt-From-Owner-Approval: cherry-pick from AOSP
Bug: 153073816
Test: m
Test: remove "//apex_available:platform" from libmdnssd (it is currently
installed to /system/lib), and check that `m system_image` fails
Merged-In: Ia304cc5f41f173229e8a154e90cea4dce46dcebe
(cherry picked from commit 89e850ab84)
Change-Id: Ia304cc5f41f173229e8a154e90cea4dce46dcebe
Bug: 148447155
Test: built a testing apex with unsigned payload.
Merged-In: I95aa3f11ff1adc1421fcd7ed5a356ee531a0a818
Change-Id: I95aa3f11ff1adc1421fcd7ed5a356ee531a0a818
(cherry picked from commit 98410fd9d6)
updatable APEXes should set min_sdk_version as well.
Bug: 152655956
Test: m
Merged-In: I8192086eb89fa958dd8ff1b731e43e24bf217ce2
Change-Id: I8192086eb89fa958dd8ff1b731e43e24bf217ce2
(cherry picked from commit 548640b55f)
libopus sets its own apex_available property.
Bug: 150999716
Test: m
Merged-In: I4cff3ebb7e017a1fb629b18b72238acf3df0d26e
Change-Id: I4cff3ebb7e017a1fb629b18b72238acf3df0d26e
(cherry picked from commit 47db5adb06)
This reverts commit e17caa63a6.
Reason for revert: rewrite this in ag/11250335 without neverallow
Bug: 152655956
Change-Id: I24436720056ac1b9878e37c2ee45c5806714f3e9
apex_deps/apex/apex_flattened mutators don't have to run if module is
disabled.
For some branches which have no valid targets, apex modules are disabled
by the os mutator. e.g. aosp-build-tools
Some enforcement checks which run during those mutators may fail because
build-environment doesn't provide full context information.
For example, "Platform_version_all_codenames" config variable is not
set while apex.min_sdk_version uses one of those codenames.
Bug: 152655956
Test: m
Merged-In: I47e27d2d025ba4c36534708b113ce77c4cb2397b
Change-Id: I47e27d2d025ba4c36534708b113ce77c4cb2397b
(cherry picked from commit 49f6701e9a)
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
Test: remove "//apex_available:platform" from libmdnssd (it is currently
installed to /system/lib), and check that `m system_image` fails
Change-Id: Ia304cc5f41f173229e8a154e90cea4dce46dcebe
For a given variant of a module that implements ApexModule interface,
the "updatable" property tests if this variant comes from an updatable
apex. For platform variants it is always false.
Test: lunch aosp_walleye-userdebug && m nothing
Bug: 138994281
Change-Id: I2d4c54fb397e29dc9b3203be7fb17be4536529f7
The marked library(ies) were available to the APEXes via the
hand-written whitelist in build/soong/apex/apex.go. Trying to remove the
whitelist by adding apex_available property to the Android.bp of the
libraries.
Bug: 150999716
Test: m
Merged-In: I11a4e877ee27f7c55e2f00371c6fa58daedb1a9f
Change-Id: I11a4e877ee27f7c55e2f00371c6fa58daedb1a9f
It is no longer needed because non-static java_library dependencies are
not considered to be part of the depending APEX.
Bug: 153443117
Bug: 153306490
Test: m nothing
Merged-In: I7d58d1047b2d400395a253e492b35008284778ff
Change-Id: I7d58d1047b2d400395a253e492b35008284778ff
When a source and a prebuilt module are present in the same build a
dependency is added from the source module to the prebuilt module.
Previously, the code for generating the APEX did not recognize that
tag and in some cases (e.g. for cc_(prebuilt_)library_shared) will
fail the build.
This change:
1) Adds a test to reproduce the problem.
2) Improves the debug message by pretty printing the tag.
3) Adds a new ExcludeFromApexContents interface that can be implemented
by a tag to declare that it should be excluded from the APEX
contents.
4) Ignores tags that implement that interface when generating APEX
contents.
5) Implements that interface on prebuiltDependencyTag to fix the
test.
Bug: 153326844
Bug: 153306490
Test: m nothing
Merged-In: I9dd4312c4f995c816c0a31d8d733eb5d7f56e1ea
Change-Id: I9dd4312c4f995c816c0a31d8d733eb5d7f56e1ea
Previously, adding java_library to an sdk required that the names of
any APEXes that transitively compiled against it were added to its
apex_available property. This change removes that requirement.
Also corrects the dependency path in the TestApexAvailable_IndirectDep
error which previously passed through "shared from static" static
dependency tags even though those are explicitly NOT followed when
checking apex_available settings.
Bug: 152878661
Bug: 153306490
Test: m droid
Merged-In: I995ed38956c1bc210b09494812de012fed9f9232
Change-Id: I995ed38956c1bc210b09494812de012fed9f9232
Having dependency tags in the dependency path that shows why a specific
module is considered part of an apex makes it easier to understand why
that is the case and detect possible issues.
Bug: 152762638
Bug: 153306490
Test: m nothing
Merged-In: Iba2a8a5a6abe03dadee456e760aa4373cd00c07b
Change-Id: Iba2a8a5a6abe03dadee456e760aa4373cd00c07b
The DepIsInSameApex() and RequiredSdks() methods were defined in a few
places to avoid having to depend on the whole ApexModule/SdkAware
interfaces directly. However, that has a couple of issues:
1) It duplicates functionality making it difficult to change, changes
to the definitions outside the main interfaces do not cause compile
time failures, instead they result in a runtime change in behavior
which can be difficult to debug.
2) IDE navigation (specifically in Intellij) does not detect that the
duplicate definitions can resolve to the definitions in the main
interface.
This change extracts the methods into their own interfaces and reuses
those interfaces instead of duplicating the methods to fix both of
these issues.
Bug: 152878661
Bug: 153306490
Test: m nothing
Merged-In: I0cfdf342a14eb0bfb82b1bd17e0633d81c7facfb
Change-Id: I0cfdf342a14eb0bfb82b1bd17e0633d81c7facfb
Delegate the responsibility for determining whether the
walkPayloadDeps() should visit a child dependency to its do function.
This is needed to allow the visitor in checkApexAvailability() to avoid
checking the apex_available setting after crossing the APEX boundary.
Bug: 152878661
Bug: 153306490
Test: m droid
Merged-In: If46a2f74b6eca670befc3aeae430650e85542346
Change-Id: If46a2f74b6eca670befc3aeae430650e85542346
The apex available check can traverse quite a long path (5+ steps) to
get from the apex to a module that is missing the apex from its
apex_available property. Understanding where that dependency came from
can often require examining the dependency path which can be difficult.
This change adds the path to the error to simplify that process.
Bug: 153306490
Test: m nothing
Bug: 152762638
Merged-In: Ic4eb169dc2026cd8339d49e23b25d6d1c3879750
Change-Id: Ic4eb169dc2026cd8339d49e23b25d6d1c3879750
Makes sure that the module snapshots do not rely on the white list
of apex available settings so that when those lists are removed it is
not necessary to update any snapshots.
Bug: 142935992
Bug: 153306490
Test: m nothing
Merged-In: Iedcff7dfc2646a4da77258d16e06657dd2f411f9
Change-Id: Iedcff7dfc2646a4da77258d16e06657dd2f411f9
Test apexes no longer check to see whether their contents are available
so the special handling is no longer necessary.
Bug: 142935992
Bug: 153306490
Test: m nothing
Merged-In: Iecae7dcbb87908d19c672f74d3c1ed8810d4485b
Change-Id: Iecae7dcbb87908d19c672f74d3c1ed8810d4485b
The whitelistedApexAvailable used to map references to
com.android.art.debug/release to com.android.art before looking it up
in the white list. This change removed that mapping and simply added
both to the white list.
Bug: 142935992
Bug: 153306490
Test: m nothing
Merged-In: Ibad76fb73988688eb303e056197986ee9a6119ae
Change-Id: Ibad76fb73988688eb303e056197986ee9a6119ae
Coverage build adds extra dependencies for the runtime libs. Marking
them and their transitive dependenciese with apex_available doesn't make
any value; it instead adds noise.
Exempt-From-Owner-Approval: cherry-pick from AOSP
Bug: 150999716
Test: m
Merged-In: I08e51cec1de6ded624ef9d4c41c1e5b2e611ff38
(cherry picked from commit 58d1090032)
Change-Id: I08e51cec1de6ded624ef9d4c41c1e5b2e611ff38
The marked library(ies) were available to the adbd APEX via the
hand-written whitelist in build/soong/apex/apex.go. Trying to remove the
whitelist by adding apex_available property to the Android.bp of the
libraries.
Exempt-From-Owner-Approval: cherry-pick from AOSP
Bug: 150999716
Test: m
Merged-In: I6afbe905dda11056559521b937803dcd85b32fe5
(cherry picked from commit 3a0db5ef4e)
Change-Id: I6afbe905dda11056559521b937803dcd85b32fe5
The NDK prebuilts are implicitly used when building with sdk_version set.
Make the module types be available to any apex so that we don't need to
manually add apex_available property to the module definitions manually.
Exempt-From-Owner-Approval: cherry-pick from AOSP
Bug: 150999716
Test: m
Merged-In: I0870afa4c74b4a06ab1273dff84615778561ecc9
(cherry picked from commit e01e228270)
Change-Id: I0870afa4c74b4a06ab1273dff84615778561ecc9
The marked library(ies) were available to the APEXes via the hand-written
whitelist in build/soong/apex/apex.go. Trying to remove the whitelist
by adding apex_available property to the Android.bp of the libraries.
Exempt-From-Owner-Approval: cherry-pick from AOSP
Bug: 150999716
Test: m
Merged-In: I91d1b1076733a949ca2a959ba640ce34d0233492
(cherry picked from commit 541142ce6b)
Change-Id: I91d1b1076733a949ca2a959ba640ce34d0233492
apex_deps/apex/apex_flattened mutators don't have to run if module is
disabled.
For some branches which have no valid targets, apex modules are disabled
by the os mutator. e.g. aosp-build-tools
Some enforcement checks which run during those mutators may fail because
build-environment doesn't provide full context information.
For example, "Platform_version_all_codenames" config variable is not
set while apex.min_sdk_version uses one of those codenames.
Bug: 152655956
Test: m
Change-Id: I47e27d2d025ba4c36534708b113ce77c4cb2397b
Apex can use codenames like "Q", "R" for its min_sdk_version property.
Also, cc_library can use codenames for its stubs.versions.
Bug: 152655956
Test: m
Merged-In: I077ad7b2ac5d90b4c8708921e43846206f05ba70
Change-Id: I077ad7b2ac5d90b4c8708921e43846206f05ba70
(cherry picked from commit 29e91d2121)
It is no longer needed because non-static java_library dependencies are
not considered to be part of the depending APEX.
Bug: 153443117
Test: m nothing
Change-Id: I7d58d1047b2d400395a253e492b35008284778ff
When a source and a prebuilt module are present in the same build a
dependency is added from the source module to the prebuilt module.
Previously, the code for generating the APEX did not recognize that
tag and in some cases (e.g. for cc_(prebuilt_)library_shared) will
fail the build.
This change:
1) Adds a test to reproduce the problem.
2) Improves the debug message by pretty printing the tag.
3) Adds a new ExcludeFromApexContents interface that can be implemented
by a tag to declare that it should be excluded from the APEX
contents.
4) Ignores tags that implement that interface when generating APEX
contents.
5) Implements that interface on prebuiltDependencyTag to fix the
test.
Bug: 153326844
Test: m nothing
Change-Id: I9dd4312c4f995c816c0a31d8d733eb5d7f56e1ea
Previously, adding java_library to an sdk required that the names of
any APEXes that transitively compiled against it were added to its
apex_available property. This change removes that requirement.
Also corrects the dependency path in the TestApexAvailable_IndirectDep
error which previously passed through "shared from static" static
dependency tags even though those are explicitly NOT followed when
checking apex_available settings.
Bug: 152878661
Test: m droid
Change-Id: I995ed38956c1bc210b09494812de012fed9f9232
Having dependency tags in the dependency path that shows why a specific
module is considered part of an apex makes it easier to understand why
that is the case and detect possible issues.
Bug: 152762638
Test: m nothing
Change-Id: Iba2a8a5a6abe03dadee456e760aa4373cd00c07b
The DepIsInSameApex() and RequiredSdks() methods were defined in a few
places to avoid having to depend on the whole ApexModule/SdkAware
interfaces directly. However, that has a couple of issues:
1) It duplicates functionality making it difficult to change, changes
to the definitions outside the main interfaces do not cause compile
time failures, instead they result in a runtime change in behavior
which can be difficult to debug.
2) IDE navigation (specifically in Intellij) does not detect that the
duplicate definitions can resolve to the definitions in the main
interface.
This change extracts the methods into their own interfaces and reuses
those interfaces instead of duplicating the methods to fix both of
these issues.
Bug: 152878661
Test: m nothing
Change-Id: I0cfdf342a14eb0bfb82b1bd17e0633d81c7facfb
Apex can use codenames like "Q", "R" for its min_sdk_version property.
Also, cc_library can use codenames for its stubs.versions.
Bug: 152655956
Test: vendor/google/build/build_mainline_modules.sh
Change-Id: I077ad7b2ac5d90b4c8708921e43846206f05ba70
Delegate the responsibility for determining whether the
walkPayloadDeps() should visit a child dependency to its do function.
This is needed to allow the visitor in checkApexAvailability() to avoid
checking the apex_available setting after crossing the APEX boundary.
Bug: 152878661
Test: m droid
Change-Id: If46a2f74b6eca670befc3aeae430650e85542346
The apex available check can traverse quite a long path (5+ steps) to
get from the apex to a module that is missing the apex from its
apex_available property. Understanding where that dependency came from
can often require examining the dependency path which can be difficult.
This change adds the path to the error to simplify that process.
Test: m nothing
Bug: 152762638
Change-Id: Ic4eb169dc2026cd8339d49e23b25d6d1c3879750
Coverage build adds extra dependencies for the runtime libs. Marking
them and their transitive dependenciese with apex_available doesn't make
any value; it instead adds noise.
Bug: 150999716
Test: m
Change-Id: I08e51cec1de6ded624ef9d4c41c1e5b2e611ff38
The marked library(ies) were available to the adbd APEX via the
hand-written whitelist in build/soong/apex/apex.go. Trying to remove the
whitelist by adding apex_available property to the Android.bp of the
libraries.
Bug: 150999716
Test: m
Change-Id: I6afbe905dda11056559521b937803dcd85b32fe5
The marked library(ies) were available to the APEXes via the hand-written
whitelist in build/soong/apex/apex.go. Trying to remove the whitelist
by adding apex_available property to the Android.bp of the libraries.
Bug: 150999716
Test: m
Change-Id: I91d1b1076733a949ca2a959ba640ce34d0233492
The NDK prebuilts are implicitly used when building with sdk_version set.
Make the module types be available to any apex so that we don't need to
manually add apex_available property to the module definitions manually.
Bug: 150999716
Test: m
Change-Id: I0870afa4c74b4a06ab1273dff84615778561ecc9
Revert submission 1254009-vdex-symlinks
Reason for revert: This causing some devices to fail to boot. See b/151836042 for details.
Reverted Changes:
Iced89071b:Expect vdex files in a target-independent director...
Ifbceb8457:Share vdex files in the ART apex between architect...
Change-Id: I5bd88f8e61d442eed921d840c90777a2750ddb16
Test: aosp_walleye-userdebug boots.
Test: Check symlinks to *.vdex files in the ART apex:
$ adb shell 'find /apex/com.android.art -name '*.vdex' | xargs ls -l'
lrw-r--r-- 1 system system 23 1970-01-01 01:00 /apex/com.android.art/javalib/arm/boot-apache-xml.vdex -> ../boot-apache-xml.vdex
lrw-r--r-- 1 system system 25 1970-01-01 01:00 /apex/com.android.art/javalib/arm/boot-bouncycastle.vdex -> ../boot-bouncycastle.vdex
lrw-r--r-- 1 system system 23 1970-01-01 01:00 /apex/com.android.art/javalib/arm/boot-core-icu4j.vdex -> ../boot-core-icu4j.vdex
lrw-r--r-- 1 system system 24 1970-01-01 01:00 /apex/com.android.art/javalib/arm/boot-core-libart.vdex -> ../boot-core-libart.vdex
lrw-r--r-- 1 system system 19 1970-01-01 01:00 /apex/com.android.art/javalib/arm/boot-okhttp.vdex -> ../boot-okhttp.vdex
lrw-r--r-- 1 system system 12 1970-01-01 01:00 /apex/com.android.art/javalib/arm/boot.vdex -> ../boot.vdex
lrw-r--r-- 1 system system 23 1970-01-01 01:00 /apex/com.android.art/javalib/arm64/boot-apache-xml.vdex -> ../boot-apache-xml.vdex
lrw-r--r-- 1 system system 25 1970-01-01 01:00 /apex/com.android.art/javalib/arm64/boot-bouncycastle.vdex -> ../boot-bouncycastle.vdex
lrw-r--r-- 1 system system 23 1970-01-01 01:00 /apex/com.android.art/javalib/arm64/boot-core-icu4j.vdex -> ../boot-core-icu4j.vdex
lrw-r--r-- 1 system system 24 1970-01-01 01:00 /apex/com.android.art/javalib/arm64/boot-core-libart.vdex -> ../boot-core-libart.vdex
lrw-r--r-- 1 system system 19 1970-01-01 01:00 /apex/com.android.art/javalib/arm64/boot-okhttp.vdex -> ../boot-okhttp.vdex
lrw-r--r-- 1 system system 12 1970-01-01 01:00 /apex/com.android.art/javalib/arm64/boot.vdex -> ../boot.vdex
-rw-r--r-- 1 system system 1229 1970-01-01 01:00 /apex/com.android.art/javalib/boot-apache-xml.vdex
-rw-r--r-- 1 system system 2043 1970-01-01 01:00 /apex/com.android.art/javalib/boot-bouncycastle.vdex
-rw-r--r-- 1 system system 2883 1970-01-01 01:00 /apex/com.android.art/javalib/boot-core-icu4j.vdex
-rw-r--r-- 1 system system 865 1970-01-01 01:00 /apex/com.android.art/javalib/boot-core-libart.vdex
-rw-r--r-- 1 system system 395 1970-01-01 01:00 /apex/com.android.art/javalib/boot-okhttp.vdex
-rw-r--r-- 1 system system 7125 1970-01-01 01:00 /apex/com.android.art/javalib/boot.vdex
Bug: 150934453
Change-Id: Ifbceb845749f4c218693f4118e8b35b59ff26de1
libselinux no longer is included in any APEX. Only the platform variant
of it (/system/lib/libselinux.so) exists and APEXes link to it.
Removing the lib name from the whitelist to make it clear that the
library is not available to any APEX.
Bug: 151053366
Bug: 150999716
Test: m
Exempt-From-Owner-Approval: cherry-pick from aosp
Merged-In: Id4fb933141ad32ff5217a58f1c7d689cc657e9ea
(cherry picked from commit 1731f6ae3f)
Change-Id: Id4fb933141ad32ff5217a58f1c7d689cc657e9ea
min_sdk_version = 29 implies that the module should support Android10.
Bug: 150431944
Test: m
Merged-In: Iad90a239898f59456900ae7816b90379b1b43406
Change-Id: Iad90a239898f59456900ae7816b90379b1b43406
(cherry picked from commit 5417f775e5)
Exempt-From-Owner-Approval: cp from aosp
Native modules within APEX should be linked with proper stub version
according to its min_sdk_version.
For example, when min_sdk_version is set to "29", libfoo in the apex
would be linked to libbar of version 29 from platform, even if it has
a newer version like 30.
Bug: 145796956
Test: m nothing (soong tests)
Merged-In: I4a0b2002587bc24b7deeb5d59b6eeba5e1db5b1f
Change-Id: I4a0b2002587bc24b7deeb5d59b6eeba5e1db5b1f
(cherry picked from commit 03b5185b88)
Exempt-From-Owner-Approval: got ORV already.
libselinux no longer is included in any APEX. Only the platform variant
of it (/system/lib/libselinux.so) exists and APEXes link to it.
Removing the lib name from the whitelist to make it clear that the
library is not available to any APEX.
Bug: 151053366
Bug: 150999716
Test: m
Change-Id: Id4fb933141ad32ff5217a58f1c7d689cc657e9ea
Makes sure that the module snapshots do not rely on the white list
of apex available settings so that when those lists are removed it is
not necessary to update any snapshots.
Bug: 142935992
Test: m nothing
Change-Id: Iedcff7dfc2646a4da77258d16e06657dd2f411f9
Test apexes no longer check to see whether their contents are available
so the special handling is no longer necessary.
Bug: 142935992
Test: m nothing
Change-Id: Iecae7dcbb87908d19c672f74d3c1ed8810d4485b
The whitelistedApexAvailable used to map references to
com.android.art.debug/release to com.android.art before looking it up
in the white list. This change removed that mapping and simply added
both to the white list.
Bug: 142935992
Test: m nothing
Change-Id: Ibad76fb73988688eb303e056197986ee9a6119ae
Merged-In: Ibad76fb73988688eb303e056197986ee9a6119ae
NativeBridgeRelativePath should be appended after /bin or /lib and
before subdir.
Bug: N/A
Test: m (add a soong test)
Change-Id: Id0c44c66b4900caa291e816cf3361fdec8ff9421
Checking apex_available was missing some corner cases.
For example, the deps of share deps of cc_library modules are missed
while those from cc_library_shared are correctly tracked.
This was due to..
* calling DepIsInSameApex in WalkDeps: both work fine separately, but
when they are used together, it fails to work. It's due to how WalkDeps
works. (We might fix this bug too risky since it is used very widely)
* incorrect receiver for DepIsInSameApex in apex_deps mutator: receiver
is supposed to be parent, but child was used before. Interestingly lots
of deps are within the same group of module types(cc to cc, java to
java), it has worked. (note that receiver's DepIsInSameApex
implementation can be different).
This change fixes them by..
* walkPayloadDeps is now relying on ApexVariation, which is calculated
correctly by TopDown apex_deps mutator.
* use correct receiver for DepIsInSameApex in apex_deps mutator, which
requires for java.SdkLibrary to override the method and for
java.Library/Import to use passed dep instead of receiver to check its
membership of sdk.
Exempt-From-Owner-Approval: cherry-pick from aosp/master
Bug: 151071238
Test: build/boot
Merged-In: I0569ef4bb8e79635e4d97a89f421a8d8b7d26456
(cherry picked from commit 5e9013be22)
Change-Id: I0569ef4bb8e79635e4d97a89f421a8d8b7d26456
Checking apex_available was missing some corner cases.
For example, the deps of share deps of cc_library modules are missed
while those from cc_library_shared are correctly tracked.
This was due to..
* calling DepIsInSameApex in WalkDeps: both work fine separately, but
when they are used together, it fails to work. It's due to how WalkDeps
works. (We might fix this bug too risky since it is used very widely)
* incorrect receiver for DepIsInSameApex in apex_deps mutator: receiver
is supposed to be parent, but child was used before. Interestingly lots
of deps are within the same group of module types(cc to cc, java to
java), it has worked. (note that receiver's DepIsInSameApex
implementation can be different).
This change fixes them by..
* walkPayloadDeps is now relying on ApexVariation, which is calculated
correctly by TopDown apex_deps mutator.
* use correct receiver for DepIsInSameApex in apex_deps mutator, which
requires for java.SdkLibrary to override the method and for
java.Library/Import to use passed dep instead of receiver to check its
membership of sdk.
Bug: 151071238
Test: build/boot
Change-Id: I0569ef4bb8e79635e4d97a89f421a8d8b7d26456
When the check for apex_available has failed, the build system now shows
the module that brought the unavailable module into the APEX.
Bug: 151051671
Test: m
Merged-In: Id1a3fda67fe56fdc2dc90ec800d10689415de4d6
(cherry picked from commit 7bd9444b0f)
Change-Id: Id1a3fda67fe56fdc2dc90ec800d10689415de4d6
When the check for apex_available has failed, the build system now shows
the module that brought the unavailable module into the APEX.
Bug: 151051671
Test: m
Change-Id: Id1a3fda67fe56fdc2dc90ec800d10689415de4d6
Native modules within APEX should be linked with proper stub version
according to its min_sdk_version.
For example, when min_sdk_version is set to "29", libfoo in the apex
would be linked to libbar of version 29 from platform, even if it has
a newer version like 30.
Bug: 145796956
Test: m nothing (soong tests)
Change-Id: I4a0b2002587bc24b7deeb5d59b6eeba5e1db5b1f
Add a min_sdk_version property apexes. Currently a noop, but will
be used to enforce that dependencies are compatible with the
specified version.
Test: m checkbuild
Bug: 149591522
Merged-In: I923773c90fe15becbffae3986791aa9edde8f8f6
Change-Id: I923773c90fe15becbffae3986791aa9edde8f8f6
(cherry picked from commit 50317874ff)
If an APEX contains APKs and the manifest package name of the APKs are
overridden (either via override_android_app
orPRODUCT_MANIFEST_PACKAGE_NAME_OVERRIDES), that the path to the APK
(relative in the APEX) and the overridden manifest package name is
recorded in the bundle config file.
Exempt-From-Owner-Approval: cherry-pick from master
Bug: 148002117
Test: m
Merged-In: Ibb90bcefb77fa6b2dad77cb2facc6079de9ab154
(cherry picked from commit cfaa1643e8)
Change-Id: Ibb90bcefb77fa6b2dad77cb2facc6079de9ab154
If an APEX contains APKs and the manifest package name of the APKs are
overridden (either via override_android_app
orPRODUCT_MANIFEST_PACKAGE_NAME_OVERRIDES), that the path to the APK
(relative in the APEX) and the overridden manifest package name is
recorded in the bundle config file.
Bug: 148002117
Test: m
Change-Id: Ibb90bcefb77fa6b2dad77cb2facc6079de9ab154
Which is the list of JNI libraries that are embeded inside the apex.
jni_libs is handled just like native_shared_libs except that it is
stored in apex_manifest.
When linkerconfig finds an apex with JNI libs, it exposes the namespace
for the apex as visible so that libnativeloader can link the namespace
to the corresponding classloader-namespace.
Bug: 149363889
Test: m nothing(runs soong test)
Change-Id: I52ebe38b44545e6e8853e34a3404a235c858112a
Embed common properties (apexNativeDependencies) so that the logic for
adding dependencies for native modules can be reused.
Bug: N/A
Test: m
Change-Id: I789b526c09eea14213ab1544590ed2238ed8c625
Symlinking doesn't make sense for host APEXes.
Bug: 150255435
Test: m com.android.art.host and inspect the built APEX; there is
no symlink.
Merged-In: I28492dfaaef471117a430be05255fbef76e557b0
(cherry picked from commit 9b96418dfe)
Change-Id: I28492dfaaef471117a430be05255fbef76e557b0
Symlinking doesn't make sense for host APEXes.
Bug: 150255435
Test: m com.android.art.host and inspect the built APEX; there is
no symlink.
Change-Id: I28492dfaaef471117a430be05255fbef76e557b0
Because APK-in-APEX embeds its jni_libs in it. We don't have to follow
deps of jni_libs.
Bug: 146992436
Test: m com.android.tethering
deapexer extract com.android.tethering.apex apex
ls apex # there should be no /lib dir
Merged-In: Ifa1a6430a420ae7376b155cd59b8ece462cced7e
Change-Id: Ifa1a6430a420ae7376b155cd59b8ece462cced7e
(cherry picked from commit b7bebe2616)
Because APK-in-APEX embeds its jni_libs in it. We don't have to follow
deps of jni_libs.
Bug: 146992436
Test: m com.android.tethering
deapexer extract com.android.tethering.apex apex
ls apex # there should be no /lib dir
Change-Id: Ifa1a6430a420ae7376b155cd59b8ece462cced7e
Add a min_sdk_version property apexes. Currently a noop, but will
be used to enforce that dependencies are compatible with the
specified version.
Test: m checkbuild
Bug: 149591522
Change-Id: I923773c90fe15becbffae3986791aa9edde8f8f6
The optimization is confusing syshealth because the modules will use
more memory when they are switched to the prebuilt (unbundled) or
updated via Play.
Let's have a per-module switch to control the behavior and turn it on
only for non-updatable modules like ART.
Bug: 149805758
Test: m
Change-Id: Ieb842c47f31f3b06e403b1e1f9e463c3e5524107
This change fixes a regression that was introduced with
I597bccbb177b6b6320c3a3edeff467243230d384. With the change, the content
of the permissions XML file for a java_sdk_library was determined before
the java_sdk_library is mutated for an APEX. As a result, the file path
to the implementation jar library was always set to
/system/framework/*.jar regardless of whether the java_sdk_library is
part of an APEX or not.
This change fixes the problem, by creating the permissions XML file via
a new module type. The content of the xml file is determined after the
xml file is mutated for APEXes.
Bug: 149600642
Test: m
Change-Id: Id21f8d8285df49b0b3be1daf0f101f2bc978eeb0
Bug: 149075752
Test: tapas com.android.conscrypt com.android.tethering arm64
Test: m out/target/product/generic_arm64/{,symbols/}apex/com.android.{tethering,conscrypt}/lib64/libc++.so
Test: Verified that unwinder was dynamically linked to tethering's
Test: libc++ and statically linked to conscrypt's.
Test: lunch flame-userdebug && m
Test: Verified that unwinder was dynamically linked to /system/lib64/libc++.so
Change-Id: I98eed7cb4316962b19b5c12e150c224c25d0e91d
apex { name: ["myapex"], native_shared_libs: ["libX", "libY"] }
cc_library { name: "libX", shared_libs: ["libY"] }
cc_library { name: "libY", shared_libs: ["libZ"], stubs: {...} }
apexDepsMutator was a bottom up mutator and it uses WalkDeps to traverse
the dependency tree rooted at myapex in a depth-first order. While
traversing the tree, if calls BuildForApex for a module that will be
part of the APEX.
libY is visited twice. Once via libX and once via myapex. If the visit
from libX was before the visit from myapex (since this is a depth-first
traversing), BuildForApex is not called for libY and its dependency
libZ, because libY provides a stub. And then when libY is again visited
via myapex, BuildForApex is correctly called for the module, but not for
its dependencies libZ because the paths from libY to libZ was already
visited.
As a result, the apex variant of libY has a dependency to the non-apex
variant of libZ.
Fixing the problem by changing the mutator a top-down one.
Bug: 148645937
Test: m
Change-Id: Ib2cb28852087c63a568b3fd036504e9261cf0782
The apex dependency map wasn't updated for test or non-installable
APEXes to work around the problem that a module being in such APEX
prevented the module from being installed in the system partition.
Since that problem is not happening any more, removing the unnecessary
work-around.
Bug: 123892969
Test: m
Change-Id: I43e07a9611a3e08ff39b9a64454b1c67949d35bc