Commit graph

1265 commits

Author SHA1 Message Date
Anton Hansson
dff2c78a20 Add attribute to disable last-api compat tracking
Setting this to true by default is dangerous as it can mask bugs. Create
a dedicated attribute for java_sdk_library to enable this behavior
instead. The default will be flipped in a future CL when all the current
offenders have been fixed.

Fix all the tests to have the right API files.

Bug: 176092454
Test: m nothing
Change-Id: Ieab94bcb74abf8d018365a56fb447fe3dbd46957
2020-12-21 17:25:30 +00:00
Colin Cross
e6a83e65d1 Fix NDK build in downstream branches
The NDK build in downstream branches with prebuilt apexes break
with multiple rules to copy the apex after
I8038ed5c6f05c989ac21ec06c4552fb3136b9a7a renamed SkipInstall to
HideFromMake, which is shadowed by an existing HideFromMake method.
Call through from the existing HideFromMake as a quick-fix for the
build.

Fixes: 175911330
Test: NDK build
Change-Id: Id475671d5dad888913bfb1af2e4be1f2454c3211
2020-12-17 18:22:34 -08:00
Colin Cross
a9c8c9f145 Call ctx.InstallFile for uninstallable cc modules
SkipInstall is actually primarily used to prevent making a module
visible to Make, rename it and add new SkipInstall that actually
skips installation without affecting Make.

Call c.SkipInstall() for uninstallable cc modules to allow calling
c.installer.install, which will collect PackagingSpecs for
uninstallable cc modules, allowing them to be used by genrules.

Bug: 124313442
Test: m checkbuild
Change-Id: I8038ed5c6f05c989ac21ec06c4552fb3136b9a7a
2020-12-17 10:02:18 -08:00
Treehugger Robot
f1c48afc31 Merge "arch specific dependencies are supported for apex" 2020-12-17 00:15:26 +00:00
Treehugger Robot
abada78f05 Merge "Always track transitive dependencies for host." 2020-12-16 13:14:28 +00:00
Martin Stjernholm
f2635ec434 Always track transitive dependencies for host.
This fixes a regression in https://r.android.com/1515154 when building
the host ART APEX (com.android.art.host).

Test: art/build/apex/runtests.sh
Bug: 166468760
Change-Id: I39a00019b7bfa77a865e7287c66add3566b34d87
2020-12-16 01:34:43 +00:00
Treehugger Robot
6a8c18a89b Merge "versioning macro is exported from prebuilt stubs as well" 2020-12-16 01:31:10 +00:00
Jiyong Park
892a98f0a3 versioning macro is exported from prebuilt stubs as well
This change fixes a bug that the versioning macro (__LIBNAME_API__) is
omitted for prebuilts providing a stub.

Bug: 175166063
Test: m nothing

Change-Id: I1cce5ab58ef245622861200ec0d8b0f84e3178ed
2020-12-16 03:54:44 +09:00
Colin Cross
01a44004fd Merge changes from topic "header_libs_requirement"
* changes:
  Add libstagefright_mp3dec_headers to allowed apex deps
  Require libraries in header_libs to be cc_library_header
2020-12-15 18:40:55 +00:00
Bernie Innocenti
22d64d9d45 Add quiche and its deps to apex/allowed_deps.txt
Test: m
Bug: 155855709
Change-Id: I1eda029d912d53b0f888c4162422b4bbab948fe1
Merged-In: I0f4b1d011d058a1d3a43687a5ea0b7b5335aebbc
2020-12-15 09:34:08 +00:00
Treehugger Robot
e223512bb4 Merge "Prebuilt stub not available to platform is handled correctly" 2020-12-15 06:26:33 +00:00
Orion Hodson
c7dff7f142 Merge "apex/allowed_deps: add libnetjniutils" 2020-12-15 06:25:38 +00:00
Jiyong Park
f7c3bbe433 Prebuilt stub not available to platform is handled correctly
When a shared library providing stubs is included in an APEX, only the
stub variant (i.e. version:"1", etc.) gets emitted to Android.mk. This
enforces that everything in the Make world to link to the stub providing
only the public APIs of the library. The non-stub variant (i.e.
version:"") isn't exposed, otherwise, others will be able to access
private part of the lib which isn't guaranteed to be stable.

