Commit Graph

19651 Commits

Author SHA1 Message Date
Nicolas Geoffray 9acd7c3d36 Merge "Support missing a shared library variant." 2020-02-06 08:14:15 +00:00
Jiyong Park 26fb6bdba1 Fix the incorrect merge conflict resolution
This change fixes the incorrect merge conflict resolution of
3b17896950

Bug: N/A
Test: m
Change-Id: If00db9ab9758384a2def5442fbeecb36615d2ec1
2020-02-06 16:47:54 +09:00
Hai Zhang 085ac78cdf Merge "Revert "Use apex_available for PermissionController."" 2020-02-06 06:46:13 +00:00
Jiyong Park d7536ba58d shared_lib dependency from a static lib crosses the APEX boundary
cc_library_static {
    name: "libfoo",
    shared_libs: ["libbar"],
}

cc_library {
   name: "libbar",
}

If libfoo is part of an APEX, then libbar is no longer considered as a
member of the APEX, because it isn't actually linked to libfoo.

To distinguish such a shared lib dependency from a static library from a
shared lib dependency from a shared library, a new dep type
SharedFromStaticDepTag is introduced. It is treated exactly the same as
SharedDepTag, except when we determine whether a dependency is crossing
the APEX boundary or not.

This allows us to check the apex_available property more correctly.
Previously, modules were incorrectly considered as being used for an
APEX due to the shared lib dependency from a static lib.

As a good side effect, this also reduces the number of APEX variants.
Specifically, on aosp_arm64, the number of the generated modules were
reduced from 44745 to 44180.

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

Bug: 147671264
Test: m

Merged-In: I899ccb9eae1574effef77ca1bc3a0df145983861
(cherry picked from commit 931b676a69)
Change-Id: I899ccb9eae1574effef77ca1bc3a0df145983861
2020-02-06 14:45:43 +09:00
Jiyong Park 0f80c1848a apex_available tracks static dependencies
This change fixes a bug that apex_available is not enforced for static
dependencies. For example, a module with 'apex_available:
["//apex_available:platform"]' was able to be statically linked to any
APEX. This was happening because the check was done on the modules that
are actually installed to an APEX. Static dependencies of the modules
were not counted as they are not installed to the APEX as files.

Fixing this bug by doing the check by traversing the tree in the method
checkApexAvailability.

This change includes a few number of related changes:

1) DepIsInSameApex implementation for cc.Module was changed as well.
Previuosly, it returned false only when the dependency is actually a
stub variant of a lib. Now, it returns false when the dependency has one
or more stub variants. To understand why, we need to recall that when
there is a dependency to a lib having stubs, we actually create two
dependencies: to the non-stub variant and to the stub variant during the
DepsMutator phase. And later in the build action generation phase, we
choose one of them depending on the context. Also recall that an APEX
variant is created only when DepIsInSameApex returns true. Given these,
with the previous implementatin of DepIsInSameApex, we did create apex
variants of the non-stub variant of the dependency, while not creating
the apex variant for the stub variant. This is not right; we needlessly
created the apex variant. The extra apex variant has caused no harm so
far, but since the apex_available check became more correct, it actually
breaks the build. To fix the issue, we stop creating the APEX variant
both for non-stub and stub variants.

2) platform variant is created regardless of the apex_available value.
This is required for the case when a library X that provides stub is in
an APEX A and is configured to be available only for A. In that case,
libs in other APEX can't use the stub library since the stub library is
mutated only for apex A. By creating the platform variant for the stub
library, it can be used from outside as the default dependency variation
is set to the platform variant when creating the APEX variations.

3) The ApexAvailableWhitelist is added with the dependencies that were
revealed with this change.

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

Bug: 147671264
Test: m

