Commit Graph

2299 Commits

Author SHA1 Message Date
Ryan Prichard a467ea4870 Merge "Remove libgcc toolchain libs for Android" am: 3f3bb83f81 am: f72c6f2e44 am: a5934e3408
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1663859

Change-Id: Ia4b0f7de3bac88ab90a3ca0a6dd647117275aa7c
2021-04-07 00:15:50 +00:00
Ryan Prichard 3f3bb83f81 Merge "Remove libgcc toolchain libs for Android" 2021-04-06 21:43:33 +00:00
Paul Duffin 864116ce3f Add PrebuiltNameFromSource
Bug: 177892522
Test: m nothing
Change-Id: I45274836d59adbd6b2a2a848705b189398f1e766
2021-04-06 21:20:58 +01:00
Martin Stjernholm ae15fe4e2b Merge "Allow dependencies from platform variants to APEX modules (reland)." am: 313a349d6b am: bb4aa7c1c1 am: da18e6832b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1664028

Change-Id: I9e836e76724a9d8b20970bc77159eca1f45b7e81
2021-04-06 18:24:59 +00:00
Martin Stjernholm ec00900f83 Allow dependencies from platform variants to APEX modules (reland).
When `test_for` dependencies are added from libraries to APEX modules,
they can be created from the platform variants of the libraries, since
those are used for building tests. Hence we need an alias from the
platform variant of the APEX module to have a target for those
dependencies.

This is only necessary for libraries that are split by the APEX
mutator, i.e. is a member of some APEX. Normally that's not the case
for test libraries, but there may be exceptions (read
com.android.art.testing).

This relands https://r.android.com/1654679 after decoupling it from the
topic that caused b/184239856.

Test: m nothing
Bug: 183882457
Change-Id: If643c75ce9bc25fa01ad9d1e3ba8e1d060d03bb2
2021-04-06 14:24:26 +01:00
Treehugger Robot dd62393313 Merge changes Id33bf640,I4d67b9b9 am: 8c56183fb7 am: b17e061ae9 am: a7fe23c458
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1663139

Change-Id: Ic1434fc150e802f3a6e8b58a9a6f3e16e93da146
2021-04-06 05:29:49 +00:00
Jiyong Park f58c46e36f Don't use incorrect version names like VER or BOARD even in tests
All version names will go through ApiLevelFromUser which triggers an
error when the name is not a valid one.

Bug: 175678607
Test: m
Change-Id: Id33bf64085603914d45ad7942cb8908a4734493f
2021-04-05 09:32:06 +09:00
Jiyong Park 7f61ac4c8b Merge "Move java.sdkSpec to the android package" am: d4fa8fc107 am: 7ff95eca2f am: f19d2d57b3
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1655587

Change-Id: I5c5d25a78c4f51876289dc450874d83c5a9c90b6
2021-04-03 13:16:03 +00:00
Ryan Prichard c2018e2ed4 Remove libgcc toolchain libs for Android
Remove Android-targeting gcc toolchain libraries -- libgcc,
libgcc_stripped, libatomic, and libgcov. Also remove libunwind_llvm,
which is replaced with a libunwind toolchain prebuilt.

The __atomic_* library functions are now part of the compiler-rt
builtins library:

https://android-review.googlesource.com/c/toolchain/llvm_android/+/1625025

Bug: http://b/153025717
Test: treehugger
Change-Id: I971d0a4a49f1aaeb3546e80b6d94208277a171ac
2021-04-02 21:07:35 -07:00
Jiyong Park f1691d2a2c Move java.sdkSpec to the android package
... in preparation for making the handling of sdk versions consistent
across java and cc modules.

Bug: 175678607
Test: m
Change-Id: I598f0454bce9b7320621022115412fbe97403945
2021-04-03 08:25:12 +09:00
Jaewoong Jung 89624d7866 Merge "Revert "Revert "Add min_sdk_version to java_import.""" am: d0afefa4b1 am: f7c8d8a746 am: 4377971d03
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1663082

Change-Id: I8090eb98d2f3eeb6be4413bfb774f6f30c66787b
2021-04-02 17:37:37 +00:00
Jaewoong Jung d0afefa4b1 Merge "Revert "Revert "Add min_sdk_version to java_import.""" 2021-04-02 15:49:58 +00:00
Jaewoong Jung 56e12dbbaf Revert "Revert "Add min_sdk_version to java_import.""
This reverts commit 5ab6508008.

Reason for revert: Resubmitting Ie255f74d40432f4bdd0092d618705a7d17235e58 after fixing the broken targets.

Bug: 183695497
Test: https://android-build.googleplex.com/builds/forrest/run/L58600000849810513
Change-Id: I5f072f396002ca3a45bd530ad9be987efa732833
2021-04-02 04:55:27 +00:00
Jaewoong Jung a8eae7b113 Merge "Revert "Add min_sdk_version to java_import."" am: 37a5d5ebd8 am: 7644361eef am: e790b69343
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1663080

Change-Id: I8182c3f6caf58c0e96fc81b624ba974df68cc5bf
2021-04-02 02:40:39 +00:00
Jaewoong Jung 37a5d5ebd8 Merge "Revert "Add min_sdk_version to java_import."" 2021-04-02 00:34:06 +00:00
Jaewoong Jung 5ab6508008 Revert "Add min_sdk_version to java_import."
This reverts commit 6d15d63556.

Reason for revert: Broke git_sc-mainline-prod on test_suites_x86_64

Fixes: 184305592
Change-Id: I4b2e2675e0dd9e2e84966f545a52f45d5b731bab
2021-04-02 00:17:59 +00:00
Jaewoong Jung 2745317d74 Merge "Add min_sdk_version to java_import." am: 51a0d85ebc am: e37f90021f am: f88946c3ac
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1660819

Change-Id: I81345ab4dd0efcc584d978db290361558fc6477c
2021-04-01 21:39:08 +00:00
Jaewoong Jung 51a0d85ebc Merge "Add min_sdk_version to java_import." 2021-04-01 19:45:53 +00:00
Nikita Ioffe eac680eeb4 Merge "Revert "Allow dependencies from platform variants to APEX modules."" am: 6f77314381 am: 72d1c2f38e am: e7e0954fea
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1660243

Change-Id: Ibfd60afe26a0b931803c9b84f8805b5ebc54483b
2021-04-01 16:28:59 +00:00
Nikita Ioffe 6f77314381 Merge "Revert "Allow dependencies from platform variants to APEX modules."" 2021-04-01 14:22:53 +00:00
Paul Duffin 27b254ba08 Merge "Remove apexFixtureFactory" am: abc89cf86b am: 4ec4ca02bd am: 8f1c917639
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1660142

Change-Id: I7ec3da4998f64a17b5512a507e833ff2da1ccff8
2021-04-01 11:37:38 +00:00
Nikita Ioffe d64139f8e5 Revert "Allow dependencies from platform variants to APEX modules."
Revert submission 1658000

Reason for revert: Breaks full-eng build: b/184239856
Reverted Changes:
I4f8ead785:Avoid internal APEX stubs for libsigchain and clea...
I68affdf69:Allow dependencies from platform variants to APEX ...
I54b33784e:Rename libdexfile_external_static to libdexfile_st...
Id68ae9438:libdexfile_external is being replaced by libdexfil...
I12ac84eb4:libdexfile_external is replaced by libdexfile.
If05dbffc8:Rename libdexfile_external_static to libdexfile_st...
Ia011fa3a8:Merge libdexfile_external into libdexfile.

Change-Id: If494dc5385042a4620a76a9eadc1613ae0eb1655
2021-04-01 10:58:24 +00:00
Paul Duffin 284165afb5 Remove apexFixtureFactory
Bug: 182885307
Test: m nothing
Change-Id: I88c58bf6b4adda4017e54548748897c51c3f3aa1
2021-04-01 10:31:07 +01:00
Martin Stjernholm c5bc333cf5 Merge "Allow dependencies from platform variants to APEX modules." am: f8c9713fb8 am: 3311c129d4 am: 2e9cf54e07
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1654679

Change-Id: I5a00f0bdcd9cb53e6e8c1f0b7bf21eab7fab3dbf
2021-04-01 09:05:44 +00:00
Treehugger Robot 7349652925 Merge ""current" is implicitly added to stubs.versions" am: 25c47a43a5 am: 4ce23de995 am: cab9b4b25c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1641782

