Commit graph

42 commits

Author SHA1 Message Date
Paul Duffin
be455a29b5 Merge "Add deapexer support for apex_set" am: d137306c16 am: ada746ce26 am: 6a98d68960
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1665744

Change-Id: I17e1e7feb52eb2b162b94f4e31fa3fc777dd5bf0
2021-04-08 21:55:44 +00:00
Paul Duffin
f6a780846d Merge "Separate apex extraction from the ApexSet" am: b14f2f067c am: 4cb71138e7 am: 76e8cd50ef
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1665743

Change-Id: I07d2011f415c03c94da049f5f8080cf98ad5ee3f
2021-04-08 15:33:31 +00:00
Paul Duffin
0d96c39af6 Merge "Move deapexer related functionality to prebuiltCommon" am: 1cec110476 am: bc8b938e8e am: 1c8bf42eff
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1665742

Change-Id: Id22f68fc3b4e27fb871915ac89670773a3a4a07d
2021-04-08 14:17:52 +00:00
Paul Duffin
7e5a6b7cda Merge "Separate apex selection from apex.Prebuilt" am: 440b234081 am: 95898f3e8f am: af9ad5afc3
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1665741

Change-Id: Ic7363e51501bb5eab4b1117b3d6c1d6a89fc1246
2021-04-08 07:45:47 +00:00
Paul Duffin
8d8c7e2b11 Merge "Make prebuilt_apex report an error if no apex file is found" am: 846ce57a00 am: f63bae520d am: 05cf32909e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1665740

Change-Id: I15924354b468a05de3e14fec69017330647100ce
2021-04-08 07:45:36 +00:00
Paul Duffin
f58fd9aec1 Add deapexer support for apex_set
Bug: 181267622
Test: m droid
Change-Id: I630f9f2c33d037bf4a7011d2131a7d28f213ae8b
2021-04-07 20:39:13 +01:00
Paul Duffin
2470467d42 Separate apex extraction from the ApexSet
This follows the same pattern as is used by the prebuilt_apex in order
to make files encapsulated with a prebuilt .apex file available for use
by the rest of the build. It separates the extraction of the
appropriate apex from the zip supplied to apex_set into a separate
module type whose output is used by the apex_set and will (in a follow
up change) be used by the deapexer module too.

Bug: 181267622
Test: m droid
Change-Id: Icd13ce1f21845494e875d3e092abd4a9d2efca57
2021-04-07 20:36:28 +01:00
Paul Duffin
dfd3326b65 Move deapexer related functionality to prebuiltCommon
Refactoring in preparation for adding deapexer support to apex_set.

Bug: 181267622
Test: m droid
Change-Id: I8e7661ff4cfbe68f62e14d3bdf20d9356934e351
2021-04-07 20:35:35 +01:00
Paul Duffin
79a8744fd1 Merge changes I45274836,I47268b81 am: de21202bd2 am: 6c9d9bd3b1 am: 73057c5172
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1665746

Change-Id: Ia624d9bc94179df6c7c9d27901901d7764d9f7c5
2021-04-07 11:04:50 +00:00
Paul Duffin
11216db1d3 Separate apex selection from apex.Prebuilt
This dedups the apex selection (which was previously being done by both
the apex.Prebuilt module type and the Deapexer module type) by
separating it out into its own module.

The apex.Prebuilt module retrieves the selected apex from its
selected_apex property which is simply initialized with
":<selector-module-name>".

The Deapexer module retrieves the selected apex it should use from its
src property which is initialized in the same way. That makes it easy
for the Deapexer module to be reused by the apex_set in a similar way.

Bug: 181267622
Test: m droid
Change-Id: I90cfb55698d35a97dcf28b95afcb1f58584bc90c
2021-04-07 10:11:10 +01:00
Paul Duffin
c0609c603c Make prebuilt_apex report an error if no apex file is found
Previously, if an appropriate src property was not specified it would
return "" which resolves to the top level directory. This change causes
it to report an error.