Merged-In: Iaedc05494085ff4e8af227a6392bdd0c338b8e6e
(cherry picked from commit fa89944c79)
Change-Id: Iaedc05494085ff4e8af227a6392bdd0c338b8e6e
2020-02-06 14:45:08 +09:00
TreeHugger Robot 54f58bdb8e Merge changes from topic "apex_available"
* changes:
  shared_lib dependency from a static lib crosses the APEX boundary
  apex_available tracks static dependencies
2020-02-06 05:37:37 +00:00
Automerger Merge Worker 8d42b14c8d Merge "Use module name as the suffix for apex variant" am: 22b08b4af6 am: 113ce97ae2 am: b077b2c780
Change-Id: I46ccaef2ebf8b26046f23d1e4c3482ee2a865f69
2020-02-06 05:15:52 +00:00
Automerger Merge Worker b077b2c780 Merge "Use module name as the suffix for apex variant" am: 22b08b4af6 am: 113ce97ae2
Change-Id: Ia5215be674f6b88c17b409b3cb61832116ec496c
2020-02-06 04:52:57 +00:00
Hai Zhang 3b17896950 Revert "Use apex_available for PermissionController."
This reverts commit a952495643.

Reason for revert: PermissionController may need to be built outside of APEX

Fixes: 148957736
Change-Id: I80a2cd666ea5028741250dd2cebf2bd7d7b331ad
2020-02-06 04:46:26 +00:00
Automerger Merge Worker 37c98748ea Merge "sdk_version: "module_current" is supported" am: c4930248c4 am: e04b901737 am: 5ca166b2a9
Change-Id: I8dcd37faa79f265ea144798c1753c62485707f79
2020-02-06 04:40:23 +00:00
Automerger Merge Worker 113ce97ae2 Merge "Use module name as the suffix for apex variant" am: 22b08b4af6
Change-Id: I5378d6c9ecda93e361fd31b3684017e755508b22
2020-02-06 04:39:00 +00:00
Treehugger Robot 22b08b4af6 Merge "Use module name as the suffix for apex variant" 2020-02-06 04:22:22 +00:00
Automerger Merge Worker 5ca166b2a9 Merge "sdk_version: "module_current" is supported" am: c4930248c4 am: e04b901737
Change-Id: Ifbbc7345a9e548c496f30b64d45ce2662c81ca16
2020-02-06 04:21:23 +00:00
Automerger Merge Worker e04b901737 Merge "sdk_version: "module_current" is supported" am: c4930248c4
Change-Id: I76b818444db59cc50bae21e22475d2273490c122
2020-02-06 04:06:12 +00:00
Treehugger Robot c4930248c4 Merge "sdk_version: "module_current" is supported" 2020-02-06 03:50:43 +00:00
Jiyong Park db334861b2 Use module name as the suffix for apex variant
apex {
    name: "myapex",
    native_shared_libs: ["libfoo"],
    apex_name: "apex_name",
}

override_apex {
    name: "myapex.override",
    base: "myapex"
}

Previsouly, above wasn't supported because both APEXes have the same
apex_name and that apex_name is used as the suffix of libfoo. i.e.,
there are two libfoo.apex_name modules defined.

Now, the two apex variants of libfoo are named as
libfoo.myapex and libfoo.myapex.override.

Bug: 140136207
Test: m
Change-Id: I63f8a1de463011c6e0b97f5f6eee83103e22bc30
2020-02-06 10:54:30 +09:00
Jiyong Park 931b676a69 shared_lib dependency from a static lib crosses the APEX boundary
cc_library_static {
    name: "libfoo",
    shared_libs: ["libbar"],
}

cc_library {
   name: "libbar",
}

If libfoo is part of an APEX, then libbar is no longer considered as a
member of the APEX, because it isn't actually linked to libfoo.

To distinguish such a shared lib dependency from a static library from a
shared lib dependency from a shared library, a new dep type
SharedFromStaticDepTag is introduced. It is treated exactly the same as
SharedDepTag, except when we determine whether a dependency is crossing
the APEX boundary or not.

This allows us to check the apex_available property more correctly.
Previously, modules were incorrectly considered as being used for an
APEX due to the shared lib dependency from a static lib.