Change-Id: Ibc0b6e3fdd98b59900f9998f5c11c417d5d4a20a
2021-04-01 06:57:10 +00:00
Martin Stjernholm f8c9713fb8 Merge "Allow dependencies from platform variants to APEX modules." 2021-04-01 06:53:13 +00:00
Treehugger Robot 25c47a43a5 Merge ""current" is implicitly added to stubs.versions" 2021-04-01 04:53:55 +00:00
Jiyong Park d4a3a137ed "current" is implicitly added to stubs.versions
So far, when a library `libfoo` has `stubs.versions: ["10", "11"]`, then
`shared_libs: ["libfoo"]` is linked to the version 11 of the stub.

This requires the author of `libfoo` to manually update the property
whenever a new version is introduced. Otherwise, clients are not able
to use the newly added APIs because the latest stub is for an old
version.

This change eliminates the need for manual updating. "current" version
is always implicitly added to `stubs.versions`. It is added even when
nothing is set on the property, if `stubs.symbol_file` is set. i.e.

```
cc_library {
    name: "libfoo",
    stubs: {
        symbol_file: "libfoo.map.txt",
	// no versions: [...] needed
    },
}

cc_library {
    name: "a_client",
    shared_libs: ["libfoo"],
    apex_available: ["myapex"],
    min_sdk_version: "29",
}

apex {
    name: "myapex",
    native_shared_libraries: ["a_client"],
    min_sdk_version: "29",
}
```

`a_client` links to the "current" stub of `libfoo` that has all symbols
shown in the map file.

Note that, above doesn't mean that the client has unlimited access to
APIs that are introduced even after the min_sdk_version of the client
(29 in this example). The use of such APIs still has to be guarded with
`__builtin_available` check.

Bug: N/A
Test: m
Change-Id: I70bb1600c18e74d36c6b24c3569d2149f02aaf96
2021-04-01 09:58:53 +09:00
Paul Duffin c0e22ebaef Merge "Convert testDexpreoptWithApexes to use test fixtures" am: bcaf0fcb55 am: 7eee85fcae am: 0d9785622c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1658076

Change-Id: If889ada1f5b1b572c04a4166c7c17332cf1f894c
2021-04-01 00:10:51 +00:00
Paul Duffin c31fe63706 Merge "Convert TestApexPermittedPackagesRules to use test fixtures" am: b00c7ed2e8 am: 6f3f57cbd8 am: 7904ca6ceb
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1658075

Change-Id: Ic911814f474cf7ec8d249af4b251bd4a82f9a6f6
2021-04-01 00:10:42 +00:00
Jaewoong Jung 6d15d63556 Add min_sdk_version to java_import.
Fixes: 183695497
Test: apex_test.go
Change-Id: Ie255f74d40432f4bdd0092d618705a7d17235e58
2021-03-31 16:50:42 -07:00
Paul Duffin 5560712323 Convert testDexpreoptWithApexes to use test fixtures
Bug: 181070625
Test: m nothing
Change-Id: Id40064c539c1d4eeb39396f0881a97529f3a3452
2021-03-31 16:16:20 +01:00
Paul Duffin 45338f05e3 Convert TestApexPermittedPackagesRules to use test fixtures
Adds PrepareForTestWithNeverallowRules to make it easy to test
neverallow rules. Avoid exporting any unnecessary neverallow related
methods from the android package.

Bug: 181070625
Test: m nothing
Change-Id: Idfc6955cb23f1a4d1790be7879388154b03f3980
2021-03-31 16:16:18 +01:00
Paul Duffin 4b2ff1652c Merge "Rename OptionalPath.RelativeToPath -> RelativeToTop" am: 32eccae1ac am: 4ac8cd6582 am: d188fa7de2
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1658072

Change-Id: I1ad2710e2439861542f01a976b185bb4084b02dd
2021-03-31 10:45:46 +00:00
Paul Duffin 49e0d8b637 Merge "Remove extraneous calls to TestingBuildParams.RelativeToTop()" am: dff50dffbc am: c9ec211cca am: 31638bfb46
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1655209

Change-Id: I8cac59260ab0d3f5c4ffe4cb6629c76105cf50ca
2021-03-31 00:21:41 +00:00
Paul Duffin b4c0f11cb7 Automatically call TestingBuildParams.RelativeToTop() am: e8366da1f6 am: fe53b7a2df am: 53325362e9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1655208

Change-Id: I2260f4020c4631310626f77ec7480f106e4c7c3b
2021-03-30 23:14:01 +00:00
Paul Duffin afdd4061ee Rename OptionalPath.RelativeToPath -> RelativeToTop
Bug: 183650682
Test: m nothing
Change-Id: I95239c2273e715e8c4c15a4a02967e01f6913234
2021-03-30 20:06:22 +01:00
Paul Duffin a71a67a4f5 Remove extraneous calls to TestingBuildParams.RelativeToTop()
Deprecated the method to try and prevent any other uses being added.

Bug: 183650682
Test: m nothing
Change-Id: Ia6f43851e5a00c9d96af780e3bd21e03175e1a2f
2021-03-30 20:03:22 +01:00
Paul Duffin e8366da1f6 Automatically call TestingBuildParams.RelativeToTop()
Fixes the few tests that break due to this and which cannot easily be
separated into their own changes.

Bug: 183650682
Test: m nothing
Change-Id: Ia2f31213a1f114a78e66a81d89279ecde9f4c465
2021-03-30 19:35:35 +01:00
Paul Duffin b19122a9f6 Merge "Add the transitive dependencies of boot_image to apex" am: 58367574a5 am: 023bd16632 am: 9b7d7f45f0
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1652623

Change-Id: Id3cc4bc9ecaaa4ae789e7d79ebce575f9760bdda
2021-03-30 18:32:11 +00:00
Paul Duffin 3c26d90d66 Merge "Stop JavaSdkLibrary_... tests requiring absolute path" am: da0470d8c7 am: 9542ba405f am: c9e51d0f74
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1654683

Change-Id: I5c5fc95ac48eb887223c5ebee85330b72a261348
2021-03-30 18:32:05 +00:00
Paul Duffin 03802c1edc Merge "Remove buildDir from apex package" am: a33da07343 am: 4ecf1ee4c5 am: d26d5bc45b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1654682

Change-Id: Ia7c2f88892ac2fad12b83fb641655fbee571e404
2021-03-30 18:32:00 +00:00
Paul Duffin a230ea4687 Merge "Add contents property to boot_image (and prebuilt_boot_image)" am: 8d3c44a986 am: b8f0b4e1bf am: af5736ea92
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1652622

Change-Id: Idb92c709d8bf17e3e00905ea54b9ee2bc901bbac
2021-03-30 18:31:51 +00:00
Paul Duffin 58367574a5 Merge "Add the transitive dependencies of boot_image to apex" 2021-03-30 16:42:07 +00:00
Paul Duffin da0470d8c7 Merge "Stop JavaSdkLibrary_... tests requiring absolute path" 2021-03-30 16:35:23 +00:00
Paul Duffin a33da07343 Merge "Remove buildDir from apex package" 2021-03-30 16:30:10 +00:00
Paul Duffin 8d3c44a986 Merge "Add contents property to boot_image (and prebuilt_boot_image)" 2021-03-30 16:26:20 +00:00
Martin Stjernholm 2f1e93ef36 Merge changes Iaa6411b5,I2118b8a2,Ibbdd3cbd,I2d1bbda2 am: 38e9f0b82f am: 99f29d244a am: c5c5d80d30
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1652620

Change-Id: I09a93351bcae2c27531fd258ddacdd8bc5ddd474
2021-03-30 12:42:38 +00:00
Martin Stjernholm 4d058c8809 Allow dependencies from platform variants to APEX modules.
When `test_for` dependencies are added from libraries to APEX modules,
they can be created from the platform variants of the libraries, since
those are used for building tests. Hence we need an alias from the
platform variant of the APEX module to have a target for those
dependencies.

This is only necessary for libraries that are split by the APEX
mutator, i.e. is a member of some APEX. Normally that's not the case
for test libraries, but there may be exceptions (read
com.android.art.testing).