This has been done by unhiding the stub variant when it is known that
the library is actually included in an APEX. Note that stub variants are
by default hidden.

The above mechanism however doesn't work when the shared library is
replaced by a prebuilt and when the APEX is also replaced by a prebuilt.
Then, the fact that the prebuilt library is actually in the APEX gets
lost.  In that case, AnyVariantDirectlyInAnyApex() returns false for the
prebuilt library. As a result, the stub variant remains hidden and not
emitted to Android.mk.

This change fixes the problem by checking if the lib isn't available for
the platform at all. If not available for the platform (e.g.
apex_available doesn't have "//apex_available:platform"), the lib is
assumed to be included in an APEX even when it actually didn't go
through the apex mutator (... because it's a prebuilt).

Bug: 175166063
Test: m nothing

Change-Id: I41fabd5b368baecf4dc3c5a080b466f8bcd79d77
2020-12-15 09:17:36 +09:00
Colin Cross
3f2fa9b846 Add libstagefright_mp3dec_headers to allowed apex deps
libstagefright_mp3dec_headers is being split out of
libstagefright_mp3dec.

Bug: 173252016
Test: m checkbuild
Change-Id: I7ab485832628203a907ebe8c3f79325d8b5788f4
2020-12-14 19:28:47 +00:00
Yan Yan
1df80f2951 Merge "Allow IPsec module to depend on modules-utils-build" 2020-12-14 18:33:50 +00:00
Paul Duffin
57fab96e01 Merge changes Iaca95efc,I7ccd5581
* changes:
  Add RemoveOptionalPrebuiltPrefix() helper function
  Delegate work of apexInfoMutator to ApexInfoMutator interface
2020-12-14 10:54:21 +00:00
Jiyong Park
59140307ec arch specific dependencies are supported for apex
The apex module type now supports arch specific native dependencies.

apex {
    name: "myapex",
    arch: {
        arm64: {
	    native_shared_libraries: ["arm64_only_lib"],
	},
    },
}

Bug: 174639241
Test: m nothing
Change-Id: I3f00aa87c480d4127b27d33e9620c4336824e937
2020-12-14 18:44:04 +09:00
Sophie Zheng
e3a2bdf2c8 Merge "Automate NDK API coverage used by Mainline modules build integration" 2020-12-11 22:19:00 +00:00
Paul Duffin
d23c726b36 Add RemoveOptionalPrebuiltPrefix() helper function
Test: m nothing
Bug: 171061220
Change-Id: Iaca95efcaf3f02e066751c6e988d609ac40e048a
2020-12-11 18:13:08 +00:00
Paul Duffin
a7d6a89774 Delegate work of apexInfoMutator to ApexInfoMutator interface
Refactor the apexInfoMutator to delegate the work to an implementation
of ApexInfoMutator and then move the existing functionality into the
apexBundle.ApexInfoMutator(). This will allow a follow up change to
customize the behavior of this mutator for prebuilt_apex modules.

Test: m nothing
Bug: 171061220
Change-Id: I7ccd55818e02a606c5494e215f4370b635ddd0a5
2020-12-11 16:07:17 +00:00
Paul Duffin
08703826bd Merge "Rename apexDepsMutator to apexInfoMutator" 2020-12-11 10:06:19 +00:00
Paul Duffin
4d934af2ee Merge "Extract testDexpreoptWithApexes() for reuse" 2020-12-11 10:06:07 +00:00
Jiyong Park
6f05a73e3e Merge "stub variants also re-exports headers" 2020-12-11 08:50:12 +00:00
Jiyong Park
1ad8e16fbe stub variants also re-exports headers
This change fixes a bug that headers are not re-exported from stub
variants of a library, if the headers are not from header libs, but from
shared or static libs. This is because only header lib dependencies
are respected for stubs variants.

The fix is as follows. 1) dependencies to the shared/static libs are
added even for stubs variants. 2) instead, in depsToPaths, they are
treated like header libs (i.e. don't contribute to linkFile) for the
stubs variants.

Bug: 174558745
Test: m

Change-Id: Iab6c77e7817055d0f2d09cb114186b30164fc231
2020-12-11 13:48:28 +09:00
sophiez
55e8815fb8 Automate NDK API coverage used by Mainline modules build integration
Dist txt files containing NDK APIs used by Mainline modules

Test: TARGET_BUILD_APPS=com.google.android.adbd m dist apps_only

Change-Id: I035f1e0cc7eb43fc09e796dbc6ce77e65b8aa3b4
2020-12-11 00:45:20 +00:00
Jiyong Park
b555609098 Merge "rust ffi libraries can be included in APEX" 2020-12-10 23:54:34 +00:00
Jiyong Park
0d399b5915 Merge "Add min_sdk_version to Rust modules." 2020-12-10 23:54:34 +00:00
Paul Duffin
949abc03eb Rename apexDepsMutator to apexInfoMutator
Generally ...DepsMutator methods add dependencies between modules but
the apexDepsMutator does not which can be confusing. This renames
apexDepsMutator to apexInfoMutator and adds some extra documentation to
clarify its function. It also renames the registered name for the
mutator and its associated providers from apex_deps to apex_info.

Test: m nothing
Bug: 171061220
Change-Id: Ic074a281215b23e982448ccff7ac075236123bee
2020-12-10 20:16:57 +00:00
Paul Duffin
c3bbb96667 Extract testDexpreoptWithApexes() for reuse
Extracts testDexpreoptWithApexes() from testDexpreoptWithApexes() to
reuse in other tests.

Test: m nothing
Bug: 171061220
Change-Id: Iee62b68d72133b4cc066e2875bd27d7051206cbc
2020-12-10 20:16:57 +00:00
Steven Moreland
35989ae98b Merge "target.apex.exclude_[shared|static]_libs to cc_* modules" 2020-12-10 19:02:02 +00:00
Treehugger Robot
a4fd2ea7b2 Merge "Add neuralnetworks_utils_hal_service to apex/allowed_deps.txt" 2020-12-10 12:21:57 +00:00
Jiyong Park
2b33ad60aa Merge "test_for is available for all cc_* module types" am: 2920d2cec0
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1517638

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I38d61acc50786ee97ee85e7cf89d9664dd91a148
2020-12-10 00:33:40 +00:00
Jiyong Park
2920d2cec0 Merge "test_for is available for all cc_* module types" 2020-12-10 00:16:29 +00:00
Yan Yan
1a93af7632 Allow IPsec module to depend on modules-utils-build
This is generated by build/soong/scripts/update-apex-allowed-deps.sh

Bug: 157577190
Test: builds
Change-Id: Ie71c63238c16c9cade400e1b3df02c35d915265c
2020-12-09 15:48:55 -08:00
Ivan Lozano
3e9f9e47cf Add min_sdk_version to Rust modules.
Add the min_sdk_version property to Rust modules so they can declare
a minimum SDK version they support for use with APEX modules.

Test: New Soong test passes.
Bug: 174862583
Change-Id: I2829053a320f50c218783dee5adbeff9cef81e8e
2020-12-09 11:30:44 -05:00
Slava Shklyaev
af1df7008b Add neuralnetworks_utils_hal_service to apex/allowed_deps.txt
Similarly to the other neuralnetworks_utils_hal_* targets, this new
target is a result of restructuring our code.

Generated with build/soong/scripts/update-apex-allowed-deps.sh

Bug: 170289677
Test: m
Change-Id: I7ca24e8afe6cfb978d51f0b55389615e5f28a1e0
Merged-In: I7ca24e8afe6cfb978d51f0b55389615e5f28a1e0
(cherry picked from commit c1a84ca5cb)
2020-12-09 16:01:31 +00:00
Mohammad Islam
8f1078cdcd Merge "Enable soong build tool to handle APEX compression" am: 5d2c54f1e2
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1511283

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I567fada250e030005c9c103b1c24228bf0b52988
2020-12-09 14:49:33 +00:00
Mohammad Islam
5d2c54f1e2 Merge "Enable soong build tool to handle APEX compression" 2020-12-09 14:34:42 +00:00
Jiyong Park
46a512f1f5 test_for is available for all cc_* module types
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
2020-12-09 12:59:19 +09:00
Jiyong Park
f2cc1b77f3 rust ffi libraries can be included in APEX
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
2020-12-09 00:29:54 +09:00
Anton Hansson
f261d7c2bf Merge "Add native modules build utils to allow list" am: d230030dfd
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1518600

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I41c3cb22b2f18b22b128e418976b2e7f7c0e7aef
2020-12-08 14:34:05 +00:00
Orion Hodson
50ad989646 apex/allowed_deps: add libnetjniutils
Bug: 158749603
Test: m
Change-Id: I00a8d61eebba5ae43f2338822854264dfabad4af
2020-12-08 13:55:16 +00:00
Mohammad Samiul Islam
3cd005d347 Enable soong build tool to handle APEX compression
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
2020-12-08 13:06:25 +00:00
Anton Hansson
1e1e823895 Add native modules build utils to allow list
This is a backward-compatible library.

Test: m with dep
Change-Id: Id68a00efe8973e7660ce2e53d42b7741c9f22a5c
2020-12-07 12:54:07 +00:00
Jiyong Park
e386754898 target.apex.exclude_[shared|static]_libs to cc_* modules
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
2020-12-04 18:09:39 +09:00
Treehugger Robot
00fd1c09d5 Merge "Don't use module names with "prebuilt_" prefixes in make dependencies." am: d348c41af5
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1515504

Change-Id: Id640558409539dd91f945f35786085afcbbf8fa3
2020-12-04 07:32:25 +00:00
Treehugger Robot
d348c41af5 Merge "Don't use module names with "prebuilt_" prefixes in make dependencies." 2020-12-04 06:23:51 +00:00
Kiyoung Kim
41e45d90b3 Merge "Add linkerconfig to Runtime APEX" am: 2ba87f466c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1513630

Change-Id: I52d9e487f3dba459bde89db08182227b8f1ad526
2020-12-04 01:35:45 +00:00
Martin Stjernholm
2856c66c99 Don't use module names with "prebuilt_" prefixes in make dependencies.
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
2020-12-04 01:00:23 +00:00
Kiyoung Kim
2ba87f466c Merge "Add linkerconfig to Runtime APEX" 2020-12-04 01:00:22 +00:00
Sophie Zheng
94443b9511 Merge "Automated NDK API coverage used by Mainline modules build integration." am: 8baa8b50a8
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1496322

Change-Id: I960f808499c2f63cfb04c98fe4e35cdc65b94e4a
2020-12-03 23:56:09 +00:00
Sophie Zheng
8baa8b50a8 Merge "Automated NDK API coverage used by Mainline modules build integration." 2020-12-03 23:30:21 +00:00
Treehugger Robot
440ad728a4 Merge "Rename __ANDROID_SDK_VERSION__." am: fe9e0c775c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1502112

Change-Id: I72397bc3c7da996d44a088a252ca58124118da47
2020-12-03 22:29:10 +00:00
Treehugger Robot
fe9e0c775c Merge "Rename __ANDROID_SDK_VERSION__." 2020-12-03 22:09:56 +00:00
Colin Cross
c5666f9231 Merge "Pass pctx and ctx to NewRuleBuilder" am: 897a5ad507
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1500984

Change-Id: Idd3ca2ed1b5ea6c0d666c35d1669bc90ee6edfdc
2020-12-03 20:16:11 +00:00
sophiez
c80a2b392e Automated NDK API coverage used by Mainline modules build integration.
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
2020-12-03 05:45:20 +00:00
Saeid Farivar Asanjan
8cb9f3f5ef Add car-ui-lib-overlayable to apex allowed_deps
Bug: 168062639
Test: manual
Change-Id: If31714ad0ab00af65e6f880fb8f7224e2c46d0a3
Merged-In: If31714ad0ab00af65e6f880fb8f7224e2c46d0a3
(cherry picked from commit 0b94aab5ef)
2020-12-02 08:58:34 -08:00
Kiyoung Kim
4098c7eddf Add linkerconfig to Runtime APEX
Add linkerconfig to Runtime APEX module.

Bug: 165769179
Test: Cuttlefish boot succeeded
Change-Id: I31c4bfa2ce88b64d7100f227ec289416db253b13
2020-12-02 11:33:54 +09:00
Colin Cross
f1a035e6be Pass pctx and ctx to NewRuleBuilder
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
2020-12-01 16:22:16 -08:00
Dan Albert
b19953d04a Rename __ANDROID_SDK_VERSION__.
__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
2020-11-30 14:39:01 -08:00
Jiyong Park
fdea25781f Merge "rust modules can be included in apex" 2020-11-30 15:41:28 +00:00
Jiyong Park
99644e92c8 rust modules can be included in apex
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
2020-11-30 15:40:48 +00:00
Paul Duffin
281bc00bbf Remove redundant setting of DistFiles by apexBundle
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
2020-11-27 15:17:44 +00:00
Paul Duffin
74f05598eb Differentiate between no dist tag and an empty dist tag
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
2020-11-27 15:17:44 +00:00
Jiyong Park
b81b99032d Documenting apex/builer.go
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
2020-11-25 09:53:46 +09:00
Jiyong Park
c0ec6f99d7 Documenting apex/apex.go
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
2020-11-24 09:28:50 +09:00
Jiyong Park
e4758ed844 Documenting android/apex.go
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
2020-11-20 10:07:19 +09:00
Jiyong Park
8e6d52f362 Reorganize apex/apex.go
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
2020-11-20 08:44:55 +09:00
Colin Cross
1af783fae7 Merge "Replace android.WriteFile rule with android.WriteFileRule" 2020-11-16 23:11:41 +00:00
Jooyung Han
74f576de58 Remove "apex_uses" mutator
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
2020-11-16 09:08:30 +00:00
Colin Cross
cf371cc1f7 Replace android.WriteFile rule with android.WriteFileRule
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
2020-11-14 16:26:00 -08:00
Colin Cross
ae8600b507 Pass Config to NewTestContext instead of ctx.Register
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
2020-11-12 10:07:49 -08:00
Anton Hansson
82d502a7b2 Make apex modules support tagged dists
Bug: 172951145
Test: m dist my_dist_target (with patch in bug)
Change-Id: I0da4568a49ea48efbf864614a7e7c647f251a7ce
2020-11-11 12:34:20 +00:00
Treehugger Robot
25b0780f37 Merge "Define product_available property" 2020-11-09 00:40:50 +00:00
Justin Yun
63e9ec70bb Define product_available property
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
2020-11-08 23:53:22 +00:00
Nikita Ioffe
3862cd509b Merge "Update apex/allowed_deps.txt" 2020-11-06 12:46:39 +00:00
Nikita Ioffe
77e1d4b4e5 Update apex/allowed_deps.txt
Bug: 171330443
Bug: 171668006
Test: build/soong/scripts/update-apex-allowed-deps.sh
Change-Id: I5f3d834687121ba967d1e3aeb301c87679b2078d
Merged-In: I5f3d834687121ba967d1e3aeb301c87679b2078d
2020-11-05 21:46:26 +00:00
Artur Satayev
ed667a8345 Add PHONY for apex-allowed-deps check.
Bug: 149622332
Test: m apex-allowed-deps-check
Change-Id: I5848779b4ad04dd4c95e2667f7f62dd2949ac95e
Merged-In: I5848779b4ad04dd4c95e2667f7f62dd2949ac95e
(cherry picked from commit 01aa11e833)
2020-11-04 20:50:03 +00:00
Nikita Ioffe
3b834bf347 Update apex/allowed_deps.txt
Test: build/soong/scripts/update-apex-allowed-deps.sh
Change-Id: Iad138bdb439e3ebc7a145dec7875b8bb5756d755
2020-11-04 17:12:27 +00:00
Martin Stjernholm
af3bf0dd5d Merge "Move hardcoded apex_available's for ART modules into ART blueprints." 2020-11-04 16:28:26 +00:00
Slava Shklyaev
af7e511921 Add new neuralnetworks targets to apex/allowed_deps.txt
Generated with build/soong/scripts/update-apex-allowed-deps.sh

Bug: 160669906
Test: m
Change-Id: Ifd056230dd352fe3fa1c462d1e090aef5bbeb09d
Merged-In: Ifd056230dd352fe3fa1c462d1e090aef5bbeb09d
(cherry picked from commit 7f0c05539f)
2020-11-03 17:40:01 +00:00
Steven Moreland
9efbd038a7 Update VNDK version for common graphics HALs.
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)
2020-11-03 17:35:43 +00:00
Nikita Ioffe
f9b945196b Manually update apex/allowed_deps.txt
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
2020-11-03 17:30:31 +00:00
Treehugger Robot
20cf20ba1c Merge changes I0289d866,Ie7363524
* changes:
  Move stubs related methods out of LinkableInterface
  Don't create stubs variants of static libraries