As a good side effect, this also reduces the number of APEX variants.
Specifically, on aosp_arm64, the number of the generated modules were
reduced from 44745 to 44180.

Bug: 147671264
Test: m

Change-Id: I899ccb9eae1574effef77ca1bc3a0df145983861
2020-02-06 09:16:19 +09:00
Jiyong Park fa89944c79 apex_available tracks static dependencies
This change fixes a bug that apex_available is not enforced for static
dependencies. For example, a module with 'apex_available:
["//apex_available:platform"]' was able to be statically linked to any
APEX. This was happening because the check was done on the modules that
are actually installed to an APEX. Static dependencies of the modules
were not counted as they are not installed to the APEX as files.

Fixing this bug by doing the check by traversing the tree in the method
checkApexAvailability.

This change includes a few number of related changes:

1) DepIsInSameApex implementation for cc.Module was changed as well.
Previuosly, it returned false only when the dependency is actually a
stub variant of a lib. Now, it returns false when the dependency has one
or more stub variants. To understand why, we need to recall that when
there is a dependency to a lib having stubs, we actually create two
dependencies: to the non-stub variant and to the stub variant during the
DepsMutator phase. And later in the build action generation phase, we
choose one of them depending on the context. Also recall that an APEX
variant is created only when DepIsInSameApex returns true. Given these,
with the previous implementatin of DepIsInSameApex, we did create apex
variants of the non-stub variant of the dependency, while not creating
the apex variant for the stub variant. This is not right; we needlessly
created the apex variant. The extra apex variant has caused no harm so
far, but since the apex_available check became more correct, it actually
breaks the build. To fix the issue, we stop creating the APEX variant
both for non-stub and stub variants.

2) platform variant is created regardless of the apex_available value.
This is required for the case when a library X that provides stub is in
an APEX A and is configured to be available only for A. In that case,
libs in other APEX can't use the stub library since the stub library is
mutated only for apex A. By creating the platform variant for the stub
library, it can be used from outside as the default dependency variation
is set to the platform variant when creating the APEX variations.

3) The ApexAvailableWhitelist is added with the dependencies that were
revealed with this change.

Bug: 147671264
Test: m