Bug: 181267622
Test: m droid
Change-Id: Ia5be324a0eff18e43b352d71c6768c8767986053
2021-04-07 10:07:37 +01:00
Paul Duffin
864116ce3f Add PrebuiltNameFromSource
Bug: 177892522
Test: m nothing
Change-Id: I45274836d59adbd6b2a2a848705b189398f1e766
2021-04-06 21:20:58 +01:00
Paul Duffin
0b0921a808 Merge "Remove deapexer and prebuilt apex select mutators" am: 4b786d2da1 am: 0630dacc0c am: 9d697b3d94
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1610795

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I4670d011f304c943cc6156312b0154e9236ca08f
2021-03-03 00:23:03 +00:00
Paul Duffin
c04fb9e6a2 Remove deapexer and prebuilt apex select mutators
Originally, when the prebuilt_apex was first created, it selected the
source to use in its DepsMutator. It did that because that was a
convenient place for it to perform that work which had to be:
* After the arch mutator had run so MultiTargets() was available.
* Before the prebuilt_select mutator runs as that relied on the Source
  property to have been set.

Change 064b70c9 then duplicated the call from the DepsMutator of the
deapexer module type that was added as part of the work to make dex
files available for hiddenapi processing.

Change 356f7d45 moved it out of the the DepsMutator methods into its
their own mutators, presumably because it interfered with the
Soong -> Bazel conversion work.

This change improves the existing PrebuiltSrcsSupplier mechanism to
support reporting errors so that the logic for selecting the source can
be done on demand rather than in separate mutators.

The main complication was that PrebuiltSrcsSupplier is called with a
BaseModuleContext for both source and prebuilt modules so it cannot use
any methods on it that are related to the current module. That
necessitated adding MultiTargets() to android.Module.

Bug: 181267622
Test: m droid
Change-Id: I106c78fd21016f051a315b82b470d8f12b1f820b
2021-03-01 17:11:25 +00:00
Colin Cross
aa2555387d Add ctx to AndroidMkExtraEntriesFunc
Add a ctx parameter to AndroidMkExtraEntriesFunc to allow them to
access providers.

Test: m checkbuild
Change-Id: Id6becc1e425c3c3d8519248f8c0ce80777fac7cc
Merged-In: Id6becc1e425c3c3d8519248f8c0ce80777fac7cc
2021-02-19 23:05:40 +00:00
Colin Cross
f79fee864c Add ctx to AndroidMkExtraEntriesFunc
Add a ctx parameter to AndroidMkExtraEntriesFunc to allow them to
access providers.

Bug: 180540739
Test: m checkbuild
Change-Id: Id6becc1e425c3c3d8519248f8c0ce80777fac7cc
2021-02-17 15:24:43 -08:00
Paul Duffin
0257302bd2 Merge "Exclude exported_java_libs dependencies from visibility checks" am: 1a75902832 am: d3cbf8531a am: 7d83aa8d86
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1580146

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I1696046270d964b472acffd728f00397c96f99d2
2021-02-08 19:22:10 +00:00
Paul Duffin
a7139425bc Exclude exported_java_libs dependencies from visibility checks
Test: m nothing
Change-Id: Iba45580c0711d48034898e9d42832c7e2b0e6284
2021-02-08 13:13:02 +00:00
Liz Kammer
73f2874a87 Merge "bp2build: convert paths/module refs to Bazel label" am: b7eab01167 am: 6d5454d0f9 am: 595abf120a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1564272

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I51fd926cdae810906a75ed132dc70fa2f2c74240
2021-02-05 15:40:11 +00:00
Liz Kammer
356f7d45c1 bp2build: convert paths/module refs to Bazel label
This currently expands all globs, still need to support converting glob
syntax.

