Commit graph

963 commits

Author SHA1 Message Date
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
Jooyung Han
59d0931de7 Remove libbinder_headers from apex_available allowlist
libbinder_headers now sets apex_available property.

Bug: 150999716
Test: m
Change-Id: If58cfeafcc13fc36be8e44a66f2f472460fd4c8d
2021-02-05 15:32:40 +09: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
fff9e13ed8 Merge "Add boot_images to apex" am: 4a838dfb3f am: 4849ec99b9 am: 4694cf7c81
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1560278

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I59b4310efac004352f572252b78d68155f7d78e9
2021-02-01 11:39:07 +00:00
Paul Duffin
a1d6025a49 Add boot_images to apex
Previously, the apex module had to hard code behavior specific to the
art apex module in order to include the art boot image. This change
adds support to the apex module to allow the boot images to be
specified per apex.

In combination with a change to add the "art-boot-image" to the ART
apex this allows the custom code for handling the art boot image in
apex to be removed.

That custom apex code also included the logic to ensure that the
GlobalSoongConfig was initialized for use by the dex_bootjars
singleton. That logic has been moved from the APEX to the boot_image
module. That ensures that it will be run if and only if a boot_image
module is present in the checked out repos. So, limited manifest
checkouts which do not contain the art or frameworks/base repos (which
is where the boot_image modules are defined) will not attempt to run
this logic, which would fail because dex2oat would not be present.

Bug: 177892522
Test: m droid
Change-Id: I02d25fbef6e864e31eb5e0f4eb50358c79486db0
2021-01-30 12:45:07 +00:00
Treehugger Robot
5d1f775735 Merge "apex: checks min_sdk_version for preview/current" am: 99afe0d442 am: 3f4cc86f15 am: 2ebe689bbf
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1557545

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I24256763c59562e7f878ff86dd637803ad081168
2021-01-28 14:57:42 +00:00
Jooyung Han
ed124c308f apex: checks min_sdk_version for preview/current
If we don't check "current", it won't be checked even in the finalized
branch.

If we don't check "preview", it should be done during the SDK
finalization. It'd be better done before the SDK finalization regarding
that setting min_sdk_version is to get approval from deps library owners.

Bug: 177833148
Test: m (soong tests)
Change-Id: I712b61cfe5a134fbb69c73956d26fb3a1e5c011e
2021-01-26 12:09:07 +09:00
Sophie Zheng
a215165b60 Merge "Revert "Revert "Automated NDK API coverage used by Mainline modules build integration.""" am: 9b6596bb60 am: 5bcc9fb821 am: 46695305ca
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1559535

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I19d806d4ca140ba00f81eb241d699cbd10476c2a
2021-01-26 01:08:24 +00:00
Sophie Zheng
9b6596bb60 Merge "Revert "Revert "Automated NDK API coverage used by Mainline modules build integration.""" 2021-01-26 00:13:46 +00:00
sophiez
6bde0b5f9d Revert "Revert "Automated NDK API coverage used by Mainline modules build integration.""
This reverts commit 556b2ad77e.

Original change-id: Ib1b2f0dd2f9ae85b1545c6cc5bb4c5bbdfac1c15

Reason for revert: Add excutable permission to the gen_ndk_backedby_apex.sh.

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

Change-Id: Ib587ba200cd7f2f61d478452b43c329d72b2de06
2021-01-25 19:52:10 +00:00
Riddle Hsu
0a62836abc Merge "Revert "Automated NDK API coverage used by Mainline modules build integration."" am: f17b07fc52 am: d86a495903 am: aa902a2769
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1556729

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Icc6cb8cdaabba12b61b8ac09465ae66718652f2b
2021-01-25 07:13:33 +00:00
Riddle Hsu
f17b07fc52 Merge "Revert "Automated NDK API coverage used by Mainline modules build integration."" 2021-01-25 06:15:29 +00:00
Riddle Hsu
556b2ad77e Revert "Automated NDK API coverage used by Mainline modules build integration."
This reverts commit 87ff51db84.

Reason for revert: build breakage b/178327796

Change-Id: I51c56938540794097eda579ebe47fa5c0a4d8c12
2021-01-25 01:44:34 +00:00
Sophie Zheng
a37e55d9ae Merge "Automated NDK API coverage used by Mainline modules build integration." am: 0bf77198b5 am: 5eb2508018 am: e261b61f78
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1544728

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I73c5ad9efd0124153d583a84be2c47101fef24b0
2021-01-23 00:45:01 +00:00
Sophie Zheng
0bf77198b5 Merge "Automated NDK API coverage used by Mainline modules build integration." 2021-01-22 22:15:21 +00:00
sophiez
87ff51db84 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

Change-Id: Ib1b2f0dd2f9ae85b1545c6cc5bb4c5bbdfac1c15
2021-01-21 18:08:50 +00:00
Treehugger Robot
0d8aa8738d Merge "LOCAL_REQUIRED_MODULES from apex has ":32" or ":64" suffix" am: d684e04247 am: 8cad077197 am: 67c3e24f07
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1554988

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I4141d6a90656048ee7230d3fd2078c5a4f9d5c18
2021-01-21 16:36:03 +00:00
Treehugger Robot
d684e04247 Merge "LOCAL_REQUIRED_MODULES from apex has ":32" or ":64" suffix" 2021-01-21 14:34:37 +00:00
Ulyana Trafimovich
1a2949251b Merge "Support building boot images with disabled dexpreopt." am: 0caabb6e27 am: 5602cf202b am: fb9314da42
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1555134

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I5c35fc8382ab51307e4cb5e4a0b8b2d4c5553f8b
2021-01-20 19:46:47 +00:00
Bill Peckham
dccab29858 Merge changes from topic "prebuilt-hiddenapi" am: 1c8e5e817e am: 24ac16d6e6 am: 96ddf7f0b3
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1546365

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I626d7b1481b000c75a949522b91db36fc2fe213a
2021-01-20 19:46:31 +00:00
Ulyana Trafimovich
0caabb6e27 Merge "Support building boot images with disabled dexpreopt." 2021-01-20 17:46:02 +00:00
Bill Peckham
1c8e5e817e Merge changes from topic "prebuilt-hiddenapi"
* changes:
  Supply LOCAL_SOONG_DEX_JAR for java_import with compile_dex.
  Enable an apex to include a java_import.
  Enable prebuilt hiddenapi CSV files.
2021-01-20 17:43:48 +00:00
Ulya Trafimovich
a4a1c4ee98 Support building boot images with disabled dexpreopt.
Bug: 176171716
Test: build_mainline_modules.sh and ensure that the ART boot image is
    built: `find out -type f -name '*.art'` is nonempty for every arch.
Change-Id: Ibc45581eef2b205c750a30709780cf659ba7cfa1
2021-01-20 14:03:07 +00:00
Jiyong Park
57621b29c4 LOCAL_REQUIRED_MODULES from apex has ":32" or ":64" suffix
Currently, when a module is included in an APEX, the dependencies of the
modules are listed in LOCAL_REQUIRED_MODULES of the APEX. There are two
purposes for this:

1) for native dependencies, they are installed to
$(TARGET_OUT)/apex/<apexname> directories which isn't packaged as an
*.img. However, as a side effect of the installation, their symbol files
are placed under $(TARGET_OUT)/symbols directory to aid debugging.

2) to implement the symlink optimization. When the APEX is not
updatable, the dependencies are not included inside the APEX, but
installed directly to /system partition because the same files might be
used outside of the APEX. The files in the APEX are replaced with
symlinks to the system copy.

So far, the module name like "libfoo" was directly used in
LOCAL_REQUIRED_MODULES. This becomes problematic when only a single arch
variant of the module is used by the APEX. The build system will install
both arch variants to the system partition.