Change-Id: Iaedc05494085ff4e8af227a6392bdd0c338b8e6e
2020-02-06 09:16:19 +09:00
Automerger Merge Worker 7dc1ab5712 Merge "Add rules to handle asset resources." am: 387ad5c576 am: d75a5b879f am: 43db53b708
Change-Id: Ib005d9b417c8ec3bf9d5c55405f4345c58ad3390
2020-02-05 23:48:06 +00:00
Automerger Merge Worker 43db53b708 Merge "Add rules to handle asset resources." am: 387ad5c576 am: d75a5b879f
Change-Id: Ia81ca2acee65f589cf99952bd43aca6687468eb7
2020-02-05 23:38:08 +00:00
Automerger Merge Worker d75a5b879f Merge "Add rules to handle asset resources." am: 387ad5c576
Change-Id: Iae9ef6b005b3d36fe24a805233ae9d1eeb2ad70b
2020-02-05 23:24:49 +00:00
Vic Yang f36dceef4d More cleanup of no-vendor-variant VNDK whitelist
Bug: 148082691
Test: Build success
Change-Id: Icad28af29e80908c0d353f6fc70913678fd82064
2020-02-05 15:21:55 -08:00
Jaewoong Jung 387ad5c576 Merge "Add rules to handle asset resources." 2020-02-05 22:24:39 +00:00
Automerger Merge Worker fc375087a3 Merge "Add support for compat config in APEX." am: 86a5dc5575 am: a53ed40948 am: 085528a57a
Change-Id: I3306751d7bf7ac39656e26e6556a36c8ea536f6f
2020-02-05 20:08:07 +00:00
Automerger Merge Worker 085528a57a Merge "Add support for compat config in APEX." am: 86a5dc5575 am: a53ed40948
Change-Id: I55e4b749e2b4ea2910fbc8c77cb8c4637f07471d
2020-02-05 19:53:48 +00:00
Automerger Merge Worker a53ed40948 Merge "Add support for compat config in APEX." am: 86a5dc5575
Change-Id: I0559c88b0916ab2c037769fd2d0981bddbe62666
2020-02-05 19:38:30 +00:00
Anna Trostanetski 86a5dc5575 Merge "Add support for compat config in APEX." 2020-02-05 19:24:12 +00:00
Automerger Merge Worker e52822abe3 Merge "Minor cleanup in soong_config_modules documentation." am: e89f7354f8 am: 933afdde06 am: 4e77047d09
Change-Id: Ia04a7e36233c71b734bd7dd8274a6347aca56736
2020-02-05 19:12:46 +00:00
Automerger Merge Worker 4e77047d09 Merge "Minor cleanup in soong_config_modules documentation." am: e89f7354f8 am: 933afdde06
Change-Id: Ifa7d643edce9828e703b6b0723037517cf359280
2020-02-05 19:00:40 +00:00
Automerger Merge Worker 933afdde06 Merge "Minor cleanup in soong_config_modules documentation." am: e89f7354f8
Change-Id: I361ad2aeaa7fec9991adef35165ebf51349483d8
2020-02-05 18:50:54 +00:00
Treehugger Robot e89f7354f8 Merge "Minor cleanup in soong_config_modules documentation." 2020-02-05 18:41:53 +00:00
Hai Zhang 464dc5fda3 Merge "Use apex_available for PermissionController." 2020-02-05 18:20:55 +00:00
atrost 6e12625c0f Add support for compat config in APEX.
apex module accepts PlatformCompatConfigIntf as prebuilt,
and places it in the etc folder of the apex.

Test: m
Test: flash device with dummy config in mediaprovider APEX -
the config is present
Change-Id: Ifc62cd262f6c6571c1bf6c2943879aa20877ecad
2020-02-05 13:33:50 +00:00
Automerger Merge Worker 6adb8c790a Merge "java_sdk_library use prebuilt jars for numeric sdk_version" am: 50fea3b6a7 am: f2e4ef549c am: bf6bc94be8
Change-Id: I32572f0213f1563989c8e61778fe682ed8e3db20
2020-02-05 08:34:44 +00:00
Automerger Merge Worker bf6bc94be8 Merge "java_sdk_library use prebuilt jars for numeric sdk_version" am: 50fea3b6a7 am: f2e4ef549c
Change-Id: Ifcb13ebb27199d8ba9b1b486bb02bc96234d46f2
2020-02-05 08:28:58 +00:00
Automerger Merge Worker f2e4ef549c Merge "java_sdk_library use prebuilt jars for numeric sdk_version" am: 50fea3b6a7
Change-Id: I045cbc885ea516fe97ffd26c40e80f7b4212628d
2020-02-05 08:22:12 +00:00
Paul Duffin 50061511d4 java_sdk_library - Use prebuilt/prefer for unbundled app builds
Previously, the java_sdk_library had special support for disabling the
stubs library when the build was configured to use prebuilts for sdks,
e.g. in an unbundled app build. That caused the prebuilt version of the
stubs library to be used instead. The disabling was done irrespective
of whether a prebuilt was available which prevents java_sdk_library
from being used in situations when prebuilts are not available, e.g.
when they have not been created yet.

This change moves the logic into tha java_sdk_library_import and
leverages the existing prebuilt/prefer mechanism to ensure that the
prebuilt version is used when required.

* Adds a ForcePrefer() method to Prebuilt to allow a module to forcibly
  set the value of the prefer property.
* Sets prefer true on the java_sdk_library_import and the stubs modules
  it creates when the prebuilt version should be used.
* Refactors PrebuiltJars for use by both java_sdk_library and
  java_sdk_library_import as they both need to provide access to
  prebuilts for previously released versions of the library.