2020-11-02 21:31:11 +00:00
Martin Stjernholm
377d752a6b Move hardcoded apex_available's for ART modules into ART blueprints.
Test: m droid
Bug: 133140750
Change-Id: I7280c7c61979d8f1aa3c849ff7079a5dd3ef216d
2020-10-30 02:17:23 +00:00
Colin Cross
a717db7304 Don't create stubs variants of static libraries
Statically linking stub implementations doesn't make sense, don't
create stubs variants of static libraries.

Bug: 170784825
Test: all soong tests
Change-Id: Ie73635244516edf6da884e3a7a275971a9bd7839
2020-10-29 14:17:37 -07:00
Nikita Ioffe
7f17421012 Update apex/allowed_deps.txt
Bug: 171330443
Bug: 171668006
Test: build/soong/scripts/update-apex-allowed-deps.sh
Change-Id: Id239ea9b31ce23f045f0db4027db33658ef3da14
Merged-In: Id239ea9b31ce23f045f0db4027db33658ef3da14
2020-10-29 15:35:01 +00:00
Nikita Ioffe
769f4a5c03 Update apex/allowed_deps.txt
Bug: 171330443
Test: build/soong/scripts/update-apex-allowed-deps.sh
Change-Id: Ic7ddd86cefc0c6a26de294b6e73b3e23d4791f5c
Merged-In: Ic7ddd86cefc0c6a26de294b6e73b3e23d4791f5c
2020-10-28 01:17:55 +00:00
Paul Duffin
e10dfa4e3d Cleanup usages of CreateConfiguredJarList
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
2020-10-27 10:36:29 +00:00
Paul Duffin
69d1fb1e39 Switch BootJars/UpdatableBootJars to ConfiguredJarList
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
2020-10-27 10:36:29 +00:00
Treehugger Robot
93d8c6443e Merge "Add libdmabufheap to the list of allowed dependencies" 2020-10-26 19:31:57 +00:00
Colin Cross
ed5dee0a8f Merge "Add llndk_stubs property" 2020-10-23 18:09:42 +00:00
Martin Stjernholm
9649748516 Merge "Rename ART release APEX to com.android.art." 2020-10-23 10:03:24 +00:00
Steven Moreland
8f01ff814b Merge "apex dependency error: note 'apex_available'" 2020-10-22 23:08:18 +00:00
Hridya Valsaraju
87076a45be Add libdmabufheap to the list of allowed dependencies
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
2020-10-21 22:09:44 -07:00
Steven Moreland
6e36cd6104 apex dependency error: note 'apex_available'
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
2020-10-22 01:23:33 +00:00
Colin Cross
0477b42276 Add llndk_stubs property
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
2020-10-21 10:55:33 -07:00
Martin Stjernholm
7f51107ee6 Rename ART release APEX to com.android.art.
Test: See https://r.android.com/1457217
Bug: 169639321
Change-Id: I6800c7a382486b4e50945cc8b789f4be16482fe6
Merged-In: I6800c7a382486b4e50945cc8b789f4be16482fe6
2020-10-21 15:41:02 +01:00
Nikita Ioffe
5335bc471a Propagate min_sdk_version to apexer
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)
2020-10-21 14:26:44 +01:00
Nikita Ioffe
dd203b6b34 Update allowed deps for sdkext apex
Test: m
Bug: 171096530
Bug: 171330443
Change-Id: Iacaa4e8c6ed2e3854ef973a84bb0e44c433c00d3
2020-10-20 21:08:41 +00:00
Colin Cross
d4620701ad Merge "Start using Providers instead of direct module access" 2020-10-13 21:48:26 +00:00
Evgenii Stepanov
2080bfe79a Support asan/hwasan versions of prebuilts.
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
2020-10-13 03:37:32 +00:00
Colin Cross
0de8a1e17b Start using Providers instead of direct module access
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
2020-10-12 16:55:47 -07:00
Steven Moreland
73a9e603d5 Merge "build/soong/scripts/update-apex-allowed-deps.sh" 2020-10-12 16:59:24 +00:00
Colin Cross
405af07859 Revert "Make lots of tests run in parallel"
This reverts commit 323dc60712.