This change fixes the problem by appending ":32" or ":64" suffix
when composing LOCAL_REQUIRED_MODULES.

Bug: N/A
Test: m
Test: Cherry-pick I285c5d1bb9b27265c8589f2588d95eafa324d412 and its
dependencies from internal master. `m nothing` doesn't show the artifact
path requirement error.

Change-Id: I78feae1d5b18f93b0f984d3b1558812fd1689a96
2021-01-20 20:44:35 +09:00
Ryan Prichard
6761a5eeae Merge "Switch platform EH unwinder to prebuilt LLVM libunwind" am: 809eac3057 am: 048809c624 am: 471dfd6809
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1551580

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I93276241d217b7d2ebdffa58abb60d2d0721c672
2021-01-20 02:15:55 +00:00
Ryan Prichard
809eac3057 Merge "Switch platform EH unwinder to prebuilt LLVM libunwind" 2021-01-20 00:10:59 +00:00
Bill Peckham
a41a6963b4 Enable an apex to include a java_import.
With the addition of the compile_dex property to the
java_import module it becomes possible to include a
java_import module in an apex. This change allows the
dependency and adds a test.

Bug: 177228901
Test: m nothing
Test: new TestApexWithJavaImport
Change-Id: I9336dade1857109e2fd21f7d57e1dc4abc4a402c
2021-01-19 18:15:03 +00: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
Ryan Prichard
b35a85ee8b Switch platform EH unwinder to prebuilt LLVM libunwind
For the platform libc++ STL, remove the
-Wl,--exclude-libs,libunwind_llvm.a argument, which is redundant with
the same argument in deviceGlobalLdflags.

Bug: http://b/153025717
Test: device boots
Change-Id: Idd7791d52f74aab2d5f59419fb75f841fc29a2eb
2021-01-13 19:51:06 -08:00
Mohammad Islam
d96cbba6fe Merge "Add property to apex soong modules to forcefully compress an APEX" am: fdb9e89642 am: d09fa7b142 am: 6e7da957a3
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1535000

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I5f88bdbddc116b4e536bbca18c80054cdf0ca387
2021-01-12 15:14:35 +00:00
Mohammad Islam
fdb9e89642 Merge "Add property to apex soong modules to forcefully compress an APEX" 2021-01-12 13:51:50 +00:00
Treehugger Robot
d1dae886d7 Merge "android_filesystem modules can be included in APEX" am: 1985115ff1 am: 1b6e06fb44 am: cb62efdca9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1540668

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I25e79f8524ac12e218f1bf2289fd10f89b79068a
2021-01-08 01:27:28 +00:00
Jiyong Park
12a719c0fc android_filesystem modules can be included in APEX
android_filesystem modules can be included in APEX via the new
`filesystems` property. The filesystem images are placed at
./etc/fs/<modulename>.img.

Bug: 172413888
Test: m nothing

Change-Id: I215ca7a32ff1988a0de4e1f71397684e189839ea
2021-01-07 15:35:25 +09:00
Treehugger Robot
389e892e41 Merge "Add TARGET_FORCE_APEX_SYMLINK_OPTIMIZATION" am: 0d96ed8d5b am: 0ff3ac38cb am: ee12c19685
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1540045

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I739f2cea0952f17e3eba175578164ab0e3e4b866
2021-01-06 05:08:52 +00:00
Jiyong Park
4da079732d Add TARGET_FORCE_APEX_SYMLINK_OPTIMIZATION
The APEX symlink optimization is a build-time trick to save the
storage/RAM usage of APEX by replacing some files in APEX with symlinks
to the files in the system partition. The optimization however is
automatically turned off for 'updatable: true' APEXes because doing the
optimization for them will hide the sys-health implication until when
the APEXes are built unbundled (i.e. prebuilt) and thus the
optimization is impossible.

TARGET_FORCE_APEX_SYMLINK_OPTIMIZATION forcibly disables the safety net.
When it is set to true, the symlink optimization is done regardless of
the 'updatable' property. This is useful for some of the devices like Go
where most APEXes (even the 'updatable: true' ones) should be
effectively non-updatable.

Bug: 175630508
Test: TARGET_FORCE_APEX_SYMLINK_OPTIMIZATION=true m and check that
updatable APEXes have symlinks to system libs

Change-Id: I26f72e5d5ebccc2d1e09c2a2f743db14937eb39a
2021-01-05 21:01:11 +09:00
TreeHugger Robot
5f57688498 Merge "Remove libstagefright_bufferqueue_help from apex.go" 2020-12-23 03:15:23 +00:00
Jaewoong Jung
18aefc1977 Remove unnecessary snake case variables.
Test: m nothing + TreeHugger
Change-Id: I99f7162944daa6c57c6ae4763261e108bb5cb6b1
2020-12-22 12:38:35 -08:00
Mohammad Samiul Islam
a8008f9595 Add property to apex soong modules to forcefully compress an APEX
This makes creating compressed APEX artifacts for testing simpler.

Bug: 172911820
Test: atest apex_compression_platform_tests
Change-Id: I77b8bea4662c273420e7b37d5fde181b86c9cb78
2020-12-22 10:47:50 +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
Treehugger Robot
f1c48afc31 Merge "arch specific dependencies are supported for apex" 2020-12-17 00:15:26 +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
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
Chong Zhang
6d6b7094ee Remove libstagefright_bufferqueue_help from apex.go
Change-Id: I8e6fc6de6288ab1054658dea3b3c7caae0274fbd
bug: 166468760
test: build
2020-12-11 22:20:07 +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
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
Jiyong Park
b555609098 Merge "rust ffi libraries can be included in APEX" 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
Steven Moreland
35989ae98b Merge "target.apex.exclude_[shared|static]_libs to cc_* modules" 2020-12-10 19:02:02 +00: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
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
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
d348c41af5 Merge "Don't use module names with "prebuilt_" prefixes in make dependencies." 2020-12-04 06:23:51 +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
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
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
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
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
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
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
ed5dee0a8f Merge "Add llndk_stubs property" 2020-10-23 18:09:42 +00: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
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
Martin Stjernholm
3b8ca4c317 Remove stale apex_available dependency.
Test: m
Bug: 142944931
Change-Id: I9c69ef64eb9eecd45f6272a1d79bf77ee910815c
2020-09-30 17:40:17 +01: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
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
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
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
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
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
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
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
Pete Bentley
0c7b26e0e2 Revert "Deduplicate APEX variants that would build identically"
This reverts commit d6b2525b00.

Reason for revert: <Breaks tests - confirmed by Forrest: b/165188843>

Change-Id: I7cb68cb87522415004390c0672dc774e0067b122
2020-08-18 13:44:59 +00:00
Colin Cross
d6b2525b00 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.

Bug: 164216768
Test: go test ./build/soong/apex/...
Change-Id: I0529837476a253c32b3dfb98dcccf107427c742c
2020-08-17 15:18:31 -07:00
Treehugger Robot
a07777d434 Merge "Rename ApexName to ApexVariationName" 2020-08-15 06:43:52 +00:00
Colin Cross
e07f2316b7 Rename ApexName to ApexVariationName
In preparation for reusing the same variation for multiple apexes,
rename ApexName to ApexVariationName.

Bug: 164216768
Test: all soong tests
Change-Id: I88f2c5b192ffa27acd38e01952d0cefd413222a0
2020-08-13 17:50:29 -07:00
Jeongik Cha
839fc6659c Update ApexAvailableBaseline
Remove ipmemorystore-aidl-interfaces-java in allowlist for
com.android.tethering