* Removes disabling logic from java_sdk_library.

This will probably require some additional java_sdk_library_import
modules to be added to prebuilts/sdk/current/Android.bp.

Bug: 148080325
Test: m droid && TARGET_BUILD_APPS=Camera2 m
Change-Id: I0b5f751e82a2179a967ae64ca03dc9b9e7665c16
2020-02-05 08:09:57 +00:00
Paul Duffin 50fea3b6a7 Merge "java_sdk_library use prebuilt jars for numeric sdk_version" 2020-02-05 08:06:52 +00:00
Automerger Merge Worker 020f3b8886 Merge "Dedup adding of arch/common properties to cc library snapshot" am: 26a6eb7971 am: af3948b120 am: f14a1746e5
Change-Id: Iaa2df6f64906251bf6434c3cff0fb50fb563c100
2020-02-04 23:32:30 +00:00
Automerger Merge Worker f14a1746e5 Merge "Dedup adding of arch/common properties to cc library snapshot" am: 26a6eb7971 am: af3948b120
Change-Id: I93faf41f5a91555016b169b9c74797015d23e698
2020-02-04 23:17:47 +00:00
Automerger Merge Worker c10e24ab39 Merge "Add support for LINE_COVERAGE (1/2)" am: 08cc141860 am: 94647faa0e am: 8b2df375bb
Change-Id: I9e46a917cc4fe165d1ba36a87928da08b10bffdd
2020-02-04 23:13:17 +00:00
Automerger Merge Worker af3948b120 Merge "Dedup adding of arch/common properties to cc library snapshot" am: 26a6eb7971
Change-Id: Iece2599958e0bdb9314d72b47401c9fb62c6d50b
2020-02-04 23:05:00 +00:00
Automerger Merge Worker 8b2df375bb Merge "Add support for LINE_COVERAGE (1/2)" am: 08cc141860 am: 94647faa0e
Change-Id: I1e1a1dbf921cd4e51d2fc2b55553899870cb640c
2020-02-04 22:58:19 +00:00
Treehugger Robot 26a6eb7971 Merge "Dedup adding of arch/common properties to cc library snapshot" 2020-02-04 22:57:45 +00:00
Automerger Merge Worker 94647faa0e Merge "Add support for LINE_COVERAGE (1/2)" am: 08cc141860
Change-Id: Iaaaf0e8aef9775784a173e8fd022380833df38f5
2020-02-04 22:46:43 +00:00
Kyriakos Ispoglou 08cc141860 Merge "Add support for LINE_COVERAGE (1/2)" 2020-02-04 22:37:41 +00:00
Bill Peckham c93258bfec Minor cleanup in soong_config_modules documentation.
Test: build
Change-Id: Ia5a43a024203ca4b714926bcc89f7ec12523b8ad
2020-02-04 13:17:24 -08:00
Paul Duffin 74fc190d90 Dedup adding of arch/common properties to cc library snapshot
Some additional, possibly arch specific, properties need adding to
cc library (e.g. recovery_available). This dedups and cleans up the
code involved to simply the addition of those new properties.

Bug: 142918168
Test: m nothing
Change-Id: I0963aa02e9504af1ae9b427ff1016e7c481465f4
2020-02-04 18:48:31 +00:00
Nicolas Geoffray 0b78766fbc Support missing a shared library variant.
When SOONG_ALLOW_MISSING_DEPENDENCIES is set, it should be OK to miss
shared library variants.

Test: master-art manifest, use bionic stubs
Bug: 142935992
Change-Id: Ie0054acfef7c4406594a87378a7029380a9fda50
2020-02-04 18:27:55 +00:00
Automerger Merge Worker 577f77c33e Merge "Build rules for compat config docs generation." am: 026ffecb9d am: 5467f3b9ba am: 78ec3d4b73
Change-Id: Iadaab6a5c196e7633a782dcbbaad928798270328
2020-02-04 17:01:33 +00:00