Reason for revert: Possible cause of test instability
Bug: 170513220
Test: soong tests

Change-Id: Iee168e9fbb4210569e6cffcc23e60d111403abb8
2020-10-09 18:34:24 -07:00
Colin Cross
323dc60712 Make lots of tests run in parallel
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
2020-10-06 15:12:22 -07:00
Colin Cross
56a8321c21 Remove global state from apex modules
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
2020-10-06 13:39:57 -07:00
Jooyung Han
51ce6b0acc Merge "apex: emit file_contexts for flattened apex" 2020-10-06 03:26:14 +00:00
Steven Moreland
3453948ad0 build/soong/scripts/update-apex-allowed-deps.sh
For bionic_libc_platform_headers(minSdkVersion:29).

Bug: 166675194
Test: build
Change-Id: I5c516265003ee2e0cec619ef7872e8a549354385
2020-10-06 00:52:00 +00:00
Treehugger Robot
0400ede359 Merge "Remove stale apex_available dependency." 2020-10-04 22:52:57 +00:00
Artur Satayev
4e1f2bd0d8 Track allowed transitive deps in any updatable module.
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)
2020-09-30 21:17:42 +00:00
Martin Stjernholm
3b8ca4c317 Remove stale apex_available dependency.
Test: m
Bug: 142944931
Change-Id: I9c69ef64eb9eecd45f6272a1d79bf77ee910815c
2020-09-30 17:40:17 +01:00
Treehugger Robot
025ae97b0e Merge "Add support of test data to python_host_test" 2020-09-29 21:56:19 +00:00
Treehugger Robot
6c76f18aae Merge "Don't include artifacts for host-cross targets" 2020-09-29 14:03:05 +00:00
Jiyong Park
ccb406fc9c Don't include artifacts for host-cross targets
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
2020-09-29 11:22:23 +09:00
Colin Cross
7812fd3814 Fix ChooseSdkVersion after api levels
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
2020-09-26 00:53:03 +00:00
Treehugger Robot
4f6eebff0c Merge changes I0885e493,Ic37c8db9
* changes:
  linux_bionic_arm64 is added when Host_bionic_arm64 is true
  HostCross is an attribute of a Target, not OsType