Bug: 146436251
Test: m nothing
Change-Id: I8b7f97d59c2fd191f467ad50a8fd66d9a5d37704
2020-08-11 13:07:18 +09:00
Jooyung Han
b0c4d3b319 Merge "apex: set ":vndk" as required for vendor apexes" 2020-07-30 00:00:44 +00:00
Paul Duffin
f91079f120 Merge "Avoid creating APEX variant for sdk member" 2020-07-29 11:33:12 +00:00
Jooyung Han
6c4cc9ce23 apex: set ":vndk" as required for vendor apexes
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
2020-07-29 16:00:54 +09:00
Treehugger Robot
4514d96e18 Merge "Add apex.use_vndk_as_stable property" 2020-07-29 01:27:46 +00:00
Jooyung Han
df78e216a8 Add apex.use_vndk_as_stable property
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
2020-07-27 11:36:52 +09:00
Yo Chiang
e812805e75 Use BaseModuleName() + SubName as apexFile.moduleName
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
2020-07-24 20:05:20 +08:00
Treehugger Robot
13aa44fc15 Merge "Build transitive lint reports for apex modules" 2020-07-24 11:50:39 +00:00
Paul Duffin
a37eca27c8 Avoid creating APEX variant for sdk member
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
2020-07-24 11:10:10 +01:00
Jooyung Han
698dd9f007 apexDepsMutator uses WalkDeps
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
2020-07-23 13:54:50 +09:00
Colin Cross
08dca38eb0 Build transitive lint reports for apex modules
Build and export transitive lint report zips for apex modules.

Bug: 153485543
Test: m TARGET_BUILD_APPS=com.google.android.wifi lint-check dist
Change-Id: I5a1805440452301a7e2c4ca91482b989638b54fb
2020-07-22 20:16:14 -07:00
Christopher Parsons
fef9d4b601 Merge "Install data_libs using relative_install_path property" 2020-07-21 17:26:57 +00:00
Chris Parsons
216e10a0f6 Install data_libs using relative_install_path property
Test: Added to data_libs tests
Test: Manually verified with bionic-unit-tests
Test: Treehugger
Change-Id: I28a8e08e3409f1e7c7bb72f4351310b57f35f513
2020-07-20 13:59:24 -04: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
Treehugger Robot
0f472e62f9 Merge changes Iefcf4fbe,I450d4769,I1ffc7e7b am: 2c79c871d9 am: 3757864b5f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1354643

Change-Id: I35b96bffc99f9066982e6ea99332fb84c8f7a840
2020-07-09 12:56:24 +00:00
Martin Stjernholm
58c33f073d Do not follow prebuiltDependencyTags in APEX payload walks.
If prebuilts are active they will have the other direct dependencies
from the source modules.

Bug: 151303681
Test: m nothing
Test: `m` with prebuilts/runtime in the manifest (along with other
  fixes)
Change-Id: I1ffc7e7b528ed9db5ce6ca2ee96c9d23c6548c49
2020-07-07 18:12:41 +01:00
Treehugger Robot
08c3d0cf7f Merge changes Ifd2858dd,I2585dd99,I65e7a456 am: 0c6f111d7b am: d6b1515935
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1348951

Change-Id: Idcc16a40f953019278ea34829ca297a353da0820
2020-06-29 02:47:14 +00:00
Treehugger Robot
0c6f111d7b Merge changes Ifd2858dd,I2585dd99,I65e7a456
* changes:
  apex: use SubName for requiredDeps
  apex: support "vendor: true"
  apex: AndroidMk writes common properties
2020-06-29 02:20:56 +00:00
Martin Stjernholm
59c19b3585 Merge "Disable flattening only for unbundled apps." am: c4fe0dd3cc am: a77dc06b2b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1348984

Change-Id: If1a7768da1c1b652ec89acca4e948cc76bcb064e
2020-06-25 14:21:22 +00:00
Martin Stjernholm
c4fe0dd3cc Merge "Disable flattening only for unbundled apps." 2020-06-25 13:49:30 +00:00
Jooyung Han
efb184e499 apex: use SubName for requiredDeps
apexBundle keeps the required dependencies for native modules which are
external dependencies and then records it in .mk file as
LOCAL_REQUIRED_MODULES key.

LOCAL_REQUIRED_MODULES should list module name which are made of
cc.BaseModuleName() + SubName.

By the way, because a use_vendor:true apex is supposed to be installed
in /system/apex, we don't append SubName(.vendor) suffix.

Bug: 159211312
Bug: 155841765
Test: m
Change-Id: Ifd2858dda0b373110a0cd18a0c55db41f0fc2a99
2020-06-25 17:14:25 +09:00
Jooyung Han
7b5284bf33 Merge "apex: add apex_manifest.pb in file_contexts" am: dd85fd89b0 am: 5b811c02e2
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1348942

Change-Id: I558889c69e09e79455b75c4399826fcaab9101fc
2020-06-25 06:54:28 +00:00
Jooyung Han
85d61767b5 apex: support "vendor: true"
When an apex sets "vendor: true", it becomes a vendor apex.

Vendor apexes use vendor variants for native modules and are
installed in /vendor/apex.

Bug: 159211312
Test: m
Change-Id: I2585dd990ba857a2ab3ec6ab24e09d4652e867f2
2020-06-25 15:37:47 +09:00
Jooyung Han
dd85fd89b0 Merge "apex: add apex_manifest.pb in file_contexts" 2020-06-25 06:21:40 +00:00
Jooyung Han
14135e4c26 Merge "apex/apk: enforce min_sdk_version of all deps" am: 14a08f5b28 am: afdc5239b8
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1287253

Change-Id: I63074e39f5f319789920e55802d4f7934b556e0a
2020-06-25 01:47:24 +00:00
Jooyung Han
14a08f5b28 Merge "apex/apk: enforce min_sdk_version of all deps" 2020-06-25 01:18:52 +00:00
Martin Stjernholm
56507b4e0d Disable flattening only for unbundled apps.
This allows the unbundled master-art branch to still use flattened
APEXes in its test builds.

Bug: 159109002
Test: art/build/apex/runtests.sh on master-art
Test: m nothing
Change-Id: I768c6b7f5afbc348cd7730e4ba96507678434778
2020-06-24 22:33:44 +01:00
Jooyung Han
580eb4fe38 apex: add apex_manifest.pb in file_contexts
apex_manifest.pb is added to payload.img by the build system and is
supposed to be read by apexd during activation.

So, it should be labeled as "system_file" so that apexd can read it
regardless of how file_contexts is defined.

Bug: 159767275
Test: add an apex with file_contexts with everything as vendor_file
      apexd should activate the apex.
Change-Id: Ie34eb7ad905828976152d67a7dfabf0add0a5de4
2020-06-24 23:00:32 +09:00
Christopher Ferris
45ba96ad76 Merge "Remove libc_scudo references." am: a5d1fab176 am: f25abb1d01
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1326235

Change-Id: Ic6392dfe26e181d1cb12d2ceaee388ef268eeee3
2020-06-24 03:44:12 +00:00
Christopher Ferris
a5d1fab176 Merge "Remove libc_scudo references." 2020-06-24 03:16:48 +00:00
Jooyung Han
749dc69af1 apex/apk: enforce min_sdk_version of all deps
Enforce min_sdk_version for every payload dependency of updatable
APEX/APKs.

android.CheckMinSdkVersion() calls ApexModule.ShouldSupportSdkVersion
for every transitive dependency from APEX/APK modules to see if it
meets the min_sdk_version requirements.

The common implementation for apex/android_app is provided in
android/apex.go.