Test: m nothing
Bug: 183882457
Change-Id: I68affdf69d7ec05c0ee8730e8ec04d7cb9e0e44a
2021-03-30 12:43:45 +01:00
Martin Stjernholm 38e9f0b82f Merge changes Iaa6411b5,I2118b8a2,Ibbdd3cbd,I2d1bbda2
* changes:
  Make test_for arch variant.
  Don't use APEX stubs between internal libs in the same APEX when building test_for modules.
  Add FilterListPred.
  Don't panic on "go test" invocations from the command line.
2021-03-30 09:26:36 +00:00
Paul Duffin c434921028 Merge "Add dependencies for art boot_image" am: 16e6aeeb51 am: d019752f73 am: 78dd45f054
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1652451

Change-Id: If37ae085694aa93924dce1548fad89b05fdfd8b0
2021-03-29 22:07:06 +00:00
Paul Duffin cf8d7db02b Stop JavaSdkLibrary_... tests requiring absolute path
Bug: 183650682
Test: m nothing
Change-Id: Ia6e5034bbf3920a9e1f8fc319dc722658f6cb1ce
2021-03-29 17:29:30 +01:00
Paul Duffin 37ba344e40 Remove buildDir from apex package
Bug: 182885307
Test: m nothing
Change-Id: I71cbfd79e2fb4b1cbd2914ffab76570548d57c61
2021-03-29 17:29:30 +01:00
Paul Duffin 4d101b60f0 Add the transitive dependencies of boot_image to apex
This avoids having to specify boot libraries in both the boot_image
and separately as java_libs on the apex. Simply add them to the
boot_image (happens automatically ATM when using image_name: "art")
and add the boot_image to the apex.

Bug: 177892522
Test: m nothing
Change-Id: I7e0c41665604b73780cdf0dc555067497b1e6ef0
2021-03-29 17:15:29 +01:00
Paul Duffin 82886d6cbf Add contents property to boot_image (and prebuilt_boot_image)
Allows boot_image modules to be created for any module that contributes
to the boot class path, e.g. core-i18n from the com.android.i18n.

A boot_image module with a contents property cannot specify an
image_name, and vice versa. Only those boot_image modules with an
image_name create .art, .oat and .vdex files, either in their
associated APEX or as part of the framework "boot" image.

Bug: 177892522
Test: m nothing
Change-Id: Idfc2bcf00dd6d3ed36ac4df46fcf18e8aa7e2c92
2021-03-29 17:15:27 +01:00
Paul Duffin c7ef9892dd Add dependencies for art boot_image
Adds dependencies for the art boot image. The art boot image only
includes modules from the com.android.art APEX and so this change adds
some verification to make sure that the APEX component of the
configuration is compatible with the boot_image's apex_availabilty
settings and then just adds dependencies on the modules. It relies on
the normal APEX processing to cause the com.android.art variant of the
boot_image to depend on the equivalent variant of its contents.

This purposely does not check that the configuration specifies an APEX
of com.android.art and instead relies on the apex_available property
being set.

Bug: 177892522
Test: m nothing
Change-Id: I75a8238546b01e1f166a1d1444215f4afb441780
2021-03-29 17:13:29 +01:00
Paul Duffin e06a34d148 Merge "Add bootclasspath_fragment as an alias for boot_image" am: 755b10fe53 am: 0c541b7c1d am: 3e56890e1d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1655217

Change-Id: I8e7eea3b7e1b1b0a47e24c800ffce33f9943e107
2021-03-29 15:42:23 +00:00
Paul Duffin 9139488505 Merge "Make apex/boot_image_test.go more realistic" am: 1b3d4923c1 am: 86ce9334bf am: a4749563a0
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1652448

Change-Id: I8e8c608d4e0215e41ce151271af00a0a58fcb7f5
2021-03-29 14:19:47 +00:00
Paul Duffin 815e678497 Merge "Prune test preparers in apex/boot_image_test.go" am: 0839101430 am: 9d0d498922 am: 74d71d7848
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1652447

Change-Id: Ie996b7282450f3b564f9a1eb2e1d501cb094e736
2021-03-29 10:52:47 +00:00
Paul Duffin 8692ee5aec Merge "Prevent apex from using preferred prebuilt_boot_image" am: fed8df3424 am: d1255ed19a am: 53a2dcc01c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1647168

Change-Id: I18db745fe57692c288ae83fed482852f6522803e
2021-03-29 10:52:40 +00:00
Paul Duffin 4b64ba05b6 Add bootclasspath_fragment as an alias for boot_image
This is part of the work to rename boot_image to bootclasspath_fragment
which is being done for two reasons:
1. To avoid clashing with the bootimg module type.
2. To better reflect what this represents.

While a bootclasspath_fragment can create what ART calls a boot image
(which is different to what the bootimg module type represents) it does
not have to do so.

Bug: 177892522
Test: m nothing
Change-Id: Ib45604be7adc790ded9e27a2ac812dd7522ca8db
2021-03-29 11:05:55 +01:00
Paul Duffin 9ea71c0f4f Make apex/boot_image_test.go more realistic
Previously it was unrealistic because the "boot" image cannot be added
to an apex (because it references modules from multiple different
apexes). Only the "art" image can be added to an apex. So, this change
switches to use the "art" image which requires the apex name is changed
to "com.android.art".

This change also adds an equivalent test for prebuilt_boot_image as
well as a check of the module dependencies for the mybootimage module.

Bug: 177892522
Test: m nothing
Change-Id: I20089b02c80bedc072dbb950dce09bc4e8397f3a
2021-03-29 11:05:55 +01:00
Paul Duffin 52bfaa43f9 Prune test preparers in apex/boot_image_test.go
Cut down the preparers to only those needed by these tests.

Bug: 177892522
Test: m nothing
Change-Id: I811977b0331dd38c25623aa96e09e85ba5cf7c57
2021-03-28 23:02:18 +01:00
Paul Duffin 396229f7cf Prevent apex from using preferred prebuilt_boot_image
Bug: 177892522
Test: m nothing
Change-Id: I8530ffa4c5123f6055a6ca25421c17bb6fc037f0
2021-03-28 23:02:18 +01:00
Martin Stjernholm 4e6c269de5 Don't use APEX stubs between internal libs in the same APEX when
building test_for modules.

This extends the current approach where test modules always depend on
the platform variants of the APEX libs, and only skips the stubs on
them. It still has the limitation that the internal libs must have the
exact same apex_available lists.

Also some improvement of the test accuracy in TestTestFor.

Test: m libartagent-target
  with http://r.android.com/q/topic:libdexfile-noext applied
Bug: 183217299
Change-Id: I2118b8a22c887077867a3ddbbe73437b4a29a6ad
2021-03-28 22:06:34 +01:00
Paul Duffin c5296cd586 Merge "Disallow non-existent paths in sdk package" am: 863ecfb7ba am: a48aed59ee am: 146b43cc63
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1647171

Change-Id: Ic3aa5af880a293457d5303b362c38421591f55e2
2021-03-25 19:47:49 +00:00
Paul Duffin db462dd987 Disallow non-existent paths in sdk package
Test behavior was changed a while ago so that tests by default ignore
non-existent source paths (unless they explicitly check for/rely on
them). Prior to that CheckSnapshot() could detect when files were
missing from the snapshot but it no longer can.

This change disallows non-existent source files in all the sdk tests
which means that they are disallowed when processing the snapshots as
they use the same preparers as were used to process the sources.

This caused a test failure which has been temporarily ignored and has
a TODO and bug associated with it.

Bug: 183184375
Test: m nothing
Change-Id: I969d8515d20ef5ae515f2b5f93d8ed4e4f8ede75
2021-03-25 12:53:22 +00:00
Paul Duffin c80f01ee04 Merge "Convert test that disallows non existent paths to use fixtures" am: e742ee14f8 am: 4a08263f48 am: cd3cc29952
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1647169

Change-Id: I2e08b61169a01a256e87da0d5ff338c83751814f
2021-03-25 10:52:55 +00:00
Paul Duffin 49ed211c7a Merge "Cleanup usages of Dex2oatDepTag" am: 958408d921 am: 15204cf1ea am: 6a8ac75e6a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1652452