2020-09-24 22:56:43 +00:00
Jiyong Park
1613e5541f HostCross is an attribute of a Target, not OsType
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
2020-09-24 14:14:31 +09:00
Jooyung Han
7f146c0da1 apex: emit file_contexts for flattened apex
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
2020-09-23 15:43:39 +00:00
Dan Albert
4f378d75aa Convert more versions in config to ApiLevel.
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
2020-09-22 16:01:56 -07:00
Dan Albert
0b176c8038 Replace FutureApiLevel with an ApiLevel.
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
2020-09-22 15:04:48 -07:00
Dan Albert
c8060536e8 Replace ApiStrToNum uses with ApiLevel.
Test: treehugger
Bug: http://b/154667674
Change-Id: I2954bb21c1cfdeb305f25cfb6c8711c930f6ed50
2020-09-22 15:04:48 -07:00
Dan Shi
3194912150 Add support of test data to python_host_test
Bug: none
Test: m -j vts_vndk_abi_test
confirm abi_dump.zip found next to test binary

Change-Id: I834dddfc13eb9e7addd234307b085b16124db234
2020-09-21 14:36:43 -07:00
Jooyung Han
8e5685ddca apex: prebuilt_firmware installs in /etc/firmware
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
2020-09-21 11:02:57 +09:00
Colin Cross
a018b3df16 Merge "Use alias for test_per_src apex dependencies" 2020-09-12 20:21:36 +00:00
Colin Cross
90dab3498d Use alias for test_per_src apex dependencies
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
2020-09-11 16:02:24 -07:00
Jooyung Han
07931c73a3 apex: pass init_rc/vintf_fragments to make
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
2020-09-11 17:33:19 +09:00
Xin Li
80dc4f137a Merge "Merge Android R" 2020-09-10 17:22:09 +00:00
Kousik Kumar
3e0b9c031c Merge "Check UseRBE is set before replacing any template with the RE version." 2020-09-10 09:24:17 +00:00
Xin Li
429c23c1fa Merge Android R
Bug: 168057903
Merged-In: I9d5d0da0f409bd6b131f7e0f6363be061d3045c1
Change-Id: Ie7feaf6a3d0787c750de17540969b876a4306b0a
2020-09-09 20:21:02 -07:00
Jiyong Park
41f637d653 Notice files for prebuilt_etc are included in APEX
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
2020-09-09 13:19:56 +09:00
Mark Chien
288f40ba51 Merge "Include bpf program in APEXes" am: 66a0ae60f8
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1418308