Bug: 145796956
Bug: 152655956
Bug: 153333044
Test: m nothing
Change-Id: I4a947dc94026df7cebd552b6e8ccdb4cc1f67170
2020-06-24 02:00:33 +09:00
Colin Cross
92285368e2 Merge "Make native_coverage clause work with ClangCoverage" am: c9ef6ee1b7 am: e1dd7bf4ec
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1340832

Change-Id: I02b9d4f8fea3facdd4c41d633d49bd2006718fe5
2020-06-23 03:37:05 +00:00
Colin Cross
c9ef6ee1b7 Merge "Make native_coverage clause work with ClangCoverage" 2020-06-23 03:06:53 +00:00
Christopher Ferris
f70926eef0 Remove libc_scudo references.
Test: Builds and boots.
Change-Id: Iad97159e6193f7afffd8fbc9456427eee5d150e3
Merged-In: Iad97159e6193f7afffd8fbc9456427eee5d150e3
(cherry picked from commit 1f16b27511)
2020-06-22 15:27:56 -07:00
Colin Cross
1a6acd4f39 Make native_coverage clause work with ClangCoverage
Make uses NATIVE_COVERAGE to enable gcov coverage and CLANG_COVERAGE
to enable clang coverage.  NATIVE_COVERAGE is translated to the Soong
Native_coverage product variable which triggers the native_coverage
clause in Android.bp files.  The clause also needs to be triggered
for CLANG_COVERAGE.

Rename the existing Native_coverage product variable to GcovCoverage,
and regenerate Native_coverage when either GcovCoverage or
ClangCoverage are set.

Also remove NativeLineCoverage, it wasn't doing anything differently
than Native_coverage.

Bug: 159059537
Test: m checkbuild
Change-Id: I215124a9b35a2ad50ad562079d392e3d33da11f4
2020-06-22 11:13:42 -07:00
TreeHugger Robot
966e995729 Merge "Enforce permitted_packages for Q+ and R+ modules" into rvc-dev am: d65089b4a4
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/11761419

Change-Id: I66510e2e3792623c77e0fea25d2043b963b1f951
2020-06-22 18:09:56 +00:00
TreeHugger Robot
d65089b4a4 Merge "Enforce permitted_packages for Q+ and R+ modules" into rvc-dev 2020-06-22 17:55:16 +00:00
Jooyung Han
b365f35fef Merge "apex: make allowed_files prop overridable" into rvc-dev am: d166f79278
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/11931025

Change-Id: I2600c560d596446af255b117abfc07dc1d1f1860
2020-06-22 17:20:52 +00:00
Jooyung Han
938b593887 apex: make allowed_files prop overridable
Because override_apex can modify the contents of the base apex,
allowed_files (which describes the contents) should be overridable.

Bug: 159503079
Bug: 159392784
Bug: 158169437
Test: m (soong test added)
Merged-In: I12744b0465dc3cfc90a66643867e65b4092cd0f7
Change-Id: I12744b0465dc3cfc90a66643867e65b4092cd0f7
(cherry picked from commit faa5399b3f)
2020-06-23 02:10:46 +09:00
Jooyung Han
d166f79278 Merge "apex: make allowed_files prop overridable" into rvc-dev 2020-06-22 17:05:58 +00:00
Paul Duffin
9ee66da850 Fix check-boot-jars when a boot jar is provided by prebuilt
Previously, when a boot jar was provided by a java_sdk_library_import
module the check-boot-jars check failed because the file it depended on
was not available. In an incremental build the build failed due to the
file in the out directory not having a rule to generate it.

That was because the module was named prebuilt_<module>.<apex> instead
of <module>.<apex>. This was fixed by simply removing prebuilt_ prefix
from the name if it was present.

After fixing that the check-boot-jars still did not work properly
because it was expecting a jar file containing .class files but instead
was given a jar file containing .dex files which meant the check did
not work properly.

This was fixed by defining a new ApexDependency interface for use by
the apex/apex.go code to use instead of java.Dependency for generating
the androidmk entries. The *SdkLibraryImport type then implemented
those, by delegating to the implementation library.

Bug: 158304459
Bug: 159112414
Test: m check-boot-jars
      m checkbuild
	  manual inspection of the .jar file used by check-boot-jars to
	  ensure it contained .class files and not .dex files.
Change-Id: I545c5c9072dd472337d2f9b4dfdf08f53c981662
Merged-In: I545c5c9072dd472337d2f9b4dfdf08f53c981662
2020-06-20 11:38:08 +01:00
Jooyung Han
faa5399b3f apex: make allowed_files prop overridable
Because override_apex can modify the contents of the base apex,
allowed_files (which describes the contents) should be overridable.

Bug: 159503079
Bug: 159392784
Bug: 158169437
Test: m (soong test added)
Change-Id: I12744b0465dc3cfc90a66643867e65b4092cd0f7
2020-06-20 12:56:49 +09:00
Andrei Onea
115e7e77d8 Enforce permitted_packages for Q+ and R+ modules
Q+ and R+ mainline modules may only add code in a restricted set of Java
package prefixes, that may never be changed.
If a mainline module owns the Java package prefix "foo.bar", it may have
classes in "foo.bar", "foo.bar.baz", "foo.bar.baz.bat" etc.

Test: m
Bug: 156725734
Change-Id: I30bf510ed473309871469bf439d7c81575450931
2020-06-18 16:57:39 +01:00
Anton Hansson
71f093e485 Merge "Fix check-boot-jars when a boot jar is provided by prebuilt" am: 0e63a8e761 am: ac2a42054f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1341756

Change-Id: Ife514f78e7aea0b8ed05f74c21d3ce95054796cc
2020-06-17 20:02:20 +00:00
Paul Duffin
44b481b81b Fix check-boot-jars when a boot jar is provided by prebuilt
Previously, when a boot jar was provided by a java_sdk_library_import
module the check-boot-jars check failed because the file it depended on
was not available. In an incremental build the build failed due to the
file in the out directory not having a rule to generate it.

That was because the module was named prebuilt_<module>.<apex> instead
of <module>.<apex>. This was fixed by simply removing prebuilt_ prefix
from the name if it was present.

After fixing that the check-boot-jars still did not work properly
because it was expecting a jar file containing .class files but instead
was given a jar file containing .dex files which meant the check did
not work properly.

This was fixed by defining a new ApexDependency interface for use by
the apex/apex.go code to use instead of java.Dependency for generating
the androidmk entries. The *SdkLibraryImport type then implemented
those, by delegating to the implementation library.

Bug: 158304459
Bug: 159112414
Test: m check-boot-jars
      m checkbuild
	  manual inspection of the .jar file used by check-boot-jars to
	  ensure it contained .class files and not .dex files.
Change-Id: I545c5c9072dd472337d2f9b4dfdf08f53c981662
2020-06-17 16:59:43 +01:00
Colin Cross
a2e64e7b84 Merge "Use inclusive language in Android.bp files" 2020-06-17 01:04:26 +00:00
Colin Cross
cbd62d07d4 Use inclusive language in Android.bp files
Test: m checkbuild
Change-Id: Id9efbd99be54b191193eae1c5672230ca54cf1d2
Merged-In: Id9efbd99be54b191193eae1c5672230ca54cf1d2
2020-06-16 23:36:51 +00:00
Anton Hansson
c3754ba042 Merge "Let APEX build against preferred java_sdk_library_import" into rvc-dev 2020-06-16 17:47:16 +00:00
Paul Duffin
98c5d09541 Merge "Let APEX build against preferred java_sdk_library_import" am: e40383355b am: 86be0eafca
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1331928

