Sometimes, the ordinary cc_library_* modules need test_for property when
they are part of a bigger cc_test. Instead of propagating the test_for
property from cc_test to its dependencies, this change requires the very
dependency which needs access to the private part of an APEX to
explicitly have the test_for property.
Bug: 161575591
Test: m
Change-Id: Ie1ffe9a60cd2ab02d41bbe5a98225a40392470f6
This CL fixes a bug that rust_ffi_shared libraries can't be included in
an APEX either directly (via native_shared_libs property) or indirectly.
Bug: 175105284
Test: m
Change-Id: I2e2d3e11b3901f3412b9725e47a8ebf31f93847b
1. Soong can now detect PRODUCT_COMPRESSED_APEX flag
We don't want APEX to be compressed on all devices. Only those that
have explicitely set PRODUCT_COMPRESSED_APEX flag.
2. Handle "compressible" field in soong build rule
On devices that supports APEX compression, all APEX will be
compressed by default. If any apex does not want to be compressed,
they will need to state that by setting "compressible" field to
false
3. Can use apex_compression_tool to compress APEX
Note we compress the APEX after it has been signed. That way, when
we decompress we will get a signed APEX.
4. Place the compressed APEX in system with .capex extension
This makes it easy to identify. We still preserve the original
extension so that when we decompress, we can just rename by cuttif
off the .capex extension.
Note: with this change, we can create a system image with compressed
APEX, but we cannot boot with it since platform doesn't know how to
handle .capex files. Platform support will be added on follow up CLs.
Bug: 172911362
Test: OVERRIDE_PRODUCT_COMPRESSED_APEX=true m (apex_test.go)
Test: observed $OUT/system/apex has .capex files
Change-Id: I20ac4c4ceb521924c751a6017f979b2d808fdded
The property is used to exclude some shared and static libs when the
module is built for an APEX.
Bug: 166468760
Test: m
Change-Id: I0dcaa4ae94c01aa00dc5539c60d3054c57fd8824
The distinction between foo and prebuilt_foo doesn't exist in make, so
this could create invalid dependencies when both source and prebuilt
modules exist and the prebuilts are preferred.
Test: `m` with ART module prebuilts with prefer:true in the tree
Test: m nothing
Bug: 172480615
Change-Id: I90b76a8f38493882b3330d1b6789159852e59d55
Add gen_ndk_usedby_apex.sh script to generate NDK API list used by Mainlain modules when modules get build.
Test: TARGET_BUILD_APPS=com.android.adbd m dist apps_only
Forrest run: android-build.googleplex.com/builds/forrest/run/L97800000742565481
Change-Id: I39e5aa7c74eff46aba06808642b2bd67ae45ba1e
Enable the RuleBuilder and RuleBuilderCommand methods to access
the BuilderContext by passing it to NewRuleBuilder instead of
RuleBuilder.Build.
Test: genrule_test.go
Test: rule_builder_test.go
Test: m checkbuild
Change-Id: I63e6597e19167393876dc2259d6f521363b7dabc
__ANDROID_SDK_VERSION__ is ambiguous. Rename it
__ANDROID_APEX_MIN_SDK_VERSION__ so it's clear which SDK version it
refers to.
Note that this is still different from the minSdkVersion of the module
being compiled. This is the max of *all* the minSdkVersions of modules
that this module shares an APEX with.
Test: treehugger
Bug: None
Change-Id: Id9cbd80a6bc99db8227daef4e1db9c893e63ad1e
We will have some APEXes having rust binaries and libraries. So, adding
the support for the types of modules.
rust.Module now inherits from android.ApexModuleBase and implements
the android.ApexModule interface.
Bug: 172414324
Test: m
Exempt-From-Owner-Approval: rebased after +2 from the owner
Change-Id: I356ef4c45f782a6460f001e83af96d1710642d80
A previous change handles dist properties automatically for all module
types and as a result has made the apexBundle setting of DistFiles
redundant so this change removes that.
Test: m nothing
m dist sdk - before and after this change, compare result to
make sure that there are no significant differences.
Test the effect on the apex by following instructions in
http://b/172951145
Bug: 174226317
Change-Id: If6f741b5b73b3335f4c478a6528f5f311cd633e4
Change https://r.android.com/1335521 added tag property to the Dist
struct so that it could be used to select one of a number of different
output files to copy to the dist instead of the single file that the
module type made available for dist. The output files were selected
by passing the tag to OutputFiles(tag).
Module types that wanted to support this new approach had to explicitly
set AndroidMkEntries.DistFiles = GenerateTaggedDistFiles(module).
Unfortunately, doing that had a side effect of changing the behavior of
dist entries without a tag.
That was because the change treated a tag that was not specified, as
being the same as "". So, prior to the change no tag meant use the
default dist file but after it meant use the paths returned by
OutputFiles(""). That changed the behavior of the java.Library type
which affected the behavior of the android_app module type.
Prior to the change the java_library would make the
Library.outputFile available for dist when no tag was specified. After
that change it would make Library.outputFile plus
Library.extraOutputFiles. The latter is usually empty except for
android_app which adds some extra files into there which will now be
copied to the dist. That change may have been intentional but there
was no mention of it in the change or the bug. Even if it wasn't
intentional it may still be beneficial.
Any module type that wants to add support for tags in dist runs the
risk of introducing similar changes in behavior. This change
differentiates between the tag not being set and the tag being set to
"" to avoid that possibility and to make the default behavior
explicit for those module types that have switched.
It does so as follows:
* Adds a DefaultDistTag constant that is used when the tag is not set.
It is a string that is unlikely to be used as an actual tag as it
does not start with a . and uses some special characters.
* The DefaultDistTag is used in MakeDefaultDistFiles(paths) to indicate
that the supplied paths are the default ones and and also in
GenerateTaggedDistFiles() for Dist structures that have no tag
property set.
* The DefaultDistTag is passed to OutputFiles(tag) just in case the
module type has explicitly defined the paths to associate with that
tag in there. If it has then it overrides the legacy behavior. If it
has not then it is just ignored and falls back to using the previous
behavior.
* The java.Library.OutputFiles(tag) method explicitly handles the
DefaultDistTag and returns Library.outputFile for it which restores
the behavior from before the change that added dist.tag support.
* Similar change was made to apexBundle.OutputFiles(tag) in order to
preserve its previous behaviour.
* The customModule used by TestGetDistContributions has been modified
to also preserve its previous behavior after this change.
Test: m nothing
m dist sdk - before and after this change, compare result to
make sure that there are no significant differences.
Test the effect on the apex by following instructions in
http://b/172951145
Bug: 174226317
Change-Id: Ib8f0d9307751cc2ed34e3d9a5538d3c144666f6d
Mostly documentation changes, but includes a few refactorings like
changing the variable names, reordering functions, reordering statements
in logical order, etc.
Bug: 173472337
Test: m
Change-Id: Iefdc8e463bcda60187b98e8c90661e220e8cdf40
Mostly documentation changes, but includes a few refactorings like
changing the variable names, reording functions, reordering statements
in logical order, etc.
Bug: 173472337
Test: m
Change-Id: Ie1799c0972d63da823ad375f008018de782529d1
Mostly documentation changes, but includes a few refactorings like
changing the variable names, reording functions, reordering statements
in logical order, etc.
Bug: 173472337
Test: m
Change-Id: I000c76e818722ed06bac03d9de87588b23552b08
The source code is reorganized following the order of the execution for
better readability. The order is as follows:
1) init
2) properties
3) module struct
4) deps mutator
5) post-deps mutator
6) generate build actions
7) module initialization for different sub types
8) misc (e.g. apex_available check, etc.)
Behavior is not touched.
Bug: 173472337
Test: m
Merged-In: I919fca468fa376273d498029e6ac2fa37998a4a6
Change-Id: I919fca468fa376273d498029e6ac2fa37998a4a6
which was added to support built-time common apex. But the common apex
was abandoned and it is used nowhere.
This is a manual revert of 5c998b9ff8.
Bug: 173329465
Test: m
Change-Id: I684e6b8bfe2ef5b53943329f4aaa5a5ccba27738
The android.WriteFile rule takes careful escaping to produce the
right contents. Wrap it in an android.WriteFileRule that handles
the escaping.
Test: compare all android.WriteFile outputs
Change-Id: If71a5843af47a37ca61714e1a1ebb32d08536c31
Prepare for using Config when adding singletons by passing
Config to NewTestContext and NewContext instead of to ctx.Register.
This will enable a followup change to store SingletonMakeVarsProviders
registered on the Context in the Config, which is necessary to run
multiple tests in parallel without data races.
Test: all soong tests
Change-Id: Id229629a4e42ff4487d317241673837726c075fc
To make a module available to product variants, it must define
`product_available: true`. `vendor_available: true` will not create
product variants any more.
However, in this CL, we don't change the behavior of
`vendor_available` property. It still creates both variants. After we
update all Android.bp files that need to provide product variants
with `product_available: true`, we may upload the remaining patches.
Bug: 150902910
Test: lunch aosp_arm64-userdebug && m
Change-Id: I0fd5be7bbae2c45d5cab3c3c2ca49f53a9b6f975
We are adding things to them, and in order for core libraries like libui
to use them, the newer versions need to be in the VNDK.
Bug: 170435409
Test: build
Change-Id: I97f26b78758f2eed128fc46db03b5f6ba3f2245f
Merged-In: I97f26b78758f2eed128fc46db03b5f6ba3f2245f
(cherry picked from commit 25281087a9)
This is one in a series of cls to make sure that
build/soong/scripts/update-apex-allowed-deps.sh is a no-op on cleanly
checked out aosp/master.
This cl is an intersection of the following:
ag/I9f98361aa248b82cb58527a5cd59e6d17c3e8723,
ag/I19ba5900ddff84948cfa29e48e31cd609e61dbdb,
build/soon/apex/allowed_deps.txt in aosp/master
Test: presubmit
Merged-In: I9f98361aa248b82cb58527a5cd59e6d17c3e8723
Change-Id: I19d58582de85e1ae1ef1c2b997d568235ca17710
After previous refactorings the CreateConfiguredJarList function is now
only used in tests and are supplied with a PathContext that will cause
ReportPathErrorf() to panic. So, this change removes the ctx parameter,
calls panic directly on any error and renames the method to make it
clear that it is for testing only.
Bug: 171479578
Test: m nothing
Change-Id: Icfb4bdfe720afa855b64ecf0e74a0b030882d029
This change:
* Switches BootJars/UpdatableBootJars fields of config.productVariables
from []string to ConfiguredJarList.
* Updates BootJars() method to simply concatenate the jars list from
the BootJars/UpdatableBootJars fields.
* Adds an UnmarshalJSON(..) method to ConfiguredJarList to support
unmarshalling from a single string array to avoid having to change the
format of the JSON file from which the configuration is loaded.
* Adds some additional calls to ConfiguredJarList(..) in tests to
convert from []string to ConfiguredJarList. They pass nil as the
ctx argument as there is no suitable PathContext which will cause any
errors to be thrown using panic. That is reasonable for hard coded
values in tests. A follow up change will clean up the calls to
ConfiguredJarList(..).
Bug: 171479578
Test: m nothing
Change-Id: I59b94dafb479ccd8f0471ed802be175af57be271
It needs to be in the list since it is needed by codec2_vndk.
It will eventually replace libion(also in the list).
Test: m
Bug: 168333162
Change-Id: If11d7e845bd4704f34f84435b5cac32b614312a8
This error tracks `apex_available` closure, but the message doesn't
indicate this variable specifically. Calling it out to try to make
the problem more searchable/discoverable/intuitable.
Bug: N/A
Test: apex_test.go
Change-Id: Ib254ace1dbd4e77d073ed4f98ee181dd86adfcfc
Prepare for making the relationship between an llndk_library stubs
module and the cc_library implementation module explicit by
adding an llndk_stubs property. Each cc_library will be updated
to point to its llndk_library, and the llndk_library name will
be changed to make the .llndk suffix explicit. Then the implicit
connection and suffix can be removed.
Bug: 170784825
Test: m checkbuild
Change-Id: I6b0482a3f286ec29b2e928551aa4317749f2b499
This way it will be correctly set in the auto-generated
AndroidManifest.xml.
Bug: 171096530
Bug: 157078772
Test: m
Change-Id: I268f08ca5dd17fa9d6763ad70cc9a3f83891a8d6
Merged-In: I268f08ca5dd17fa9d6763ad70cc9a3f83891a8d6
(cherry picked from commit 97fd49235a)
In apex_set and cc_prebuilt_library_*, provide a way to specify an
alternative source to use when build with sanitizers.
Test: prebuilt_test, apex_test
Change-Id: I1ab8091bf696d94da3547cf5248853df489bdee6
Export information about static libraries, shared libraries and
exported flags through Providers instead of accessing the module
directly. Much more is left to be converted, but this significantly
simplifies the dependencies on libraries with stubs by making it easy
for a module to masquerade as another by simply exporting the
providers from the other module. Instead of depending on all the
versions of a library and then picking which one to use later, it
can depend only on the implementation variant and then select the
right SharedLibraryInfo from the variant.
Test: m checkbuild
Test: only expected changes to build.ninja
Change-Id: I1fd9eb4d251cf96ed8398d586efc3e0817663c76
This reverts commit 323dc60712.
Reason for revert: Possible cause of test instability
Bug: 170513220
Test: soong tests
Change-Id: Iee168e9fbb4210569e6cffcc23e60d111403abb8
Putting t.Parallel() in each test makes them run in parallel.
Additional t.Parallel() could be added to each subtest, although
that requires making a local copy of the loop variable for
table driven tests.
Test: m checkbuild
Change-Id: I5d9869ead441093f4d7c5757f2447385333a95a4
A global variant was used to store the global mapping between
modules and APEXes. Replace it with storing pointers to APEX
contents inside each module so that they can query the contents
of any APEXes they belong to.
Bug: 146393795
Test: all Soong tests
Test: single line change to build.ninja host install dependency ordering
Test: no Android-${TARGET_PRODUCT}.mk, make_vars-${TARGET_PRODUCT}.mk or late-${TARGET_PRODUCT}.mk
Change-Id: Id2d7b73ea27f8c3b41d30820bdd86b65c539bfa4
Instead of tracking per module and per module variant, track allowed
list of dependecies for all modules combined. This avoids issues with
different products and different downstream branches having different
build graphs.
To compare allowed_deps.txt vs head, run:
:; m -j out/soong/apex/depsinfo/new-allowed-deps.txt.check
To update source allowed_deps.txt, run:
:; build/soong/scripts/update-apex-allowed-deps.sh
Bug: 149622332
Test: m
Change-Id: Ic518fbd9ebfe1b46aaf9a58df731780a7e5a676b
Merged-In: Ic518fbd9ebfe1b46aaf9a58df731780a7e5a676b
(cherry picked from commit 453555083b)
(cherry picked from commit e5207cd9a6)
When building an APEX, the build system included artifacts from all
targets that are returned from ctx.MultiTargets(). This however has
became a problem as we add new host targets like linux_bionic_arm64.
When there are multiple host targets having different OSes,
ctx.MultiTargets() returns one target per a host OS. For example, when
linux_bionic_arm64 is enabled, ctx.MultiTargets() returns the following
two targets because linux_bionic != linux_glibc.
* linux_glibc_86_64
* linux_bionic_arm64
Some dependencies (like soong_zip, etc.) are not enabled for the new
host target (because they don't have to) and therefore the build fails.
Since the purpose of host APEX is to package some host tools for
testing, etc., we actually don't need the second target for APEX.
Fixing the problem by not skipping "cross host" targets which can't be
natively executed on the host machine.
Bug: 169454252
Test: HOST_CROSS_OS=linux_bionic HOST_CROSS_ARCH=arm64 m
Test: DIST_DIR=$(pwd)/out/dist \
./art/tools/dist_linux_bionic.sh com.android.support.apexer
Change-Id: Idaded56e4b4fc0195c8bbc760e4b4728016bd5b4
I2954bb21c1cfdeb305f25cfb6c8711c930f6ed50 switched normalizeVersions
to work on ApiLevels, which inadvertantly caused it to return "current"
instead of "10000" for libraries that specify "current" in their stubs
property. ChooseSdkVersion couldn't handle "current" because it was
manually converting the version to an int. Switch ChooseSdkVersion
to use ApiLevels instead so that it can handle "current".
Test: m checkbuild
Change-Id: Id412359e092483ba419118dd03bc206fae702a96
A host target is considered as being cross-compiled when the target
can't run natively on the build machine. For example, linux_glibc/x86_64
is a non-cross target on a standard x86/Linux machine, but is a cross
host on Mac. Previously, whether cross or not was a static attribute of
an OsType. For example, Windows was always considered as cross host,
while linux_bionic was not. This becomes a problem when we support more
host targets like linux_bionic/arm64 which should be cross-host on
standard x86/Linux machines.
This change removes HostCross from the OsClass type and instead adds a
property HostCross to the Target type. When a target is being added, it
is initialized to true when the target can't run natively on the current
build machine.
Bug: 168086242
Test: m
Change-Id: Ic37c8db918873ddf324c86b12b5412952b0f2be2
Flattened APEXes are installed in /<partition>/apex/<name>, so its
file_contexts file should be amended accordingly.
For example, file_contexts of an apex "com.android.foo" with should be
modified by prepending actual install path to the path regex.
/bin/foo <sepolicy label>
=> /system/apex/com\.android\.foo/bin/foo <sepolicy label>
File_contexts file is emitted to "make" via LOCAL_FILE_CONTEXTS variable
for apex_manifest.pb module.
Make collects these files and use them to build file_contexts.bin.
Also removed global state which is used to keep the list of all
flattened apexes.
Bug: 166518492
Test: m file_contexts.bin
check intermediate file_contexts.modules.tmp file
in $OUT/obj/ETC/file_contexts.bin_intermediates/
Change-Id: I780370b6e576964a5c09f9477f3361f341dd576b
The test case I removed is invalid. The codename has had its int
assigned, but the config claims it is not final.
If this ever does need to be supported it's just a matter of making
sure the Q -> 29 mapping (or whatever) in the finalized codenames map
in android/api_levels.go.
Test: treehugger
Bug: http://b/154667674
Change-Id: I4f42ec2fd4a37750519ee3937938a1c65b6bb1e8
Keeping the int constant around for now as FutureApiLevelInt because
it's still useful in places that haven't adopted ApiLevel yet for
testing if their non-ApiLevel API level is current or not.
Test: treehugger
Bug: http://b/154667674
Change-Id: I47a7012703f41fdeb56f91edf9c83afa93042deb
Installation path of prebuilt_firmware varies accoding to target
partitions. When it is for system, it installs a file in
/system/etc/firmware while it installs in /vendor/firmware for vendor.
We'd better be consistent about installation path when it is
for APEXes regardless of target partition. Otherwise, ueventd would need
to scan both /apex/*/etc/firmware and /apex/*/firmware.
Having /etc prefix for prebuilt modules helps module owners to predict
the layout of the contents.
Bug: 162701747
Bug: 167942098
Test: soong tests
Test: loading vibrator firmware from vibrator apex (sunfish)
Change-Id: I7a7105026426f8a7a156bc947304930f761c81f3
AddFarVariationDependencies was broken, which allowed apex to add
dependencies on tests by requesting an empty test_per_src variation
even though some test dependencies did not have a test_per_src
variation. Add an alias from the pre-test_per_src variation
variant to the empty test_per_src variation, and drop the
test_per_src variation when requesting the depencency.
Test: TestApexWithTests
Change-Id: I2ed7bdd761027956141e25d4d81f9074afe628b6
For "non-updatable" devices, apex_manifest.pb is a module representing
the apex, so we need to pass common properties like init_rc and
vintf_fragments to the Make module of apex_manifest.pb so that those
files are copied when the apex is installed as flattened.
Bug: 159211312
Bug: 167383491
Test: lunch aosp_sunfish-userdebug
OVERRIDE_TARGET_FLATTEN_APEX=true m com.android.vibrator.sunfish
check $OUT/vendor/etc for init_rc/vintf_fragmemts
Change-Id: I5d5ce5acb9b837da2fb4e6ee8f3813707c6c3bd4
This change fixes a bug that notice files for some module type (e.g.
prebuilt_etc) were not included in APEX. This happened because we relied
on WalkPayloadDeps which actually doesn't traverse module types that
don't implement ApexModule interface. prebuilt_etc is one such module
type. Fixing the problem by also iterating the filesInfo array which
has info about all modules that are included in the APEX.
Bug: 166575301
Test: m com.android.tzdata and inspect the built artifact.
NOTICE.html.gz is there.
Change-Id: Iceb055b60184aef2a3e65e44680304853eb79a53
bpf program is put to an APEX via 'bpfs' property. It is
placed under etc/bpf directory in it.
Fix: 167530625
Test: m
Change-Id: Ia36b486f0cffb619ecc4f7a318cde881abc5baf4
prebuilt_firmware module is one of many prebuilt_etc-like modules. When
it is soc-specific, it is installed in /vendor/firmware. Similarly, when
prebuilt_firmware is embeded in a vendor apex, installing it in
<apex>/firmware instead of <apex>/etc.
Bug: 162701747
Test: lunch sunfish-userdebug
m && device boots && vibrator works
Change-Id: I00d28cde42259aaf8221e3897df77efc42b0c1ca
The affected modules weren't actually built in the affected build,
delay the platform availability check in Make instead to allow
the build to proceed.
Bug: 154888298
Test: m checkbuild
Change-Id: I21778e38e04635545b352dee2043a33ec9da246b
Add the new property payload_fs_type in apex module type. Either 'f2fs'
or 'ext4'. Default 'ext4'.
Test: m
Bug: 158453869
Change-Id: I36f373251bd597e11acb62af75437a87e2a531ec
Merged-In: I36f373251bd597e11acb62af75437a87e2a531ec
When we package both 32/62, there could be two instances of the same
library. We need to dedup the list of jni_libs.
Bug: n/a
Test: m com.android.cronet (which uses jni_libs)
check apex_manifest.pb
Change-Id: I9a9f42f0f5219ab7bc50d945b54113b5d823b7f3
AddFarVariationDependencies was broken, which allowed sdk modules to
request dependencies using image and version variations, even for
host modules that do not have image or version variations. Make
the image and version variations conditional on device sdk modules.
Test: go test ./sdk
Change-Id: I59b7a32a3782254fd5feb828a5258ee13d4db812
AddFarVariationDependencies was broken, which allowed dependencies
on non-libraries to be added even though a link variation was
requested. When AddFarVariationDependencies is fixed, attempting
to add a non-library to jni_libs results in the usual missing
variant error.
Test: none
Change-Id: I6aa281491b8af5f141a2d132e248c75f95d68ab5
APEX variants that share the same SDK version and updatability
almost always use identical command line arguments to build but
with different intermediates directories. This causes unnecessary
build time and disk space for duplicated work.
Deduplicate APEX variants that would build identically. Create
aliases from the per-APEX variations to the new shared variations
so that the APEX modules can continue to depend on them via the
APEX name as the variation.
This has one significant change in behavior. Before this change,
if an APEX had two libraries in its direct dependencies and one
of those libraries depended on the other, and the second library
had stubs, then the first library would depend on the implementation
of the second library and not the stubs. After this change, if
the first library is also present in a second APEX but the second
library is not, then the common variant shared between the two
APEXes would use the stubs, not the implementation.
In a correctly configured set of build rules this change will
be irrelevant, because if the compilation worked for the second
APEX using stubs then it will work for the common variant using
stubs. However, if an incorrect change to the build rules is
made this could lead to confusing errors, as a previously-working
common variant could suddenly stop building when a module is added
to a new APEX without its dependencies that require implementation
APIs to compile.
This change reduces the number of modules in an AOSP arm64-userdebug
build by 3% (52242 to 50586), reduces the number of variants of the
libcutils module from 74 to 53, and reduces the number of variants
of the massive libart[d] modules from 44 to 32.
This relands I0529837476a253c32b3dfb98dcccf107427c742c with a fix
to always mark permissions XML files of java_sdk_library modules as
unique per apex since they contain the APEX filename, and a fix
to UpdateUniqueApexVariationsForDeps to check ApexInfo.InApexes
instead of DepIsInSameApex to check if two modules are in the same
apex to account for a module that depends on another in a way that
doesn't normally include the dependency in the APEX (e.g. a libs
property), but the dependency is directly included in the APEX.
Bug: 164216768
Test: go test ./build/soong/apex/...
Change-Id: I2ae170601f764e5b88d0be2e0e6adc84e3a4d9cc
APEX variants that share the same SDK version and updatability
almost always use identical command line arguments to build but
with different intermediates directories. This causes unnecessary
build time and disk space for duplicated work.
Deduplicate APEX variants that would build identically. Create
aliases from the per-APEX variations to the new shared variations
so that the APEX modules can continue to depend on them via the
APEX name as the variation.
This has one significant change in behavior. Before this change,
if an APEX had two libraries in its direct dependencies and one
of those libraries depended on the other, and the second library
had stubs, then the first library would depend on the implementation
of the second library and not the stubs. After this change, if
the first library is also present in a second APEX but the second
library is not, then the common variant shared between the two
APEXes would use the stubs, not the implementation.
In a correctly configured set of build rules this change will
be irrelevant, because if the compilation worked for the second
APEX using stubs then it will work for the common variant using
stubs. However, if an incorrect change to the build rules is
made this could lead to confusing errors, as a previously-working
common variant could suddenly stop building when a module is added
to a new APEX without its dependencies that require implementation
APIs to compile.
This change reduces the number of modules in an AOSP arm64-userdebug
build by 3% (52242 to 50586), reduces the number of variants of the
libcutils module from 74 to 53, and reduces the number of variants
of the massive libart[d] modules from 44 to 32.
Bug: 164216768
Test: go test ./build/soong/apex/...
Change-Id: I0529837476a253c32b3dfb98dcccf107427c742c
In preparation for reusing the same variation for multiple apexes,
rename ApexName to ApexVariationName.
Bug: 164216768
Test: all soong tests
Change-Id: I88f2c5b192ffa27acd38e01952d0cefd413222a0
Remove ipmemorystore-aidl-interfaces-java in allowlist for
com.android.tethering
Bug: 146436251
Test: m nothing
Change-Id: I8b7f97d59c2fd191f467ad50a8fd66d9a5d37704
With the addition of apexes and /system_ext some of the bootclasspath
and system server jars have moved from /system to the new locations.
This has been implemented by using lists of colon-separated strings
called "apex-jar pairs" (although "apex" was misleading as it could
refer to "platform" or "system_ext", not necessarily a real apex).
Using the colon-separated string representation is inconvenient, as it
requires splitting and reassembling the list components many times,
which harms performance and makes error handling difficult. Therefore
this patch refactors the colon-separated lists into a struct that
hides the implementation details.
Test: lunch aosp_cf_x86_phone-userdebug && m
Change-Id: Id248ce639a267076294f4d4d73971da2f2f77208
Previously, the prebuilt mutators were added by the
cc.RegisterRequiredBuildComponentsForTest() function as a convenience
but unfortunately it lead to some of the mutators being in a different
order in the tests than in the normal build.
This change:
* Extracts the RegisterPrebuiltMutators() call from
cc.RegisterRequiredBuildComponentsForTest()
* Makes sure that the prebuilt mutators are registered before the
visibility gatherer and enforcer mutators.
Bug: 162505935
Test: m nothing
Change-Id: I7d959b558200b502f0a5e4653c41ea01414e142a
com.android.gki.* matches any APEX with the prefix com.android.gki.,
like com.android.gki.bar.
Test: use it
Bug: 162267963
Change-Id: Ie46fcb08b031611d26b2b6cde157253f51ba9bfc
Multiple GKI APEXes may write to the same path
under $OUT/apex. Prevent it.
Fixes: 162366062
Test: build GKI APEX
Change-Id: I1b19870b10d6da2a85c3f7b9d93408d3a0fe90bc
dependencyTag uses a set of predefined tags to identify different types
of dependencies. There are already multiple bits of metadata stored
in the dependency tag (Library, Shared, ReexportFlags), and supporting
them all requires a combinatorial explosion of predefined tags and
causes issues when using equality comparisons if a new bit of metadata
is added.
Add a new libraryDependencyTag type that will contain the metadata
bits, and replace the quality comparisons with checks on the metadata
bits.
There are 5 TODOs where modifying the checks identified problems with
the existing checks. These were left in place to produce identical
build output and will be fixed separately.
Bug: 162437057
Test: no change to build.ninja or {Android,make_vars,late}-${TARGET_PRODUCT}.mk
Change-Id: I72d4207dcf381c07c92e00e5a03968ebb5ed8d30
When a vendor APEX sets use_vndk_as_stable: true, then the apex doesn't
bundle VNDK libraries but instead it uses them from the "vndk" namespace
at runtime.
":vndk" is a pseudo-name for VNDK libraries, which is processed by
linkerconfig so that the generated linker configuration allows the
namespace for the apex to access VNDK libs.
Bug: 159576928
Test: test with a test-only vendor apex
it runs okay with VNDK libs. (lsof shows that it opens libs from
VNDK APEX)
Change-Id: I924ce0fea696162575f59589b8f858deddf436b3
Update android_app_set to use word install rather than master for
android_app_sets, this better matches the phrasing used for apex_set.
See https://source.android.com/setup/contribute/respectful-code for
reference
Bug: 161896447
Test: m nothing
Change-Id: I429e7f8b16c42c10ad4d9543110f5ce814a893b1
Vendor APEXes(in general, APEXes for non-system partitions) which is
supposed to be tied to a specific VNDK version can set this new property
so that it excludes VNDK libs and use them from VNDK APEX (provided by
system parition).
For these APEXes to use VNDK libs from VNDK APEX, linkerconfig should
link "vndk" linker namespace to the namespaces of these APEXes.
Bug: 159195575
Test: m (soong test added)
Change-Id: If90650973239ef7aab0ff084488bda57d9b0364e
This change fixes this error:
```
TARGET module com.android.adbd.flattened requires non-existent TARGET
module: prebuilt_libclang_rt.ubsan_standalone-arm-android
```
apexFile.moduleName is used as Make dependency name, so it should use
m.BaseModuleName() instead of m.Name(), because soong may prepend
"prebuilt_" to or mutate the output of m.Name() in other ways.
android/androidmk.go emits Android.mk modules with
`LOCAL_MODULE := module.BaseModuleName() + <SubName>`, so replace
apexFile.moduleName with BaseModuleName() + <SubName> as much as
possible.
Bug: 7456955
Test: Add unit test in apex/apex_test.go
Test: lunch blueline_hwasan && SANITIZE_TARGET='hwaddress fuzzer' m nothing
Test: Verify out/soong/Android-blueline_hwasan.mk
Change-Id: If8537fc1bedbe6c3405de3662a5df210a073c43f
Previously, an APEX variant was created for a module that was a member
of an SDK just in case it had to be replaced with an APEX requested
snapshotted version of that member. That was necessary because that was
the only way to have APEX specific replacements.
Since then a new method called ReplaceDependenciesIf() has been added
which provides fine grained control over which dependencies are
replaced. This change uses that new method to handle the replacements
which allows the APEX variants to be removed.
Bug: 161928524
Test: m nothing
Change-Id: If3869dd6753dc182b099af566b20fbc9c9c6eff7
apexDepsMutator marks all dependencies of apex modules. Previously, it
was converted from WalkDeps() to Top-down mutator to avoid the pitfall
of WalkDeps() bug. (It did't handle multiple visits via different
paths.)
Because WalkDeps() problem solved in aosp/1277516, apexDepsMutator can
be reverted to use WalkDeps().
Even though there's no observable difference between them, I revert this
for the up-coming change, which requires different pruning strategies
per apexes.
Bug: 159195575
Test: m
Change-Id: Ib09cbc7a3dfd143dd37b660b1aea6c71392ce2e3
The RelativeInstallPath is currently unused for apexes; however, as it
stands, relative install paths would be handled differently for
flattened and unflattened apexes.
Test: go java test
Test m nothing
Change-Id: Iad9350642cad27c4f745cea6e5fc9e11e7b06ee4
prebuilt_apex has been disabled when the device is configured for
flattened APEXes, sanitized, instrumented, or built unbundled. However,
apex_set which is another type of APEX prebuilt wasn't disabled for the
same conditions.
This change fixes the discripency. apex_set modules are also force
disabled when the prebuilts are not expected.
Bug: 161316762
Bug: 160933444
Test: OVERRIDE_TARGET_FLATTEN_APEX=true m
The built image has only the flattened APEXes and the device boots
Change-Id: I6c90dfb28d565861a473a1bdce93269ec370601d
We put reproducible timestamps in zip files so that the artifacts
are consistent, but that leads to old timestamps in the output
directory if they are unzipped as part of the build. Use
unzip -DD when unzipping to update the timestamps.
Bug: 161015009
Test: touch -d 2020-01-01 ref; find $OUT/system -not -newer ref
Change-Id: I70407a627cb070e24be510faa6a774e3d9eae3a8