Change-Id: I86983c1012615e95d1d9aac875a52e92248a17b8
2020-09-04 09:11:22 +00:00
Mark Chien
66a0ae60f8 Merge "Include bpf program in APEXes" 2020-09-04 08:58:21 +00:00
Ramy Medhat
16f23a4038 Check UseRBE is set before replacing any template with the RE version.
Test: presubmit
Change-Id: I6df58b4e700f0d231367af2710672d731d20a736
2020-09-03 01:29:49 -04:00
Colin Cross
90d0500699 Merge changes I59b7a32a,Ida7bc75a am: 0329f2398c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1406259

Change-Id: I9b2b709c59630394aa528c64b4fbe60b52d50be5
2020-09-03 00:21:49 +00:00
Colin Cross
0329f2398c Merge changes I59b7a32a,Ida7bc75a
* changes:
  Only request image and version variations for device SDK dependencies
  Create os and arch variants for GoBinaryTool modules
2020-09-02 23:51:53 +00:00
markchien
2f59ec98d1 Include bpf program in APEXes
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
2020-09-02 22:18:25 +08:00
Jooyung Han
4c92cad10e Merge commit '0703fd873fe2ed492266a4457a1e217971c2f4f0' into manual_merge_1e3d9fb376aaf1be6de1bd16a9004ccc95226ab0
Change-Id: I7115a50254e23e3f7d9cdab960c671195746978e
2020-09-02 14:19:18 +09:00
Xin Li
ca52d2ff53 Merge "Merge Android R (rvc-dev-plus-aosp-without-vendor@6692709)" into stage-aosp-master 2020-09-01 20:01:23 +00:00
Jooyung Han
0703fd873f apex: support prebuilt_firmware for vendor apexes
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
2020-09-01 10:45:13 +09:00
Colin Cross
9c35c9ae63 Merge "Remove hack for platform availability of modules with missing apexes" 2020-08-31 04:20:18 +00:00
Xin Li
65cb5c69ea Merge Android R (rvc-dev-plus-aosp-without-vendor@6692709)
Bug: 166295507
Merged-In: Ifca7b65f4e27bf14cdc30f72f790b0de90130bae
Change-Id: I3a39be5f0b8736de4822c6a14072c78d4e4ad89d
2020-08-29 01:17:45 -07:00
Nikita Ioffe
a0254b5289 Merge "Add F2FS support for APEX build system" 2020-08-28 21:55:24 +00:00
Colin Cross
d2c81a7933 Remove hack for platform availability of modules with missing apexes
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
2020-08-28 13:32:02 -07:00
Theotime Combes
4ba38c1a3f Add F2FS support for APEX build system
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
2020-08-28 12:03:00 +00:00
Jooyung Han
b9007609f6 apex: dedup jni_libs when generating apex_manifest
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
2020-08-28 16:33:16 +09:00
Colin Cross
42507337e5 Only request image and version variations for device SDK dependencies
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
2020-08-26 11:51:51 -07:00
Colin Cross
9e93b1bb12 Remove TestApexWithJniLibs_Errors
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
2020-08-21 16:18:11 -07:00
Treehugger Robot
68bfe074c6 Merge "Reland: Deduplicate APEX variants that would build identically" 2020-08-21 06:46:51 +00:00
Colin Cross
aede88c1c7 Reland: Deduplicate APEX variants that would build identically
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
2020-08-19 10:21:17 -07:00