Change-Id: Ia4bb1dc336da459172dd74bedef7396085796dfc
2020-06-16 09:57:40 +00:00
Paul Duffin
f642a31ab5 Let APEX build against preferred java_sdk_library_import
If a java_sdk_library_import has a corresponding java_sdk_library then
make the java_sdk_library_import export both the xml and impl modules
created by the java_sdk_library.

Makes java_sdk_library_import consistent with java_sdk_library by
providing libraries within the same APEX access to the implementation
library instead of the stubs.

Bug: 158304459
Test: m nothing
      Test what happens when building com.android.tethering with and without
      a preferred "framework-tethering" java_sdk_library_import. Make sure that
      it does not change the generated APEX.
Merged-In: I2f4edea937ac377431a5696c92cbd467bded62ef
Change-Id: I2f4edea937ac377431a5696c92cbd467bded62ef
(cherry picked from commit eedc5d55ce)
2020-06-16 10:43:19 +01:00
Paul Duffin
e40383355b Merge "Let APEX build against preferred java_sdk_library_import" 2020-06-16 09:37:53 +00:00
Colin Cross
e8f7f90496 Merge changes from topics "soong-inclusive-language", "soong_inclusive_language2" into rvc-dev am: f4a5492ec9
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/11859399

Change-Id: I1b009faacad99fcbfbf6cd06193f033ea37f6040
2020-06-16 03:43:15 +00:00
Treehugger Robot
c41c1a9d13 Merge "Remove libnativehelper modules from whitelist" 2020-06-15 17:00:35 +00:00
Colin Cross
a44a6b27f9 Use inclusive language in Android.bp files
Bug: 158889297
Test: m checkbuild
Change-Id: Id9efbd99be54b191193eae1c5672230ca54cf1d2
2020-06-15 09:46:32 -07:00
Colin Cross
95f7b34e8e Use inclusive language in build/soong
Bug: 158889297
Test: m checkbuild
Change-Id: Id07890b7cbc2397291a658ca00e86b43c743aafc
Merged-In: Id07890b7cbc2397291a658ca00e86b43c743aafc
(cherry picked from commit 440e0d0542)
2020-06-15 09:46:31 -07:00
Paul Duffin
eedc5d55ce Let APEX build against preferred java_sdk_library_import
If a java_sdk_library_import has a corresponding java_sdk_library then
make the java_sdk_library_import export both the xml and impl modules
created by the java_sdk_library.

Makes java_sdk_library_import consistent with java_sdk_library by
providing libraries within the same APEX access to the implementation
library instead of the stubs.

Bug: 158304459
Test: m nothing
      Test what happens when building com.android.tethering with and without
      a preferred "framework-tethering" java_sdk_library_import. Make sure that
      it does not change the generated APEX.
Change-Id: I2f4edea937ac377431a5696c92cbd467bded62ef
2020-06-15 16:57:09 +01:00
TreeHugger Robot
4666f7ef3a Merge "Remove libnativehelper modules from whitelist" into rvc-dev-plus-aosp 2020-06-15 15:27:56 +00:00
Jooyung Han
e30c7b98bc Merge "VNDK APEX should not provide native libs" am: 552d4730c3 am: 6b67734812
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1335522

Change-Id: Ieaa981ee386de3a31f45a87e60819b25baf98883
2020-06-15 14:27:50 +00:00
Orion Hodson
01615f36f2 Remove libnativehelper modules from whitelist
Bug: 147364041
Test: m nothing
Change-Id: I6a43511fee3feeb164e07d5620eea0564fbee302
Merged-In: I6a43511fee3feeb164e07d5620eea0564fbee302
Exempt-From-Owner-Approval: cherry pick
(cherry picked from commit 7e2354434907257f37255052d9bd08c554e263eb)
2020-06-15 13:32:14 +00:00
Orion Hodson
494c63b20e Remove libnativehelper modules from whitelist
Bug: 147364041
Test: m nothing
Change-Id: I6a43511fee3feeb164e07d5620eea0564fbee302
Merged-In: I6a43511fee3feeb164e07d5620eea0564fbee302
Exempt-From-Owner-Approval: cherry pick
(cherry picked from commit ab67d8f9b4)
2020-06-15 13:25:59 +00:00
Jooyung Han
45a96778c1 VNDK APEX should not provide native libs
While libz has stubs for other mainline modules, it doesn't provide
stubs when it is used as a VNDK lib.

In general, VNDK libs are only for vendor modules. So, we skip them even
if they have stubs.

Bug: 155456180
Test: m com.android.vndk.current
      provideNativeLibs of the APEX should be empty
Change-Id: I22401a2b1732a8560802c5be850181682e183a8e
2020-06-15 15:14:12 +09:00
Colin Cross
973d6813cd manual merge of 2ef16cfcd4 to rvc-dev-plus-aosp
Test: I solemnly swear I tested this conflict resolution.
Bug: None
Change-Id: I768c3fe568fee764cb0b533e73a3fef719adf30c
2020-06-12 17:49:09 -07:00
Colin Cross
440e0d0542 Use inclusive language in build/soong
Test: m checkbuild
Change-Id: Id07890b7cbc2397291a658ca00e86b43c743aafc
2020-06-11 15:33:16 -07:00
Elliott Hughes
f48d50bfb7 Merge "Remove TARGET_PREFER_32_BIT support." am: a82ad479a4 am: 274a80c492
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1289612

Change-Id: I8862a464aa374922dadedd68e47d1705b8ce5836
2020-06-10 18:36:54 +00:00
Elliott Hughes
79ae341d4b Remove TARGET_PREFER_32_BIT support.
Bug: https://issuetracker.google.com/138812821
Test: builds
Change-Id: If96cccbd82ba1311165d61c947c928c6e7cd5593
2020-06-08 16:37:13 -07:00
Sasha Smundak
c4f0ff1d6c Cherrypick aosp/1318079 and aosp/1324841
Allow apex module to have android_app_set as its constituent.
Fix android_app_set documentation

Fixes: 157166068
Test: treehugger & manual
Change-Id: I9f91f1b761286f489d175eb0772f78f702e8a2d6
Merged-In: I9f91f1b761286f489d175eb0772f78f702e8a2d6
Merged-In: Id9b296d9301902deb463b299413491bc66d58944
2020-06-05 15:39:38 -07:00
Anton Hansson
d7fdfd6e77 Merge "dex_import can be added to apex" into rvc-dev 2020-06-05 10:05:50 +00:00
Anton Hansson
4ecb0d6bb0 Merge "Use Stem where output file name is expected in APEX" into rvc-dev 2020-06-05 10:05:50 +00:00
Treehugger Robot
dba1360d03 Merge "Allow apex module to have android_app_set as its constituent." am: a5c94e1409 am: 342b4810a7
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1318079

Change-Id: If27ef9b94e59620abcf2ef1179f51c2e5ca9b10f
2020-06-05 06:22:41 +00:00
Treehugger Robot
a5c94e1409 Merge "Allow apex module to have android_app_set as its constituent." 2020-06-05 05:52:51 +00:00
Sasha Smundak
18d98bc3e0 Allow apex module to have android_app_set as its constituent.
Fixes: 157166068
Test: treehugger & manual
Change-Id: I9f91f1b761286f489d175eb0772f78f702e8a2d6
2020-06-04 20:25:53 -07:00
Ulyana Trafimovich
abbe8875b3 Revert^2 "Rename DexJar interface method to DexJarBuildPath." am: 5539e7b568 am: 0852ac9a6d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1324492

Change-Id: I75dc93bb6aac621a0d90e5c5051cdeab98f5d1ef
2020-06-05 01:29:34 +00:00
Ulyana Trafimovich
5539e7b568 Revert^2 "Rename DexJar interface method to DexJarBuildPath."
This reverts commit b0dc851ff4.