Test: go build_conversion_test
Test: GENERATE_BAZEL_FILES=true m nothing
Test: m nothing
Bug: 165114590
Change-Id: If7b26e8e663d17566fad9614ca87a8da1f095284
2021-02-04 13:45:56 -05:00
Paul Duffin
d8733e056d Merge "Export dex implementation jars from prebuilt_apex" am: fe6147eb26 am: c022da2b2a am: bf4b8488e9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1523984

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I1ec430725444022e43e9532964fdf4134031158c
2021-01-19 16:43:57 +00:00
Paul Duffin
064b70c918 Export dex implementation jars from prebuilt_apex
Dexpreopt and boot jars package check all require access to dex
implementation jars created for java_library and java_sdk_library. They
were available when building from source but not when building from
prebuilts, even though they are embedded within the .apex files that
are referenced from prebuilt_apex.

This changes adds support to prebuilt_apex to export the dex
implementation jars and updates java_import to use those exported dex
implementation jars.

In a source build dexpreopt/boot jars package check access the apex (or
platform) specific variant of a java_library, e.g. core-oj, from which
it retrieves the dex implementation jar path.

After this change in a prebuilt build dexpreopt/boot jars package check
behave in the same way except in this case they retrieve the dex
implementation jar path from the apex (or platform) specific variant of
the java_import, e.g. core-oj.

The work to export files from a `.apex` file for use by other modules
is performed by a new `deapexer` module type. It is not used directly
in an `Android.bp` file but instead is created implicitly by
`prebuilt_apex`,

In order to do that this contains the following changes:
* Adds a new `dexapexer` module type to handle the exporting of files
  from the `.apex` file.
* Adds an exported_java_libs property to prebuilt_apex to specify the
  set of libraries whose dex implementation jars need exporting.
* Creates apex specific variants of the libraries listed in the
  exported_java_libs property.
* Adds the set of exported files to the ApexInfo to make them available
  to the apex specific variants.
* Prevents the prebuilt_apex variants from being merged together as
  they will not be compatible.
* Modifies java_import to use the exported file for variants of a
  prebuilt_apex.
* Adds a ninja rule to unpack (using deapexer) the contents of the
  prebuilt_apex's apex file, verify that the required files are present
  and make them available as outputs for other rules to use.
* Some minor refactorings to support these changes.
* Adds tests to cover prebuilt only, prebuilt with source preferred,
  and prebuilt preferred with source.

Test: m nothing
Bug: 171061220
Change-Id: Ic9bed81fb65b92f0d59f64c0bce168a9ed44cfac
2021-01-15 18:14:10 +00:00
Paul Duffin
a412e4c725 Merge "Extract ApexFileProperties from apex PrebuiltProperties" am: 4746ae400c am: 191af7042f am: 2997dd8a45
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1549977

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I845449212f93f5f7f2b16de6d74c1e6fb2baad2c
2021-01-15 13:54:50 +00:00
Paul Duffin
851f3995bc Extract ApexFileProperties from apex PrebuiltProperties
The properties and logic to select the appropriate arch specific src
property will need to be shared between the 'prebuilt_apex' module type
and an upcoming 'deapexer' module type to which the `prebuilt_apex`
will delegate responsibility for exporting the '.apex' file's contents.
This refactoring extracts them into the new ApexFileProperties struct
for reuse.

Bug: 171061220
Test: m nothing
Change-Id: Iac321a28afc469e885ee5b19ad33fecd94117236
2021-01-13 23:22:13 +00:00
Colin Cross
088fc71a70 Merge changes from topic "sbox_tools" am: 97a1be6e7b am: 62bc8d2316 am: cc288ca3f4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1531944

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Icc640676d59a71e70fec6124fd8a4af42bd1be26
2020-12-17 23:30:16 +00: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
Evgenii Stepanov
bd587f5285 Merge "Support asan/hwasan versions of prebuilts." am: 00e07c9779 am: 2cd36f0b0a am: 77436ca9fe am: 4fd6798169
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1371811

Change-Id: Ie8f1dd5998ef02b19f27249101caa1ff1a223074
2020-10-13 19:17:00 +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
Dan Albert
40e6162788 Merge changes from topics "soong-apilevel", "soong-config-apilevel" am: 8bd5095362 am: 587f425a1b am: eee05b3d29 am: 2be28db3af am: f6805df843
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1388352