Change-Id: If6f759f545421848c466659e1cd8ccc80ef50e4b
2021-03-24 23:51:28 +00:00
Paul Duffin 76e5c8a37f Convert test that disallows non existent paths to use fixtures
This change needed to add some additional files to the registered
files for PrepareForTestWithJavaDefaultModules because otherwise they
would fail when "TestAllowNonExistentPaths = false". Those files were
being added by the TestJavaLintRequiresCustomLintFileToExist (albeit in
some cases in different locations to that required by the default
modules but as the files are needed by the modules defined in
PrepareForTestWithJavaDefaultModules they should be defined in it.

A couple of other places also provided some files so moving them into
PrepareForTestWithJavaDefaultModules caused some conflicts which needed
to be resolved.

Bug: 183184375
Test: m nothing
Change-Id: I76ce9f1673c1c1c4000635b76b8377d582224bf1
2021-03-24 22:08:05 +00:00
Paul Duffin b506c9dc11 Cleanup usages of Dex2oatDepTag
Creates a new deptag type for it so that it can implement the marker
interfaces that will exclude it from being added to the APEX and from
visibility enforcement. The latter is probably not an issue ATM because
the dependencies are added after visibility checks are enforced but
this code is undergoing lots of refactoring so that may change.

Bug: 177892522
Test: m nothing
Change-Id: Ibd167d557adec761a2e3eed78f4d334c40a04fb9
2021-03-24 14:34:40 +00:00
Paul Duffin 9a7e792892 Remove emptyFixtureFactory from apex and java am: 70d3bee3e0 am: 752a5a2122 am: 231efa2172
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1647204

Change-Id: Ie33180b91d67f4b178c44fd9ad526e00f74e263a
2021-03-23 00:01:31 +00:00
Paul Duffin c08e88340b Merge "Ensure that DepIsInSameApex is not called for ExcludeFromApexContentsTag" am: 6bef6fee3c am: abe8504ce1 am: 38a15cd52c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1645680

Change-Id: I9f42df334b69ce45f16ad610ee322230985a02d7
2021-03-22 20:38:29 +00:00
Paul Duffin 70d3bee3e0 Remove emptyFixtureFactory from apex and java
Bug: 183235980
Test: m nothing
Change-Id: I350b45e2f57430fb158f4141a566e75de17208cd
2021-03-22 18:31:53 +00:00
Paul Duffin 6bef6fee3c Merge "Ensure that DepIsInSameApex is not called for ExcludeFromApexContentsTag" 2021-03-22 18:30:10 +00:00
satayev 670ae1967f Merge changes from topic "move_allowed_deps_txt" am: 2b077baa5e am: 0ee372ad6f am: 3c5d96925f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1645088

Change-Id: I568df8371fb3eab090d417469c9d78a27be9d527
2021-03-22 12:45:29 +00:00
satayev 2b077baa5e Merge changes from topic "move_allowed_deps_txt"
* changes:
  Treat allowed_deps.txt source file as optional.
  Move allowed_deps.txt to packages/modules/common.
2021-03-22 10:48:45 +00:00
Paul Duffin cba0e1518f Merge "Cleanup the now unused testCustomizer" am: 50e49818a3 am: a1cf464f06 am: 605946671c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1647199

Change-Id: Ieecab8e619eb27345b86269692a31a1ada75eb57
2021-03-22 10:00:22 +00:00
Paul Duffin 7ae8fc2a6c Merge "Convert test specific customizers to FixturePreparers" am: b535616a84 am: b7f2455646 am: 3fa8037bde
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1647198

Change-Id: I6df4da9131ce4da86babe0d7977dcb04fcf0a8ba
2021-03-22 10:00:14 +00:00
Paul Duffin 710c370485 Merge "Convert shared customizer functions to return FixturePreparers" am: 7ba0448314 am: 47e8b9af4e am: 85ca23b70e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1647197

Change-Id: I223001416be6cc38c55ae4415536a0740a43e48f
2021-03-22 10:00:05 +00:00
Paul Duffin 992c564089 Merge "Allow test handlers to be either FixturePreparer or testCustomizer" am: 241f547365 am: 8381f3c74e am: d80d2f227a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1629633

Change-Id: Idd57f47b037c65dbcd4f106b5fcd4b7413c5fe1a
2021-03-22 09:59:56 +00:00
Paul Duffin 1c62e2eaa6 Merge "Convert apex/boot_image_test.go to use test fixtures" am: 043427b276 am: e20b5ea05e am: 8b92fdf019
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1626508

Change-Id: Ie9919a542222bf117b50cbc4385f7309bea723ae
2021-03-22 09:59:47 +00:00
Paul Duffin 40931a80f3 Merge "Switch testApex and related methods to use test fixtures" am: 32b0e07228 am: 7b1a647d0d am: 0cd1c99cbd
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1626507

Change-Id: If591adb259ad8a8e7039bb283743b89c34b848f8
2021-03-22 09:59:38 +00:00
Paul Duffin 605946671c Merge "Cleanup the now unused testCustomizer" am: 50e49818a3 am: a1cf464f06
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1647199

Change-Id: I5ad22fc23ae556c01adb415d7639efda1bbb23b9
2021-03-22 09:15:22 +00:00
Paul Duffin 3fa8037bde Merge "Convert test specific customizers to FixturePreparers" am: b535616a84 am: b7f2455646
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1647198

Change-Id: I71c78c371952d89aa742e07f5f412536c554c4c4
2021-03-22 09:15:14 +00:00
Paul Duffin 85ca23b70e Merge "Convert shared customizer functions to return FixturePreparers" am: 7ba0448314 am: 47e8b9af4e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1647197

Change-Id: I3b9cf01007f3cd29bb0e8a363330d3e4ddb960cf
2021-03-22 09:15:07 +00:00
Paul Duffin d80d2f227a Merge "Allow test handlers to be either FixturePreparer or testCustomizer" am: 241f547365 am: 8381f3c74e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1629633

Change-Id: I0187b3dcb18c4bb465b26c52098fcbc6feec6218
2021-03-22 09:15:00 +00:00
Paul Duffin 8b92fdf019 Merge "Convert apex/boot_image_test.go to use test fixtures" am: 043427b276 am: e20b5ea05e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1626508

Change-Id: I261edc986b7f2489fdab0c7f3798d96f4d124933
2021-03-22 09:14:51 +00:00
Paul Duffin 0cd1c99cbd Merge "Switch testApex and related methods to use test fixtures" am: 32b0e07228 am: 7b1a647d0d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1626507

Change-Id: Ic0de1a6802431c736f963e9843a05693d7cee7d4
2021-03-22 09:14:43 +00:00
Paul Duffin 4c3e8e2d67 Ensure that DepIsInSameApex is not called for ExcludeFromApexContentsTag
The ExcludeFromApexContentsTag marker interface was added to avoid
every implementation of DepIsInSameApex() from having to deal with the
special tags, like PrebuiltDepTag. Unfortunately, when adding that
not all calls to DepIsInSameApex() were protected which meant that the
BootImageModule, which panics if it doesn't recognize a tag, was
causing failures. This change documents the need and improves the
consistency.

A follow up change will add a test for this.

Bug: 182992071
Test: m nothing
Change-Id: If0bf9a7447ebf7a0bb0c88e91951a7220d4af45c
2021-03-22 08:43:55 +00:00
Paul Duffin 40b6257dc1 Cleanup the now unused testCustomizer
Bug: 181070625
Test: m nothing
Change-Id: I825e0da53b7fd82f4ef33d7183351c1f2ed8ee23
2021-03-20 11:42:48 +00:00
Paul Duffin 0a49fdca0b Convert test specific customizers to FixturePreparers
Bug: 181070625
Test: m nothing
Change-Id: I1c4b7303a1153b040b7266e95b06d172554dc52a
2021-03-20 11:39:23 +00:00
Paul Duffin 810f33d9ee Convert shared customizer functions to return FixturePreparers
Bug: 181070625
Test: m nothing
Change-Id: I8d09f91a3db23eb36cd73a13e418df98949ec72d
2021-03-20 11:33:03 +00:00
Paul Duffin 2be9dcd3aa Allow test handlers to be either FixturePreparer or testCustomizer
This allows the testCustomizers to be switched to FixturePreparers
incrementally rather than in one go.

Bug: 181070625
Test: m nothing
Change-Id: Idd9d2e28abf9b17fc46b5566ab8d3affa330287e
2021-03-20 10:25:45 +00:00
Paul Duffin 34d433ad7e Convert apex/boot_image_test.go to use test fixtures
Bug: 181070625
Test: m nothing
Change-Id: I940353e32233317d9e932b2d61908125e4c33766
2021-03-20 10:25:45 +00:00
Paul Duffin e05480ac47 Switch testApex and related methods to use test fixtures
Bug: 181070625
Test: m nothing
Change-Id: Icdd9c3d807d5497ef85946a877c6cd4b4af045bc
2021-03-20 10:25:45 +00:00
Justin Yun 43ad83767b Merge "Define __ANDROID_VENDOR__ and __ANDROID_PRODUCT__" am: b1d5479783 am: 2d0020dbbd am: 76e4387707
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1620648

Change-Id: I507c493b93fc1fdfefe7f2d01e50e2c22e036368
2021-03-19 01:50:55 +00:00
Justin Yun 76e4387707 Merge "Define __ANDROID_VENDOR__ and __ANDROID_PRODUCT__" am: b1d5479783 am: 2d0020dbbd
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1620648

Change-Id: Ic0accb0b64f1034ed41ebeb8bc3e583678d114a9
2021-03-19 01:07:17 +00:00
Justin Yun b1d5479783 Merge "Define __ANDROID_VENDOR__ and __ANDROID_PRODUCT__" 2021-03-18 23:33:43 +00:00
Paul Duffin df06ca4ed2 Merge "Prevent ApexInfoMutator from creating unnecessary variants" am: b72dd403de am: 03cf98057f am: 351ae039aa
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1642102

Change-Id: Iecfaa2ee6623155e8bd0a485e59ceb10a75bbc5c
2021-03-18 17:30:03 +00:00
Paul Duffin 351ae039aa Merge "Prevent ApexInfoMutator from creating unnecessary variants" am: b72dd403de am: 03cf98057f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1642102

Change-Id: I395372d6b1088789330644214d8aec41a8a6370a
2021-03-18 16:30:14 +00:00
Paul Duffin c76957fd75 Merge "Add prebuilt_platform_compat_config" am: d5065cfc66 am: c5b7854036 am: 8185bd8586
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1642109

Change-Id: Ifb7ff86d694146b0bbc30ca607bf160cd4ce7911
2021-03-18 15:19:19 +00:00
Paul Duffin d46309e3ad Merge "Correct typo in the name of compatConfigTag" am: 603fa13e08 am: 7eccf3774b am: 0176573920
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1642108

Change-Id: I57c8dda9dfc4eac6d6b1e51de84fb70b01ec6109
2021-03-18 15:16:53 +00:00
Paul Duffin 26b1da534b Merge "Allow apex dependencies to be restricted to source modules only" am: c0a5ccbf3b am: 69f4244007 am: 25703000a5
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1642107

Change-Id: I1aa04096592ef837d29dde57c8a53b117143c9fd
2021-03-18 15:16:46 +00:00
Paul Duffin b72dd403de Merge "Prevent ApexInfoMutator from creating unnecessary variants" 2021-03-18 15:13:39 +00:00
Paul Duffin 8185bd8586 Merge "Add prebuilt_platform_compat_config" am: d5065cfc66 am: c5b7854036
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1642109

Change-Id: I85be48a0c65bc9caa2e2d4b7063ac41ec2581b6c
2021-03-18 13:12:21 +00:00
Artur Satayev b77b0c5e05 Treat allowed_deps.txt source file as optional.
Not all branches have packages/common/module, which breaks the build
for them.

Bug: 179234385
Test: removed allowed_deps.txt && m apex-allowed-deps-check
Change-Id: I38f47c7200e1afbd899e29843d0214bef826fcf9
2021-03-18 11:15:33 +00:00
Paul Duffin 0176573920 Merge "Correct typo in the name of compatConfigTag" am: 603fa13e08 am: 7eccf3774b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1642108

Change-Id: I68e973776e85b2966ca182eb21d9fa4296c2cee0
2021-03-18 09:13:44 +00:00
Paul Duffin 25703000a5 Merge "Allow apex dependencies to be restricted to source modules only" am: c0a5ccbf3b am: 69f4244007
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1642107

Change-Id: I97bdc2f4f20f15bc72708f461eb05d9f2a2e597d
2021-03-18 09:13:38 +00:00
Paul Duffin 573989d821 Prevent ApexInfoMutator from creating unnecessary variants
Adds the AlwaysRequireApexVariantTag interface to enable
ApexInfoMutator to differentiate between a tag that is excluded from
apex contents but still requires an apex variant and a tag that is
excluded from apex contents and does not require an apex variant.

That is needed to support the sdkMemberVersionedDepTag which excludes
the target from being added to the APEX but requires an APEX variant.
A more detailed explanation is in the comments.

The AlwaysRequireApexVariant() method follows the pattern used in
ReplaceSourceWithPrebuilt of having a method that returns a bool to
trigger the behavior and not say ExcludeFromApexContentsTag that simply
relies on the tag implementing an interface to trigger. That is because
the former is more flexible and allows a tag type to parameterize the
behavior if necessary.

The tags that this will exclude from creating an apex variant are:
* PrebuiltDepTag - by the time the apex variant has been created any
  preferred prebuilts will have replaced the sources so there is no
  need to create an APEX variant if the only dependency path from the
  APEX to the prebuilt is via this tag.
* hiddenApiAnnotationsDependencyTag - the target of which is a purely
  build time artifect and MUST NEVER end up in the APEX.

It will also stop calling DepIsInSameApex for any dependency created
by the sdkMemberVersionedDepTag. Which will fix the issue reported in
the bug.

Bug: 182992071
Test: m nothing
Change-Id: I9569e488d6446ca45d3ea8f32a9b74524eb865df
2021-03-18 09:05:28 +00:00
TreeHugger Robot b39e6fa1ad Merge "Move allowed_deps.txt to packages/modules/common." into rvc-qpr-dev-plus-aosp 2021-03-17 21:02:33 +00:00
Paul Duffin 1b29e003f3 Add prebuilt_platform_compat_config
It just provides the metadata needed by the global singleton as the
rest is in the apex.

Bug: 182402754
Test: m nothing
Change-Id: I511df7a3a06dab13ddb9ad63392ae5310dfee9c4
2021-03-17 18:16:31 +00:00
Paul Duffin 0b8177873a Correct typo in the name of compatConfigTag
It was called compatConfigsTag which is inconsistent.

Bug: 182402754
Test: m nothing
Change-Id: I4636d72cee53b361f3b0ab17789e61a439c34edf
2021-03-17 18:16:31 +00:00
Paul Duffin 8c535dad36 Allow apex dependencies to be restricted to source modules only
An upcoming change to create a prebuilt_platform_compat_config module
will break if the apex tries to use it instead of a
platform_compat_config because the former does not provide all the
information that the apex needs. This change will allow the
compatConfigsTag to be configured to prevent the prebuilt from being
used even when it is preferred.

Bug: 182402754
Test: m nothing
Change-Id: Ib9dc06c038f7cf3fc229f3c4d2b025335a4715b4
2021-03-17 18:16:31 +00:00
Artur Satayev f67c06a7f5 Move allowed_deps.txt to packages/modules/common.
Bug: 179234385
Test: run update-apex-allowed-deps.sh locally
Change-Id: I8e8864468b87342c688d001bc5f6e6f8416863ed
Merged-In: I8e8864468b87342c688d001bc5f6e6f8416863ed
2021-03-17 15:26:16 +00:00
Artur Satayev fdb61edf43 Move allowed_deps.txt to packages/modules/common.
Bug: 179234385
Test: run update-apex-allowed-deps.sh locally
Change-Id: I8e8864468b87342c688d001bc5f6e6f8416863ed
Merged-In: I8e8864468b87342c688d001bc5f6e6f8416863ed
2021-03-17 13:44:16 +00:00
TreeHugger Robot a089ef0de4 Merge "Move allowed_deps.txt to packages/modules/common." into sc-dev 2021-03-16 17:45:34 +00:00
Paul Duffin cdf2426d76 Switch platform_compat_config to use common arch am: 4defbf4d39 am: 75c51ba191 am: e9292b1459
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1638281

Change-Id: I43f4b4ff67f19326ba4124a4ed86ef4ce86feaef
2021-03-16 17:30:06 +00:00
Paul Duffin fc0b2c7f6b Disallow platform_compat_config modules in apex prebuilts property am: 1bc21dc7e6 am: c6df3b278a am: 3c54ef1e10
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1638280

Change-Id: I62615c1ed2069dfed50c1a576dbd8f702ece662b
2021-03-16 15:46:29 +00:00
Artur Satayev 8dfcbe466c Move allowed_deps.txt to packages/modules/common.
Bug: 179234385
Test: run update-apex-allowed-deps.sh locally
Change-Id: I8e8864468b87342c688d001bc5f6e6f8416863ed
Merged-In: I8e8864468b87342c688d001bc5f6e6f8416863ed
(cherry picked from commit 732d6264210513b971205b5c9f1b2f49b9cafdf3)
2021-03-16 15:02:55 +00:00
Paul Duffin e9292b1459 Switch platform_compat_config to use common arch am: 4defbf4d39 am: 75c51ba191
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1638281

Change-Id: I213738e09bee4613f93203b0dd6e935b07957114
2021-03-16 14:45:28 +00:00
Paul Duffin 3c54ef1e10 Disallow platform_compat_config modules in apex prebuilts property am: 1bc21dc7e6 am: c6df3b278a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1638280

Change-Id: I3994109c2acb934d2be6039d8fdbf556b4783774
2021-03-16 14:45:17 +00:00
Paul Duffin c605053f97 Add new compat_configs property to the apex am: 3abc174cfd am: d4716ce5a6 am: f75ab18b5b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1638279

Change-Id: I2cd91954b7fba10e1c5cbbef194fc365b3103745
2021-03-16 10:11:22 +00:00
Paul Duffin a13f1c8dc0 Convert TestCompatConfig test to use test fixtures am: a369c7b50d am: 28cae4ca6f am: 6fb02328eb
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1626505

Change-Id: I852b9b300a6e98c765e3c968023399b1152faa20
2021-03-16 09:51:45 +00:00
Paul Duffin f75ab18b5b Add new compat_configs property to the apex am: 3abc174cfd am: d4716ce5a6
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1638279

Change-Id: I3822016f85c030f27820538ba133ec007861417c
2021-03-16 08:05:09 +00:00
Paul Duffin 6fb02328eb Convert TestCompatConfig test to use test fixtures am: a369c7b50d am: 28cae4ca6f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1626505

Change-Id: Ief32c21320ead2b92f47b3e485e2c3736290903f
2021-03-16 08:05:05 +00:00
Paul Duffin 4defbf4d39 Switch platform_compat_config to use common arch
Bug: 182816033
Test: m nothing
Change-Id: If8886edd9278d67fe2b6288a6bd8b152f2314401
2021-03-15 23:19:39 +00:00
Paul Duffin 1bc21dc7e6 Disallow platform_compat_config modules in apex prebuilts property
Bug: 182816033
Test: m nothing
Change-Id: I50dcc358e8ae143e21b1fbf1a12835bf1342606f
2021-03-15 23:19:39 +00:00
Paul Duffin 3abc174cfd Add new compat_configs property to the apex
Bug: 182816033
Test: m nothing
Change-Id: I485d7b178c0ed17e336a6ac2a13e8313426f374b
2021-03-15 23:19:36 +00:00
Paul Duffin a369c7b50d Convert TestCompatConfig test to use test fixtures
As this test is the only test in the apex package to use the
platform_compat_config module type it does not make sense to include
that in all the tests so instead this converts the test to use fixtures
so it can easily customize it with the additional module type.

Bug: 181070625
Test: m nothing
Change-Id: I56fda772ee336db6cfb677143aa28b1a18911bff
2021-03-15 19:56:38 +00:00
satayev b5c1a74f5d Merge "Don't track modules that are only available to APEXes." am: 2338d6f6e4 am: ebfe02a781 am: 13c655bf29
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1628693

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I8794765359558cfee7c9d1cb2ef74674a244f283
2021-03-15 14:11:23 +00:00
satayev 13c655bf29 Merge "Don't track modules that are only available to APEXes." am: 2338d6f6e4 am: ebfe02a781
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1628693

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I468324eaa0ed012feba41cbf99809c8bd6ea397c
2021-03-15 13:28:54 +00:00
Paul Duffin 8a63b042d5 Merge "Convert ...InstallHwasan.. tests to use fixtures" am: ef0449b0f3 am: feed9a6153 am: 972e1eafe0
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1626503

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I5d49be067f9984b1497dde48d39a4b25d9dda6a3
2021-03-15 12:55:23 +00:00
satayev 2338d6f6e4 Merge "Don't track modules that are only available to APEXes." 2021-03-15 12:47:00 +00:00
Paul Duffin 972e1eafe0 Merge "Convert ...InstallHwasan.. tests to use fixtures" am: ef0449b0f3 am: feed9a6153
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1626503

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I198ca31959a9f549af19344c136b30d6efd4cbe8
2021-03-15 12:12:47 +00:00
Paul Duffin ef0449b0f3 Merge "Convert ...InstallHwasan.. tests to use fixtures" 2021-03-15 11:09:22 +00:00
Nicolas Geoffray d45fa2d8ba Merge "Treat core_platform as stable unless module uses legacy" am: fb856f6add am: b684567a46 am: 5a8f6c5c96
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1619411

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I5a43ed15e67d55c3e05d09698ca73520ef185745
2021-03-15 10:38:11 +00:00
Nicolas Geoffray 5a8f6c5c96 Merge "Treat core_platform as stable unless module uses legacy" am: fb856f6add am: b684567a46
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1619411

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I501e1099d77697b34c70f13b064840b94424d52d
2021-03-15 09:57:43 +00:00
Nicolas Geoffray fb856f6add Merge "Treat core_platform as stable unless module uses legacy" 2021-03-15 08:42:43 +00:00
Justin Yun 13decfb0bb Define __ANDROID_VENDOR__ and __ANDROID_PRODUCT__
__ANDROID_VNDK__ is defined for the modules that are able to use the
VNDK libraries. As both product and vendor variants define
__ANDROID_VNDK__, we don't know if a module is built for vendor or
product on build time.

__ANDROID_VENDOR__ and __ANDROID_PRODUCT__ macros can be used to
specify the image-variant-dependent codes.

Bug: 180646847
Test: m nothing
Change-Id: Id6c3e1e3d47deaf3684c0c02964718658cf2fec5
2021-03-15 17:28:59 +09:00
Paul Duffin a02cae345b Convert ...InstallHwasan.. tests to use fixtures
These tests rely on changing the definition of the "libc" module which
is a default module provided by the cc.GatherRequiredDepsForTest()
function. That function is called from within testApexContext() and so
added by default.

Previously, the tests relied on a number of factors to work:
1. All the default cc modules were added to the bp contents that were
   passed to testApexContext().
2. testApexContext() passed the augmented bp contents to
   TestArchConfig().
3. TestArchConfig() only stored the supplied bp contents in the root
   Android.bp file if it did not exist.

So, in order to override the default modules it simply made sure to add
its own Android.bp file into the file system first.

Unfortunately, that does not work with the test fixtures as the default
modules are defined in their own specific paths to avoid conflicting
with each other. To achieve the same effect as previously, i.e. no
default modules, this test uses an emptyFixtureFactory and only adds
preparers for cc and apex build components and ignores the default
module definitions altogether.

Bug: 181070625
Test: m nothing
Change-Id: Ic6b961dd2bd78c32cb326b2c7905426ee971c2d8
2021-03-12 18:26:41 +00:00
TreeHugger Robot 84c192f566 Merge "Allow ExtServices to use tflite_support" into mainline-prod am: 9c2890cac3
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/13806986

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I17909dd25cecc0cd284becc274311feabe7cfac3
2021-03-12 17:19:25 +00:00
TreeHugger Robot 9c2890cac3 Merge "Allow ExtServices to use tflite_support" into mainline-prod 2021-03-12 16:43:07 +00:00
Lev Proleev a2f2edcb68 Merge "Add libruy_static to allowed_deps" am: f6b5f8217c am: 894c8eb61b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1610793

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Icb0b3dd46d8e5aec6d5c1aadd1943a8b3f7a1fcd
2021-03-12 15:14:56 +00:00
Lev Proleev f6b5f8217c Merge "Add libruy_static to allowed_deps" 2021-03-12 14:00:45 +00:00
Paul Duffin d03f6a868f Merge changes Ifc96992e,Ic76523ba am: c10ee77ea6 am: b1ef3e2ce9 am: b587704556
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1628691

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I15bfdaef65a848ec6ed0210c883195409ce85814
2021-03-12 09:44:13 +00:00
Paul Duffin b587704556 Merge changes Ifc96992e,Ic76523ba am: c10ee77ea6 am: b1ef3e2ce9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1628691

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I7f98cabe5a6ddae90458f7dc8a8b1725095493f4
2021-03-12 09:02:39 +00:00
Sophie Zheng 663778c712 Merge "Fix getting list of module libraries in builder.go" into mainline-prod 2021-03-11 23:38:08 +00:00
Artur Satayev 533b98cde3 Don't track modules that are only available to APEXes.
Modules that are not available for platform are developed with
updatability in mind, and do not require manual approvals.

Bug: 181223240
Test: checkbuild
Change-Id: I10b91053b3ef5a9ff5400d9d7a68fae3144a671c
2021-03-11 18:13:18 +00:00
Paul Duffin 37aad60507 Add apexFixtureFactory to apex package
Unlike the similar changes in other packages this change separates the
addition of the fixture factory and the conversion of the test...
methods to use them as there are a few tests that need converting to
use test fixtures first.

Bug: 181070625
Test: m nothing
Change-Id: Ic76523ba89fc1967631aeb682935935b5af116df
2021-03-11 17:25:29 +00:00
Artur Satayev ff36f17b40 Introduce derive_classpath service.
go/updatable-classpath

Bug: 180105615
Test: manual + boot test
Change-Id: I713b3b881e2214f2994e1830580ae1122d7c5c3d
2021-03-11 11:46:28 +00:00
Chen Xu 42be01b733 Merge "include new settings lib to the apex-dependency allow list" into sc-dev 2021-03-11 04:51:40 +00:00
Paul Duffin e5e761eab2 Merge "Avoid calling DepIsInSameApex when excluded from apex contents" am: 9c2e6d50b4 am: 46a694ba85 am: 4ea76e8caf
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1626500

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ib6248a20ea0b929286691a083fa5e5a93ea65285
2021-03-11 03:04:16 +00:00
Paul Duffin 4ea76e8caf Merge "Avoid calling DepIsInSameApex when excluded from apex contents" am: 9c2e6d50b4 am: 46a694ba85
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1626500

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: If3b078034869c482a624c66b1093fb97e0ae6871
2021-03-11 02:19:40 +00:00
Treehugger Robot 215725913c Merge "update apex/allowed_deps.txt" 2021-03-11 01:35:46 +00:00
Paul Duffin 9c2e6d50b4 Merge "Avoid calling DepIsInSameApex when excluded from apex contents" 2021-03-10 23:30:48 +00:00
Paul Duffin d3bf0fad8f Merge "Extract apex registration code into function for reuse" am: 3d3f7a0c3f am: 5dccf644f1 am: 0f9e7887fa
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1625379

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I5ea84198248eab3591b7b065b065478ac400bd01
2021-03-10 21:00:54 +00:00
Paul Duffin 0f9e7887fa Merge "Extract apex registration code into function for reuse" am: 3d3f7a0c3f am: 5dccf644f1
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1625379

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I2c20a0a5a5fed0aae8cdbdb678f09474e09d8324
2021-03-10 20:12:30 +00:00
sophiez fdfe8f74fd Fix getting list of module libraries in builder.go
Replace f.stem to f.Stem() method otherwise empty libNames get passed
in.

Fixes:181991887

Test: DIST_DIR=~/my_dist_dir TARGET_BUILD_VARIANT=userdebug PRODUCT=mainline_modules_x86 ./vendor/google/build/build_unbundled_coverage_mainline_module.sh -j80

Change-Id: I3384f3a73c5637928584b9d87b2f936116a8f15e
Merged-In: Ie1799c0972d63da823ad375f008018de782529d1
2021-03-10 19:27:54 +00:00
Paul Duffin 3d3f7a0c3f Merge "Extract apex registration code into function for reuse" 2021-03-10 17:31:13 +00:00
Paul Duffin e9612824ea Avoid calling DepIsInSameApex when excluded from apex contents
While debugging an issue with some work I was doing on boot image
modules I noticed that markPlatformAvailability() is calling
DepIsInSameApex() even when the dependency tag indicates that it is
excluded from the apex contents.

Test: m droid
Change-Id: Iac49049546a886f7a3a0d9640ffd31ce24c61364
2021-03-10 16:44:57 +00:00
Paul Duffin 043f5e7881 Treat core_platform as stable unless module uses legacy
The sdk_version: "core_platform" refers to the stable core platform
unless the module is in the exception list. This change makes sure that
CheckStableSdkVersion() reflects that behavior.

Bug: 180399951
Test: m nothing
Change-Id: Ia0b1e13322352b87f5a3c6621e37f23ba637ffb6
2021-03-10 13:04:03 +00:00
Jeongik Cha 5225ca9434 update apex/allowed_deps.txt
Bug: 150578172
Test: m
Change-Id: I0ea6b33c2d27081a5f0622edb0f5df4088a71455
Merged-In: I0ea6b33c2d27081a5f0622edb0f5df4088a71455
2021-03-10 09:16:14 +09:00
Paul Duffin 667893c657 Extract apex registration code into function for reuse
Test: m nothing
Change-Id: Id2c918891ecd9e874004f6828f71374bf0cdb9e4
2021-03-09 23:03:40 +00:00
TreeHugger Robot 98a2c750dd Merge "update apex/allowed_deps.txt" into mainline-prod 2021-03-09 22:03:39 +00:00
Jooyung Han 7eb6684058 Merge "Run "prebuilt_postdeps" mutator again" am: 77e7d7769e am: 1226de1315 am: b2821d6c8c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1620647

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I68944034e6b09d866466fb10d7caf7c0539de6ec
2021-03-09 18:23:21 +00:00
Jooyung Han b2821d6c8c Merge "Run "prebuilt_postdeps" mutator again" am: 77e7d7769e am: 1226de1315
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1620647

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I8fec1a135d285d296ce4121a725a64f443fc0f51
2021-03-09 17:38:39 +00:00
Jooyung Han 77e7d7769e Merge "Run "prebuilt_postdeps" mutator again" 2021-03-09 16:21:33 +00:00
Tony Mak 9418d6747f Allow ExtServices to use tflite_support
tflite_support provides some tflite ops and utils functions.

> How big is the binary size increase for affected APEXes?
+100K
> Is the new dependency committed to support previous platform releases?
note that you have to support all the releases starting from the minSdkVersion value you are declaring
Yes.
> Is the new dependency being developed AOSP-first or internal?
AOSP-first. We don't "develop" it there tho.
We import the code from github and the library is developed by another
team in google.
> What’s the testing strategy for the new dependency? Does it have its own tests, and are you adding integration tests?
We test the library with our own unit and integration tests.

Bug: 169147920

Test: build/soong/scripts/update-apex-allowed-deps.sh

Change-Id: Ic15226dd36dce98f9a3e54672353f87adcc6312f
2021-03-09 12:02:00 +00:00
Treehugger Robot f58582a3c1 Merge "Introduce derive_classpath service." am: c285125110 am: eb4bc50101
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1614805

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I79df795b34714b5f12c2d34302096c40672ca1f5
2021-03-09 11:50:04 +00:00
Treehugger Robot c285125110 Merge "Introduce derive_classpath service." 2021-03-09 10:23:49 +00:00
TreeHugger Robot f053d84257 Merge "update apex/allowed_deps.txt" into sc-dev 2021-03-09 07:14:19 +00:00
Jooyung Han 86feead0d5 Run "prebuilt_postdeps" mutator again
Because OverridablePropertiesDepsMutator is run after prebuilt_postdeps,
prebuilt's replacement doesn't affect to those deps added by overridable
properties.

By running prebuilt_postdeps again after
OverridablePropertiesDepsMutator, replacing source with prebuilts is
applied to those deps.

Bug: 152155285
Bug: 181953909
Bug: 181974714
Test: m nothing
Change-Id: I24acc02785c9580c2beca096042f1173eb28ba9a
2021-03-09 11:23:46 +09:00
Artur Satayev ce06cc0c25 Introduce derive_classpath service.
go/updatable-classpath

Bug: 180105615
Test: manual + boot test
Change-Id: If0a3cb00754834133abea12caff3fdc5b7cff696
Merged-In: If0a3cb00754834133abea12caff3fdc5b7cff696
2021-03-09 00:11:13 +00:00
TreeHugger Robot 2970f7ea17 Merge "Introduce derive_classpath service." into sc-dev 2021-03-09 00:00:51 +00:00
Colin Cross cbd14768a4 Merge "Remove extra return value from testApex" am: 110bca5bd1 am: f686c21c3b am: bbf3dcf9ec
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1590978

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I0e904bf0966fcf1f402daeba5b79486d725c5b35
2021-03-08 20:15:03 +00:00
Colin Cross bbf3dcf9ec Merge "Remove extra return value from testApex" am: 110bca5bd1 am: f686c21c3b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1590978

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ie3887d404da1c6be15e591ecc389cab72826bef5
2021-03-08 19:28:35 +00:00
Colin Cross 110bca5bd1 Merge "Remove extra return value from testApex" 2021-03-08 18:16:23 +00:00
Artur Satayev 74030452b6 Introduce derive_classpath service.
go/updatable-classpath

Bug: 180105615
Test: manual + boot test
Merged-In: If0a3cb00754834133abea12caff3fdc5b7cff696
Change-Id: If0a3cb00754834133abea12caff3fdc5b7cff696
2021-03-08 18:06:59 +00:00
Artur Satayev 92f7874e82 Introduce derive_classpath service.
go/updatable-classpath

Bug: 180105615
Test: manual + boot test
Change-Id: If0a3cb00754834133abea12caff3fdc5b7cff696
2021-03-08 18:03:59 +00:00
TreeHugger Robot e7b67eb018 Merge "Add statslog_media dependency to media module." into sc-dev 2021-03-08 18:01:32 +00:00
Anton Hansson 6b9ef0da30 Merge "Allow PermissionController to set min_sdk_version to 30." am: 921a89e376 am: 328bb54dab
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1621413

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I9c278a129377a25f011353e400826006ecb74865
2021-03-08 12:24:02 +00:00
Anton Hansson 921a89e376 Merge "Allow PermissionController to set min_sdk_version to 30." 2021-03-08 11:18:16 +00:00
Paul Duffin 1c58ce4a52 Merge "Fix mutator ordering issue in apex tests" am: 97c8128eea am: d8033e1d26 am: e672daac6b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1621415

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ifa3b28737bcf55fb5ccda37e3e4dec4973cf8e34
2021-03-06 09:56:43 +00:00
Paul Duffin e672daac6b Merge "Fix mutator ordering issue in apex tests" am: 97c8128eea am: d8033e1d26
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1621415

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I84cb412a6a78c132107f962e3d746f7c5941c2e3
2021-03-06 09:06:03 +00:00
Linus Nilsson 2cb4b01f1f Add statslog_media dependency to media module.
To support logging transcoding metrics to westworld
a small auto generated wrapper lib is needed to
send structured data to statsd.

Bug: 179274112
Test: Will verify build with presubmit
Change-Id: I9b3a0b1825b7acb9859b92b9a52b3550e31ef1f1
2021-03-05 21:52:30 +00:00
Paul Duffin 6d119b804c Fix mutator ordering issue in apex tests
Previously, the override mutators were being run before the prebuilt
mutators that did not match the runtime behavior. This change fixes
that ordering.

In the process it broke TestApexWithAppImportsPrefer. That test tries
to verify that an apex that depends on an android_app will use an
android_app_import if that is preferred. Unfortunately, it only worked
because of the incorrect order of the mutators.

The test worked before this change because the prebuilt mutators were
being run after the overridableModuleDepsMutator. That meant that any
dependencies added by that mutator onto source modules could be
replaced by the PrebuiltPostDepsMutator with the preferred prebuilt
module.

Switching the order to match the runtime meant that the prebuilt
mutators were run before the overrides so never had a chance to replace
the dependencies added by the overrides.

Bug: 181953909
Bug: 181974714
Test: m nothing
Change-Id: Ic98fdc29a63155174a3227e7e918b26f0a8763bb
2021-03-05 18:38:58 +00:00
Hai Zhang 9bb022a4aa Allow PermissionController to set min_sdk_version to 30.
PermissionController is updatable since R, so its minimum SDK version
should be 30.

Bug: 174770904
Test: build
Merged-In: I5c98dc0053687bd4601ab06f6e092aeb851cdba7
Change-Id: I5c98dc0053687bd4601ab06f6e092aeb851cdba7
2021-03-05 17:46:25 +00:00
Jeongik Cha 480762d78b update apex/allowed_deps.txt
Bug: 150578172
Test: m
Change-Id: I0ea6b33c2d27081a5f0622edb0f5df4088a71455
Merged-In: I0ea6b33c2d27081a5f0622edb0f5df4088a71455
2021-03-05 21:47:22 +09:00
Jeongik Cha c38777cb75 update apex/allowed_deps.txt
Bug: 150578172
Test: m
Change-Id: I0ea6b33c2d27081a5f0622edb0f5df4088a71455
Merged-In: I0ea6b33c2d27081a5f0622edb0f5df4088a71455
2021-03-05 21:39:17 +09:00
Jeongik Cha 555752f09e update apex/allowed_deps.txt
Bug: 150578172
Test: m
Change-Id: I0ea6b33c2d27081a5f0622edb0f5df4088a71455
2021-03-05 21:10:19 +09:00
Treehugger Robot e26cd8f5a0 Merge "Friendly error message on apex_available and min_sdk_version checks" am: 4a349ab66b am: 5bb26755f9 am: 0aa0afdfe2
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1614908

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ic88794c361b576be6032298dbca76173bd08331e
2021-03-05 06:22:49 +00:00
Treehugger Robot 0aa0afdfe2 Merge "Friendly error message on apex_available and min_sdk_version checks" am: 4a349ab66b am: 5bb26755f9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1614908

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ia42eb7ea29401fc53c188ded76315072080b85cd
2021-03-05 05:57:35 +00:00
Treehugger Robot 4a349ab66b Merge "Friendly error message on apex_available and min_sdk_version checks" 2021-03-05 03:30:11 +00:00
Makoto Onuki 4d32bcd77f Merge "Remove myself from the OWNERS" am: e9d0de4932 am: f8a09af582 am: fe185ffa11
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1615279

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: If45c9aa7034e62829fd33e0a0e03cfa8920ba4fe
2021-03-04 19:21:20 +00:00
Makoto Onuki fe185ffa11 Merge "Remove myself from the OWNERS" am: e9d0de4932 am: f8a09af582
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1615279

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I78ebb78934af20071071cbdd96625899c5c8e9fe
2021-03-04 18:57:34 +00:00
Makoto Onuki e9d0de4932 Merge "Remove myself from the OWNERS" 2021-03-04 17:04:53 +00:00
Chen Xu 6618f04006 include new settings lib to the apex-dependency allow list
Bug: 177638076
Test: Manual
Change-Id: Ib686d0aed0d985eb5452859774a31e398cda2795
2021-03-04 18:03:21 +08:00
Lukács T. Berki 213810ca19 Merge "cd to / before running soong_build ." am: ddebd2c82a am: db9632fbd0 am: 13dac96f2c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1609473

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I1416378dec2959c10b37b6bea847bc2fd7c93027
2021-03-04 09:41:49 +00:00
Lukács T. Berki 13dac96f2c Merge "cd to / before running soong_build ." am: ddebd2c82a am: db9632fbd0
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1609473

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I6fb83ce60ddefcfdff85db83c05a9fc45dc27a9c
2021-03-04 08:37:36 +00:00