Reason for revert: relanding original change. Build failures were
  caused by a race with another CL: https://r.android.com/1320920

Test: lunch aosp_cf_x86_phone-userdebug && m
Change-Id: Ic9016582dae7773b4d4f84a63425f1ef7a5d061f
2020-06-04 17:20:38 +01:00
Ulyana Trafimovich
7e59e8e2df Merge "Revert "Rename DexJar interface method to DexJarBuildPath."" am: c55b679e7b am: 651a63ca9d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1324371

Change-Id: Ic3be6718aff2b04048bac17635b2858581fe7f8a
2020-06-04 11:13:23 +00:00
Ulyana Trafimovich
c55b679e7b Merge "Revert "Rename DexJar interface method to DexJarBuildPath."" 2020-06-04 10:47:47 +00:00
Ulyana Trafimovich
b0dc851ff4 Revert "Rename DexJar interface method to DexJarBuildPath."
This reverts commit 562c240185.

Reason for revert: breaks `lunch full-eng && m checkbuild`.

Change-Id: Id7c7d6240d98afaf8edd49b6c96cd05534b784cc
2020-06-04 10:37:36 +00:00
Ulyana Trafimovich
0cc337d35a Merge "Rename DexJar interface method to DexJarBuildPath." am: 2a08566634 am: 22cd1b5383
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1322701

Change-Id: I87a6570cc6184bb38dda1f83dac787c30d8aaa54
2020-06-04 10:36:28 +00:00
Ulyana Trafimovich
2a08566634 Merge "Rename DexJar interface method to DexJarBuildPath." 2020-06-04 10:05:33 +00:00
Jiyong Park
2cd081cf06 dex_import can be added to apex
Bug:157886942
Test: m
Change-Id: Ida6f7bb784efe74cc1fa0e8d370eaee803f08b0f
Merged-In: Ida6f7bb784efe74cc1fa0e8d370eaee803f08b0f
2020-06-04 10:28:44 +01:00
Treehugger Robot
a7f51bb3c0 Merge "dex_import can be added to apex" am: a8bf98852a am: 55110941ea
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1320920

Change-Id: I09342ecaf016ca85ab5ac5812c46af6932179258
2020-06-04 05:38:13 +00:00
Treehugger Robot
a8bf98852a Merge "dex_import can be added to apex" 2020-06-04 05:06:22 +00:00
Ulya Trafimovich
562c240185 Rename DexJar interface method to DexJarBuildPath.
This is a prerequisite change before adding DexJarInstallPath.

Test: lunch aosp_cf_phone-userdebug && m
Change-Id: I033e08b8bb06c0a844a6bbbfcdc48ce33e9c95cf
2020-06-03 11:40:45 +01:00
Jaewoong Jung
fccad6b098 Soong package structure refactoring
Give prebuilt_etc and sh_binary their own packages and split the
gigantic main Android.bp up to small, per-package ones.

(This is a cherry-pick change.)

Test: m nothing, TreeHugger
Bug: 156980228
Change-Id: I7b00cd344b9f16861f1ff39edf0029f016b853d0
Merged-In: I7b00cd344b9f16861f1ff39edf0029f016b853d0
2020-06-02 14:35:04 -07:00
Jaewoong Jung
8066ebc38f Merge "Soong package structure refactoring" am: 264700345d am: ca9ed9158d
Original change: undetermined

Change-Id: I5cd95c02ab8af420dc2b7166ba24bdf0c7dc6496
2020-06-02 16:57:16 +00:00
Jiyong Park
77acec63fe dex_import can be added to apex
Bug:157886942
Test: m
Change-Id: Ida6f7bb784efe74cc1fa0e8d370eaee803f08b0f
2020-06-02 11:54:01 +09:00
Jaewoong Jung
4b79e98a6e Soong package structure refactoring
Give prebuilt_etc and sh_binary their own packages and split the
gigantic main Android.bp up to small, per-package ones.

Test: m nothing, TreeHugger
Bug: 156980228
Change-Id: I7b00cd344b9f16861f1ff39edf0029f016b853d0
2020-06-01 13:44:48 -07:00
Jiyong Park
7a12fd11ee Merge "Use Stem where output file name is expected in APEX" am: 0e666433cd am: 611703096e
Change-Id: I94d8f5541deea86310ad3b249b670c61623f3b96
2020-06-01 01:02:03 +00:00
Jiyong Park
cbe50c7073 Use Stem where output file name is expected in APEX
Bug: 157638999
Test: m
Merged-In: I4a4892bc2941cf1301d210fc3107c02f0e7b13b7
(cherry picked from commit f1493cc0f2)
Change-Id: I4a4892bc2941cf1301d210fc3107c02f0e7b13b7
2020-05-30 21:15:24 +09:00
Jiyong Park
f1493cc0f2 Use Stem where output file name is expected in APEX
Bug: 157638999
Test: m
Change-Id: I4a4892bc2941cf1301d210fc3107c02f0e7b13b7
2020-05-30 13:26:55 +09:00
Jiyong Park
ed50ca8dd8 apex respects stem of java_library modules
apex now respects stem of java_library modules.

As a follow-up we need to suppor the same for other types of modules.

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

Bug: 157638999
Test: m
Merged-In: Iaf5023020b5440f1ffd4f5414b5a7864655fc22a
(cherry picked from commit a62aa23990)
Change-Id: Iaf5023020b5440f1ffd4f5414b5a7864655fc22a
2020-05-29 14:15:36 +09:00
Treehugger Robot
db1bd15ef0 Merge "apex respects stem of java_library modules" am: 00f5701ade am: 3013ea064f
Change-Id: I40a1a6803d8af53a7889b8986f59fbafd4d13ee1
2020-05-29 01:17:33 +00:00
Jiyong Park
a62aa23990 apex respects stem of java_library modules
apex now respects stem of java_library modules.

As a follow-up we need to suppor the same for other types of modules.

Bug: 157638999
Test: m
Change-Id: Iaf5023020b5440f1ffd4f5414b5a7864655fc22a
2020-05-28 23:48:16 +09:00
Jiyong Park
b51e7ea3b8 Remove apex_available whitelist for the ART APEX
The marked library(ies) were available to the APEX via the
hand-written whitelist in build/soong/apex/apex.go. Trying to remove the
whitelist by adding apex_available property to the Android.bp of the
libraries.

Exempt-From-Owner-Approval: cherry-pick from internal

Bug: 150999716
Test: m
Merged-In: I2b792657b444f0c963e1e92b7c91f6a0cfe1688c
(cherry picked from commit be6e2b6a18)
Change-Id: I2b792657b444f0c963e1e92b7c91f6a0cfe1688c
2020-05-28 04:06:41 +00:00
Jiyong Park
69efc4625a Merge changes from topic "apex_available_art" into rvc-dev am: b7431abffe
Change-Id: Idb9f30b74687f2c5da9494db60ae6614a67c0c4b
2020-05-28 01:11:19 +00:00
Jiyong Park
885910e198 DO NOT MERGE: Revert "DO NOT MERGE: Remove AppSearch from Android R." am: 8b39919030
Change-Id: If72ac03ec041b30dc2636ba5412c375ac1566ca4
2020-05-28 01:11:17 +00:00
Jiyong Park
b7431abffe Merge changes from topic "apex_available_art" into rvc-dev
* changes:
  Remove apex_available whitelist for the ART APEX
  DO NOT MERGE: Revert "DO NOT MERGE: Remove AppSearch from Android R."
2020-05-28 00:49:45 +00:00
Artur Satayev
07d215215b Merge changes I4ab7e1a3,Ib525b2f5,I2d4c54fb into rvc-dev
* changes:
  Generate combined deps-info for all updatable modules.
  Remove ApexBundleDepsInfo.MinSdkVersion()
  Add "updatable" property to ApexModule interface.