Change-Id: I2e1c94c83f5ca7df45534027651075e9b4b39e95
2020-09-25 06:01:02 +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
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
Treehugger Robot
2e5bd33847 Merge "apex_set is force disabled when necessary" am: f70ceecc4c am: 005a5724ca am: 615d01cae9 am: bd13ffdc35 am: d392ec8d1c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1364697

Change-Id: I190f13a8a4436c18a8197a065f192d376b77e7dc
2020-07-20 02:25:47 +00:00
Treehugger Robot
615d01cae9 Merge "apex_set is force disabled when necessary" am: f70ceecc4c am: 005a5724ca
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1364697

Change-Id: Iee2b6e2c90304339df052806ea5e727ba7fffdab
2020-07-20 01:50:32 +00:00
Jiyong Park
10e926bc8d apex_set is force disabled when necessary
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
2020-07-17 12:37:16 +09:00
Jooyung Han
2963716220 DO NOT MERGE apex: install flattened from apex_set
apex_set is a set of prebuilt apex files. To support GSI which installs
both flattened and unflattened APEXes when apex_set is used, we extract
the contents from the selected APEX file.

Bug: 159711661
Test: TARGET_PRODUCT=gsi_gms_arm64 m
      should install flattened apexes in /system/system_ext/apex
Change-Id: I0a51b9f4a4537d3230aaa3eece532664ea18bc7c
2020-06-30 12:13:28 +00:00
Jiyong Park
8d6286befe apex_sets is added to apexkeys.txt
apex_sets is a new module type that can be used to deliver pre-signed
APEXes, which previously could be done only via prebuilt_apex.

Soon gnow understands apex_sets module types and emits the signing info
of the modules to apexkeys.txt

Exempt-From-Owner-Approval: cherry-pic from AOSP

Bug: 158729168
Test: m
Merged-In: I9507375342ec053309660d94c931a79bf4f21218
(cherry picked from commit 8d6c51ebcc)
Change-Id: I9507375342ec053309660d94c931a79bf4f21218
2020-06-17 13:17:11 +09:00
Jiyong Park
8d6c51ebcc apex_sets is added to apexkeys.txt
apex_sets is a new module type that can be used to deliver pre-signed
APEXes, which previously could be done only via prebuilt_apex.

Soon gnow understands apex_sets module types and emits the signing info
of the modules to apexkeys.txt

Bug: 158729168
Test: m
Change-Id: I9507375342ec053309660d94c931a79bf4f21218
2020-06-13 01:24:51 +09:00
Jaewoong Jung
8cf307e754 Add apex_set module.
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
2020-05-16 00:37:36 +00:00
Jaewoong Jung
fa00c06187 Add apex_set module.
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
2020-05-15 11:02:01 -07:00
Jooyung Han
002ab687ac Add compat symlinks for prebuilt_apex
When prebuilt_apex overrides/replaces other apex, the same symlinks need
to be created as well.

Bug: 143192278
Test: 1. add prebuilt_apex with vndk apex
         with overrides set as ["com.android.vndk.current"]
      2. m <prebuilt apex>
      3. check if vndk symlinks are created

Change-Id: I8ee9c981ea9c7202ccf5143b3f43e6848773cd63
2020-01-08 01:57:58 +09:00
Jiyong Park
0b0e1b9804 AndroidMkEntries() returns multiple AndroidMkEntries structs
AndroidMkEntries now returns multiple AndroidMkEntires so that a module
can emit multiple Make modules if needed.

Bug: 128708192
Test: m

Change-Id: I56b6f76d22943b80329951c5acb80a1b932441ad
2019-12-11 17:25:27 +09:00
Jiyong Park
09d77522fe split apex.go
apex.go is too big. Separate the build rule and android.mk generation
logic into builder.go and androidmk.go, respectively. prebuilt_apex is
moved to prebuilt.go as well.

No refactoring has been made other than the splitting.

Test: m
Change-Id: I839ab0a1ba2b70ce82d98ac1fa8e3534808b5fd3
2019-11-18 16:37:06 +09:00