2020-05-27 20:58:27 +00:00
Artur Satayev
2b4b7bbe82 Generate combined deps-info for all updatable modules.
Introduce a singleton apex rule to merge contents of individual
deps-info results into a single output file.

Bug: 149622332
Test: m
Change-Id: I4ab7e1a3527fead97a81a5a2cb0e1e93a429117c
Merged-In: I4ab7e1a3527fead97a81a5a2cb0e1e93a429117c
Exempt-From-Owner-Approval: cp from aosp
(cherry picked from commit 849f844252)
2020-05-27 17:51:18 +01:00
Ulya Trafimovich
c0eb0b1ae5 Add "updatable" property to ApexModule interface.
For a given variant of a module that implements ApexModule interface,
the "updatable" property tests if this variant comes from an updatable
apex. For platform variants it is always false.

Test: lunch aosp_walleye-userdebug && m nothing
Bug: 138994281
Merged-In: I2d4c54fb397e29dc9b3203be7fb17be4536529f7
Change-Id: I2d4c54fb397e29dc9b3203be7fb17be4536529f7
Exempt-From-Owner-Approval: cp from aosp
(cherry picked from commit 7c140d828a)
2020-05-27 17:50:51 +01:00
satayev
84ff6be8e9 Merge "Generate combined deps-info for all updatable modules." am: ede18549e5 am: 3a0a6427bd
Change-Id: I2ae338e9f883695260d922e6607c73770a4c8c04
2020-05-26 14:03:00 +00:00
satayev
ede18549e5 Merge "Generate combined deps-info for all updatable modules." 2020-05-26 13:28:28 +00:00
Jiyong Park
8b39919030 DO NOT MERGE: Revert "DO NOT MERGE: Remove AppSearch from Android R."
This reverts commit c9c7116721.

This revert is to avoid merge conflict when ag/11299431 is auto-merged
to master.

This change will again be reverted when ag/11299431 lands.

Bug: 150999716
Test: m

Change-Id: Ia0f7a0e0eb8cf6f6f4d0693de01777a8a750c769
2020-05-25 17:05:35 +09:00
Jiyong Park
be6e2b6a18 Remove apex_available whitelist for the ART APEX
The marked library(ies) were available to the APEX via the
hand-written whitelist in build/soong/apex/apex.go. Trying to remove the
whitelist by adding apex_available property to the Android.bp of the
libraries.

Bug: 150999716
Test: m
Change-Id: I2b792657b444f0c963e1e92b7c91f6a0cfe1688c
2020-05-25 17:05:35 +09:00
Jooyung Han
5ab5856db3 Merge "apex: Make android_library support APEX variants" 2020-05-21 12:02:39 +00:00
Jooyung Han
acc7bbebe4 apex: Make android_library support APEX variants
The android_library module type can be used within an android_app that
can itself be added to an apex but android_library does not call
android.InitApexModule(module) and so it does not support apex variants
and so is treated as if it cannot be part of an APEX even though it
actually is.

Now, android_library supports AEPX variants.

Due to this change, the whilelist for apex_available got bigger.

Exempt-From-Owner-Approval: cherry-pick from internal

Bug: 156978407
Test: m
Merged-In: I3a21d653fe9c4159e3a89791fe1a8597865eeae6
Change-Id: I3a21d653fe9c4159e3a89791fe1a8597865eeae6
(cherry picked from commit bd133b1bdc)
2020-05-21 12:01:54 +00:00
Jooyung Han
a8625c5393 Merge "apex: Make android_library support APEX variants" into rvc-dev-plus-aosp 2020-05-21 06:17:29 +00:00
Jooyung Han
040ff3d5c1 apex: Make android_library support APEX variants
The android_library module type can be used within an android_app that
can itself be added to an apex but android_library does not call
android.InitApexModule(module) and so it does not support apex variants
and so is treated as if it cannot be part of an APEX even though it
actually is.

Now, android_library supports AEPX variants.

Due to this change, the whilelist for apex_available got bigger.

Exempt-From-Owner-Approval: approved in rvc-dev

Bug: 156978407
Test: m
Merged-In: I3a21d653fe9c4159e3a89791fe1a8597865eeae6
Change-Id: I3a21d653fe9c4159e3a89791fe1a8597865eeae6
2020-05-21 06:16:59 +00:00
Jooyung Han
ff4e78e876 Merge "apex: install hwasan lib if depended on libc" am: 166349beeb am: f7879cbfbd
Change-Id: I8c0ae40db7543d96f1511ded42cbd6b23b141796
2020-05-21 01:22:50 +00:00
Jooyung Han
166349beeb Merge "apex: install hwasan lib if depended on libc" 2020-05-21 00:48:26 +00:00
Jooyung Han
11c2093ea3 apex: Make android_library support APEX variants
The android_library module type can be used within an android_app that
can itself be added to an apex but android_library does not call
android.InitApexModule(module) and so it does not support apex variants
and so is treated as if it cannot be part of an APEX even though it
actually is.

Now, android_library supports AEPX variants.

Due to this change, the whilelist for apex_available got bigger.

Bug: 156978407
Test: m
Merged-In: I3a21d653fe9c4159e3a89791fe1a8597865eeae6
Change-Id: I3a21d653fe9c4159e3a89791fe1a8597865eeae6
2020-05-20 21:49:30 +00:00
TreeHugger Robot
53754e3592 Merge "Remove apex_available whitelist for the extservices APEX" into rvc-dev 2020-05-17 15:17:58 +00:00
Jiyong Park
db4ce6e80a Remove apex_available whitelist for the extservices APEX
The marked library(ies) were available to the APEX via the
hand-written whitelist in build/soong/apex/apex.go. Trying to remove the
whitelist by adding apex_available property to the Android.bp of the
libraries.

Bug: 150999716
Test: m
Merged-In: I827d604c7e5a469a8b8a6d5a4b7917f2eaca48ca
Change-Id: I827d604c7e5a469a8b8a6d5a4b7917f2eaca48ca
2020-05-17 21:23:08 +09:00
Jiyong Park
7d95a510cc Reland "Prevent statically linking to a lib providing stable C APIs"
This reverts commit 5b75774004.

Exempt-From-Owner-Approval: cherry-pick from internal

Bug: 151051671
Test: m
Merged-In: I05f0465976098941d47ecc06c978cfa116364d78
(cherry picked from commit af7ed39b06)
Change-Id: I05f0465976098941d47ecc06c978cfa116364d78
2020-05-17 20:47:27 +09:00
Paul Duffin
c91aafb699 Merge "Replace javaLibrary with java.Dependency,android.Module" into rvc-dev 2020-05-16 07:24:18 +00:00
Jiyong Park
af7ed39b06 Reland "Prevent statically linking to a lib providing stable C APIs"
This reverts commit 5b75774004.

Bug: 151051671
Test: m
Change-Id: I05f0465976098941d47ecc06c978cfa116364d78
2020-05-16 09:41:19 +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
75b78df026 Merge "Add apex_set module." am: 805f2492e8 am: 23b4707ddc
Change-Id: I47e7a67ea8b2af27860531e67dd66c854b6bca70
2020-05-15 23:43:41 +00:00
Jaewoong Jung
805f2492e8 Merge "Add apex_set module." 2020-05-15 23:13:38 +00:00
Artur Satayev
849f844252 Generate combined deps-info for all updatable modules.
Introduce a singleton apex rule to merge contents of individual
deps-info results into a single output file.

Bug: 149622332
Test: m
Change-Id: I4ab7e1a3527fead97a81a5a2cb0e1e93a429117c
2020-05-15 19:10:19 +01: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
Paul Duffin
f299cbefcd Replace javaLibrary with java.Dependency,android.Module
Passes an additional android.Module parameter through to avoid having
to use javaLibrary interface.

Bug: 146586360
Test: m nothing
Merged-In: Ie533c16c753dc9c43171d0223953adea7b2b5ee6
Change-Id: Ie533c16c753dc9c43171d0223953adea7b2b5ee6
(cherry picked from commit 581bbbe8cb)
2020-05-15 17:07:02 +01:00
Treehugger Robot
ced4ae1496 Merge "Remove apex_available whitelist for the extservices APEX" am: 8cf3e5471d am: 8b4193d5bb
Change-Id: I0fda78f456e5634bfb67342bbe9706e09a167d0f
2020-05-15 15:21:07 +00:00
Treehugger Robot
8cf3e5471d Merge "Remove apex_available whitelist for the extservices APEX" 2020-05-15 14:46:43 +00:00
Treehugger Robot
c94b1728f1 Merge "Replace javaLibrary with java.Dependency,android.Module" am: 198c946c8a am: cf2a8b54a6
Change-Id: I505e846b647e2a29daeca376c1055e089c7c3001
2020-05-15 13:46:46 +00:00
Treehugger Robot
198c946c8a Merge "Replace javaLibrary with java.Dependency,android.Module" 2020-05-15 13:17:32 +00:00
Jooyung Han
8ce8db9ed6 apex: install hwasan lib if depended on libc
There're two ways to enable hwasan:
- global setting: TARGET_SANITIZE=hwaddress
- individual setting: sanitize: { hwaddress: true }

This change covers both cases by looking up if com.android.runtime is
hwaddress santized or not.

Bug: 156678661
Test: m (soong test added)
Change-Id: I67c382c3e76a06f4b27f221eebd153c698647227
2020-05-15 19:12:38 +09:00
Paul Duffin
581bbbe8cb Replace javaLibrary with java.Dependency,android.Module
Passes an additional android.Module parameter through to avoid having
to use javaLibrary interface.

Bug: 146586360
Test: m nothing
Change-Id: Ie533c16c753dc9c43171d0223953adea7b2b5ee6
2020-05-14 21:26:28 +01:00
Liz Kammer
8d501ef107 Merge "Add test data dependencies to APEX." am: 6109adaee0 am: 5b5cecd94e
Change-Id: I2589597f744dd62d0799f20d7de79dab4e8b07ae
2020-05-14 15:30:55 +00:00
Liz Kammer
6109adaee0 Merge "Add test data dependencies to APEX." 2020-05-14 15:06:49 +00:00
Jiyong Park
a8c03921f2 Remove apex_available whitelist for the extservices APEX
The marked library(ies) were available to the APEX via the
hand-written whitelist in build/soong/apex/apex.go. Trying to remove the
whitelist by adding apex_available property to the Android.bp of the
libraries.

Bug: 150999716
Test: m
Change-Id: I827d604c7e5a469a8b8a6d5a4b7917f2eaca48ca
2020-05-14 21:39:55 +09:00
Treehugger Robot
5a5194a485 Merge "Remove reference to libz_current." am: 6a53c65ebd am: 02d3e4e600
Change-Id: I616b77a4f1fae6370b30cbdffdd6ac6bc8d94ee6
2020-05-14 04:47:28 +00:00
Elliott Hughes
9912ee2f02 Remove reference to libz_current.
This no longer exists.

Bug: https://issuetracker.google.com/155351357
Test: treehugger
Change-Id: Ie38c971759acb0141cba6341f95c67effadd93a6
2020-05-13 14:20:12 -07:00
Liz Kammer
1c14a21994 Add test data dependencies to APEX.
Test: soong go tests

Bug: 155820504
Change-Id: If96d82c27f19953e34efb31f2111f1643c0c4008
2020-05-13 10:17:30 -07:00
Jiyong Park
cabc299091 Merge "Revert "Prevent statically linking to a lib providing stable C APIs"" am: 18bbde1615 am: a3c8a7d511
Change-Id: I7942cf827040f1683ffda90e1483e383ab33057a
2020-05-08 08:43:53 +00:00
Jiyong Park
18bbde1615 Merge "Revert "Prevent statically linking to a lib providing stable C APIs"" 2020-05-08 08:11:24 +00:00
Jiyong Park
5b75774004 Revert "Prevent statically linking to a lib providing stable C APIs"
This reverts commit 45b90e79c9.

Reason for revert: breakage https://android-build.googleplex.com/builds/quarterdeck?branch=aosp-master&target=run_bluetooth_host_native_tests&lkgb=6474123&lkbb=6474183&fkbb=6474137

Bug: 156046846
Change-Id: I0df395eaa4cd856ab466925031b21aa4adc3af08
Test: m on full-eng
2020-05-08 07:55:47 +00:00
Jiyong Park
e074cc3f52 Merge changes from topic "no_staticlinking_to_stubs" am: 06938a0a16 am: 36a0125014
Change-Id: I5c20e745bec1f57ba6bc2c1f08a7c942d98bcf75
2020-05-08 02:48:34 +00:00
Jiyong Park
18d4b2b708 Add GetPathString am: 1c7e962957 am: abf09b50e4
Change-Id: I079dd1d4394b494c225c054d46c5a5eb7fc4f113
2020-05-08 02:48:28 +00:00
Jiyong Park
abf09b50e4 Add GetPathString am: 1c7e962957
Change-Id: Iada405f160d8178ec90a1634f22a50cb18215938
2020-05-08 02:35:11 +00:00
Jiyong Park
06938a0a16 Merge changes from topic "no_staticlinking_to_stubs"
* changes:
  Prevent statically linking to a lib providing stable C APIs
  Add GetPathString
2020-05-08 02:12:58 +00:00
Ivan Lozano
7c3358dd60 Merge "Add gcov coverage support to Rust modules." am: 6c4e5c05c3 am: acdf2ac701
Change-Id: Id236afb83e583a93020803302a61dbf46904c295
2020-05-07 18:41:29 +00:00
Ivan Lozano
6c4e5c05c3 Merge "Add gcov coverage support to Rust modules." 2020-05-07 17:56:43 +00:00
Jeongik Cha
9d902cef58 Merge "Remove networkstack-aidl-interfaces-unstable-java from the whitelist" 2020-05-07 10:59:05 +00:00
Jiyong Park
45b90e79c9 Prevent statically linking to a lib providing stable C APIs
A lib providing stable C APIs should be available only to the APEX
containing the library. It shouldn't be available to other APEXes,
especially via static linking.

This change also fixes a bug that llndkImplDep (the dependency from
llndk stub to its implementation library) was recognized as being in the
same APEX.

Bug: 151051671
Test: m
Change-Id: Ifda7f4a367f68afcde93c86cda45a28cacd91f99
2020-05-07 16:20:00 +09:00
Jiyong Park
1c7e962957 Add GetPathString
The method is a thin wrapper around GetWalkPath and GetTagPath to make
it easy to construct a string representation of the current path.

It was originally inlined in the apex package. This change makes it a
function and moves it to the android package so make it more useful.

Bug: N/A
Test: m
Change-Id: I7e2bc2074baed759d67d9097151c9ac10e34ed31
2020-05-07 16:12:13 +09:00
Yo Chiang
c746c894b3 Merge "APEX should require base module of stub libraries" am: 6345dfde49 am: f8ae216e9c
Change-Id: Id5c8cb5aa416a3e0cf927067fd2bc2fbf6639128
2020-05-07 06:46:05 +00:00