Commit graph

1534 commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
b1d5479783 Merge "Define __ANDROID_VENDOR__ and __ANDROID_PRODUCT__" 2021-03-18 23:33:43 +00:00
Paul Duffin
b72dd403de Merge "Prevent ApexInfoMutator from creating unnecessary variants" 2021-03-18 15:13:39 +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
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
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
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
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
2338d6f6e4 Merge "Don't track modules that are only available to APEXes." 2021-03-15 12:47:00 +00:00
Paul Duffin
ef0449b0f3 Merge "Convert ...InstallHwasan.. tests to use fixtures" 2021-03-15 11:09:22 +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
Lev Proleev
f6b5f8217c Merge "Add libruy_static to allowed_deps" 2021-03-12 14:00:45 +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
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
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
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
Jooyung Han
77e7d7769e Merge "Run "prebuilt_postdeps" mutator again" 2021-03-09 16:21:33 +00:00
Treehugger Robot
c285125110 Merge "Introduce derive_classpath service." 2021-03-09 10:23:49 +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
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
Anton Hansson
921a89e376 Merge "Allow PermissionController to set min_sdk_version to 30." 2021-03-08 11:18:16 +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
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
e9d0de4932 Merge "Remove myself from the OWNERS" 2021-03-04 17:04:53 +00:00
Lukács T. Berki
ddebd2c82a Merge "cd to / before running soong_build ." 2021-03-04 07:07:02 +00:00
Jiyong Park
767dbd9d3b Friendly error message on apex_available and min_sdk_version checks
1) suggest a fix at the end of the message
2) add new lines around the dependency path so that they are visually
separated from rest of the error message

Bug: N/A
Test: m with an intentional break
error: bionic/apex/Android.bp:32:1: module "com.android.runtime" variant "android_common_com.android.runtime_image": "libutils_headers" requires "libsystem_headers" that doesn't list the APEX under 'apex_available'.

Dependency path:
           via tag apex.dependencyTag: { name:executable payload:true}
    -> crash_dump{os:android,image:,arch:arm_armv8-a,sdk:,apex:apex10000}
           via tag cc.libraryDependencyTag: { Kind:staticLibraryDependency Order:normalLibraryDependency wholeStatic:false reexportFlags:false explicitlyVersioned:false dataLib:false ndk:false staticUnwinder:false makeSuffix: skipApexAllowedDependenciesCheck:false excludeInApex:false}
    -> libtombstoned_client_static{os:android,image:,arch:arm_armv8-a,sdk:,link:static,apex:apex10000}
           via tag cc.libraryDependencyTag: { Kind:staticLibraryDependency Order:normalLibraryDependency wholeStatic:true reexportFlags:true explicitlyVersioned:false dataLib:false ndk:false staticUnwinder:false makeSuffix: skipApexAllowedDependenciesCheck:false excludeInApex:false}
    -> libcutils{os:android,image:,arch:arm_armv8-a,sdk:,link:static,asan:,apex:apex10000}
           via tag cc.libraryDependencyTag: { Kind:headerLibraryDependency Order:normalLibraryDependency wholeStatic:false reexportFlags:false explicitlyVersioned:false dataLib:false ndk:false staticUnwinder:false makeSuffix: skipApexAllowedDependenciesCheck:false excludeInApex:false}
    -> libutils_headers{os:android,image:,arch:arm_armv8-a,sdk:,asan:,apex:apex10000}
           via tag cc.libraryDependencyTag: { Kind:headerLibraryDependency Order:normalLibraryDependency wholeStatic:false reexportFlags:true explicitlyVersioned:false dataLib:false ndk:false staticUnwinder:false makeSuffix: skipApexAllowedDependenciesCheck:false excludeInApex:false}
    -> libsystem_headers{os:android,image:,arch:arm_armv8-a,sdk:,asan:,apex:apex10000}

Consider adding "com.android.runtime" to 'apex_available' property of "libsystem_headers"

Change-Id: I09f92c3086ea433780133a33ba0ad73baee6dc41
2021-03-04 13:07:36 +09:00
Xin Li
cbcc5b7179 Merge "Merge RQ2A.210305.007" 2021-03-03 21:41:40 +00:00
Xin Li
2964583d62 Merge RQ2A.210305.007
Bug: 180401296
Merged-In: I422ccc35977e0be846bb7a3497a50c2fc2c42e92
Change-Id: I230429666794c8218e515099292600d77a4b9604
2021-03-03 09:12:01 -08:00
Makoto Onuki
55418f8c37 Remove myself from the OWNERS
Bug: n/a
Test: n/a
Change-Id: I84f09ac8dc619921d4f8adfc3ea56f5ee01510a2
2021-03-03 08:21:17 -08:00
Lev Proleev
d152f5b0ed Add libruy_static to allowed_deps
To be used in NNAPI apex as part of TF Lite.

Bug: 178609672
Test: m
Change-Id: Iaf623823e85e7488e30b3dcf2592d1a90bf9fc9f
Merged-In: Iaf623823e85e7488e30b3dcf2592d1a90bf9fc9f
2021-03-03 10:55:26 +00:00
Mathew Inwood
f8dcf5ead2 Make apex.updatable default to true.
Update tests accordingly and add a new test case for this.

Bug: 180375550
Test: Treehugger
Change-Id: I835e189f4dae1e4bc79dce7bc59b7b9c7bd19fd9
2021-03-03 10:28:26 +00:00
Lukacs T. Berki
7690c09953 cd to / before running soong_build .
This lets one avoid any decisions as to when to chdir there during its
execution and leads to better sandboxing because the pwd doesn't leak to
init() functions anymore.

Test: Manual.
Change-Id: I1560da8ed3a621249426f9e8908aa890c21e13ba
2021-03-03 09:14:22 +01:00
Colin Cross
fdf28ca403 Merge changes I3e6bc9b5,If9f8fb10
* changes:
  Disable TestSendLog on the buildbots
  Remove global state from VNDK apexes
2021-03-03 01:45:02 +00:00
Paul Duffin
b267e12670 Merge "Verify the prebuilt_apex selects the correct input apex file" am: 9b41efabd1
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1610797

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I422ccc35977e0be846bb7a3497a50c2fc2c42e92
2021-03-02 21:36:01 +00:00
Paul Duffin
6f342644d0 Merge "Add test to verify the deapexer rule's input apex file" am: 30c9fe93e0
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1610796

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ibb6beaaa979cb14cf005a9bed7fd851253f91115
2021-03-02 21:26:58 +00:00
Colin Cross
2807f0047b Remove global state from VNDK apexes
Use the name of the apex instead of a global map to find the right
VNDK apex for each VNDK version.

Bug: 181689854
Test: apex tests
Change-Id: If9f8fb10d09e125c9e7d44228e1aa746bf53c082
2021-03-02 12:23:16 -08:00
Hyundo Moon
4416350471 Add modules-annotation-minsdk in allowed_deps
This enables using @MinSdk in media APEX.

Bug: 181649697
Test: Builds successfully
Change-Id: If69d0a6e84e31d26484c7e29dfdde4f14410a024
2021-03-02 17:22:34 +00:00
Paul Duffin
4b786d2da1 Merge "Remove deapexer and prebuilt apex select mutators" 2021-03-02 10:48:29 +00:00
Paul Duffin
9b41efabd1 Merge "Verify the prebuilt_apex selects the correct input apex file" 2021-03-02 10:47:48 +00:00
Paul Duffin
30c9fe93e0 Merge "Add test to verify the deapexer rule's input apex file" 2021-03-02 10:47:33 +00:00
Treehugger Robot
3310e2d9ea Merge "APEX uses the latest version of the stub" am: ce80f18749
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1609533

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I294103da51c7a9ad11a81e3eadb1a0e2e98920e8
2021-03-02 02:03:34 +00:00
Treehugger Robot
ce80f18749 Merge "APEX uses the latest version of the stub" 2021-03-02 01:02:18 +00:00
Paul Duffin
764a15f4e5 Merge "Allow java_sdk_library_import to contribute to hiddenapi processing" am: 69804ac388
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1609478

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I9c06fde9d8d3f34ec60bea58bfa39f5dc98a66bd
2021-03-01 19:31:06 +00:00
Paul Duffin
b1426419ec Merge "Retrieve dex implementation jars from apex for java_sdk_library_import" am: 0a8d5248ef
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1609477

MUST ONLY BE SUBMITTED BY AUTOMERGER

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

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

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

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

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

Bug: 181267622
Test: m droid
Change-Id: I106c78fd21016f051a315b82b470d8f12b1f820b
2021-03-01 17:11:25 +00:00
Paul Duffin
0d10c3c304 Verify the prebuilt_apex selects the correct input apex file
This will ensure that the following refactoring does not change the
behavior.

Bug: 181267622
Test: m nothing
Change-Id: Ieb9b37c2a1ef609b2d6565c54c261439a1ce7147
2021-03-01 17:10:31 +00:00
Paul Duffin
f6932afeae Add test to verify the deapexer rule's input apex file
This will ensure that the following refactoring does not change the
behavior.

Bug: 181267622
Test: m nothing
Change-Id: I36ae9ec9a0a7977bd394f4100c72941052d763ac
2021-03-01 13:40:06 +00:00
Paul Duffin
3785673f9b Allow java_sdk_library_import to contribute to hiddenapi processing
Invokes hiddenAPIExtractInformation() on the java_sdk_library_import's
dex implementation jar provided by the deapexer (on behalf of
prebuilt_apex) so that hiddenAPI can extract the information it needs,
if anything, from the dex file.

The dex file provided by deapexer has already had the hiddenapi
information encoded into it so it does not need to do that again.

Usually, it would require a classes implementation jar as well in
order to extract information from UnsupportedAppUsage annotations but
that is not available for a java_sdk_library_import. Fortunately, the
modules that are currently affected by this do not contain any such
annotations. This just uses a public api stubs jar instead.

Bug: 181267622
Test: m nothing
Change-Id: I96275e46f8b7fecba88075319e9f2da5ae315c03
2021-03-01 12:58:28 +00:00
Paul Duffin
3985351df6 Retrieve dex implementation jars from apex for java_sdk_library_import
Bug: 181267622
Test: m nothing
Change-Id: Idd6af2482f48bd3a05db88b8a06dbbbdee01ef78
2021-03-01 12:58:28 +00:00
Jiyong Park
55549df051 APEX uses the latest version of the stub
Previously when an APEX whose min_sdk_version is set is linked to an
external library providing multiple versions of stubs, the
maximum version that is less than or equal to the min_sdk_version was
chosen. For example, if the versions of a library stubs are 28, 29, 30,
and 31, then APEX with min_sdk_version: 29 linked to the version 29 of
the stub.

This was to ensure that the APEX doesn't use any new APIs whose
existence can't be guaranteed.

This however imposes a severe restriction that the APEX can never use
new APIs even when the APIs are actually available: i.e. when the
APEX is running on a newer platform.

With the recent work about unguarded availability, using the future APIs
became much safer. When you use an API that is newer than your
min_sdk_version, the API is automatically declared as a weak symbol
(thus no link error at runtime), while the call to API is guaranteed to
be guarded with the `__builtin_available(...)` macro.

So, there really is no reason to use the old version of the stub. We can
always use the latest version of stub safely.

Bug: N/A
Test: m
Change-Id: Iaac0d8761d8929154527dc2e861a51ae31e23d49
2021-03-01 09:12:32 +00:00
Lorenzo Colitti
1fd8f115b2 Merge "Add the new NetworkStack shim libraries to APEX allowed deps." am: 9023138b5e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1597976

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Icaefda26de292dc9b3bd011cc13c36d0f8893e10
2021-02-24 16:39:00 +00:00
Lorenzo Colitti
9023138b5e Merge "Add the new NetworkStack shim libraries to APEX allowed deps." 2021-02-24 16:01:08 +00:00
TreeHugger Robot
4191ec7529 Merge "Merge ab/7061308 into stage." into stage-aosp-master 2021-02-23 08:43:12 +00:00
Treehugger Robot
277303f042 Merge "Add ctx to AndroidMkExtraEntriesFunc" 2021-02-22 22:40:31 +00:00
Treehugger Robot
4c666e81d0 Merge "Add modules-utils-build_system to allowed deps" 2021-02-22 18:22:46 +00:00
Treehugger Robot
d4b9d04557 Merge "update apex/allowed_deps.txt" 2021-02-22 15:38:08 +00:00
Lorenzo Colitti
97ca28e990 Add the new NetworkStack shim libraries to APEX allowed deps.
These are not currently tracked before because the shims are just
filegroups. aosp/1598155 is turning them into libraries so each
shim can build with the appropriate SDK version.

Test: m
Change-Id: I9df3dd98d46f49943211cb0893493d628ddd157c
Merged-In: I9df3dd98d46f49943211cb0893493d628ddd157c
2021-02-22 20:32:34 +09:00
Anton Hansson
6536ad7d0f Remove sdkext apex_available allowlist
Not needed anymore.

Bug: 180886919
Test: m
Change-Id: I1f716076eeb44c979e92b767ea67692649e1bfb4
2021-02-22 10:08:40 +00:00
Xin Li
982c52b034 Merge ab/7061308 into stage.
Bug: 180401296
Merged-In: I4638ba660a8cc1748693224ac15e6aa6cad33646
Change-Id: I24dd13b52b3f3a007d79753e32cb64e7f36df47c
2021-02-21 09:24:23 -08:00
Jeongik Cha
79f4ab21db update apex/allowed_deps.txt
Bug: 150820813
Test: m

Change-Id: Ib8ada6607b628a120103b64ea83132b3f3e6492e
Merged-In: Ib8ada6607b628a120103b64ea83132b3f3e6492e
2021-02-21 00:11:59 +09:00
Colin Cross
1c460567b6 Remove extra return value from testApex
The config value returned by testApex is no longer used, remove it.

Test: go test  ./apex
Change-Id: I9327c1b139c17305454fb0a111e41456cdcaebc3
2021-02-19 23:06:01 +00:00
Colin Cross
aa2555387d Add ctx to AndroidMkExtraEntriesFunc
Add a ctx parameter to AndroidMkExtraEntriesFunc to allow them to
access providers.

Test: m checkbuild
Change-Id: Id6becc1e425c3c3d8519248f8c0ce80777fac7cc
Merged-In: Id6becc1e425c3c3d8519248f8c0ce80777fac7cc
2021-02-19 23:05:40 +00:00
Evan Severson
5149805dcc Add modules-utils-build_system to allowed deps
Test: Treehugger
Bug: 178426097

Change-Id: I4c485b32c3479e08077206d497185b21aad45631
2021-02-19 10:59:54 -08:00
Martijn Coenen
15679b7b27 Merge "Add MediaProvider dependencies to allowed_deps.txt" 2021-02-18 16:55:38 +00:00
Jiyong Park
4941e4b9d1 Merge "Linktype check error message becomes more correct" 2021-02-18 11:32:03 +00:00
Martijn Coenen
fd66847ac1 Add MediaProvider dependencies to allowed_deps.txt
Bug: 180375550
Test: builds
Change-Id: I0f5acf1f2de1f9f16294c0ef0e62a7bf48929aff
Merged-In: I0f5acf1f2de1f9f16294c0ef0e62a7bf48929aff
2021-02-18 09:17:07 +00:00
Jiyong Park
670e0f62a6 Linktype check error message becomes more correct
The type linkType has String() method and the error message is created
using it.

Bug: 180477804
Test: m nothing
Change-Id: I74fe9c93b74904177dbe9d29cd3aa3304b67ba4f
2021-02-18 13:10:18 +09:00
Jooyung Han
847f230c78 Merge "clean up hard-coded min_sdk_version (statsd)" 2021-02-18 00:00:00 +00:00
Jooyung Han
cc60da80fb clean up hard-coded min_sdk_version (statsd)
These modules set min_sdk_version explicitly.

Bug: 158059172
Test: m nothing
Change-Id: I0dc6e22b76eb433118e3ab509440d2a16812726e
2021-02-16 19:23:42 +09:00
Jiyong Park
0671146fd0 filesystems property can be specific to arch
Some filesystems (like boot_image type) are arch-specific. This change
allows us to have filesystems property inside the arch.<arch> struct.

Bug: 178978059
Test: m
Change-Id: I09faa6186b4a3fa35f348fc0805d894b4dc27ffd
2021-02-16 06:58:57 +09:00
Colin Cross
b87f4b4cab Merge "Convert java.Dependency to JavaInfo provider" 2021-02-13 00:39:24 +00:00
Lev Proleev
56ca4e4706 Merge "Add NNAPI AIDL interface to allowed deps" 2021-02-10 16:45:19 +00:00
Treehugger Robot
b68036f44b Merge "Add LOCAL_LICENSE_KINDS to build/soong" 2021-02-10 07:18:29 +00:00
Colin Cross
dcf71b299c Convert java.Dependency to JavaInfo provider
Export information about java dependencies through a Provider
instead of accessing the module directly.

Test: java_test.go
Test: no changes to build.ninja
Change-Id: Ifc5d566bf6f6ebc0ad399e948effaa1ef6a22876
2021-02-09 15:36:25 -08:00
Lev Proleev
3ddf9a8697 Add NNAPI AIDL interface to allowed deps
Bug: 172922059
Test: build
Change-Id: I5e0dce33d1090e548a7d9901ffe747439c11df29
Merged-In: I5e0dce33d1090e548a7d9901ffe747439c11df29
(cherry picked from commit e693333507)
2021-02-09 15:26:12 +00:00
Paul Duffin
320e170675 Merge "Allow dex jars from prebuilt_apex to be used by hiddenapi" 2021-02-09 13:58:12 +00:00
Paul Duffin
b71a8de0d5 Merge "Refactor the hiddenAPI() method for reusability" 2021-02-09 13:57:52 +00:00
Treehugger Robot
d85d058820 Merge "Pass list of module libraries to gen_ndk_backed_by_apex.sh" 2021-02-09 03:21:36 +00:00
Colin Cross
69f0a24762 Pass list of module libraries to gen_ndk_backed_by_apex.sh
Running find on the entire module directory can lead to flaky failures
when a directory is modified by another rule while find is traversing
it.  Pass a list of libraries in the module into the script instead
of finding them on disk.

Fixes: 178509901
Test: TARGET_BUILD_APPS=com.android.runtime dist
Change-Id: Ie4bf288f0e3d99cbbed5ca8770687a9bbe5377e4
2021-02-08 16:52:07 -08:00
Paul Duffin
9d67ca6ab7 Allow dex jars from prebuilt_apex to be used by hiddenapi
Invokes hiddenAPIExtractInformation() on the dex jar provided by the
deapexer (on behalf of prebuilt_apex) so that hiddenAPI can extract the
information it needs, if anything, from the dex file (and accompanying
classes implementation file).

The dex file provided by deapexer has already had the hiddenapi
information encoded into it so it does not need to do that again.

This change adds the primary parameter to hiddenAPIExtractInformation()
and checks it (and also the hiddenAPI.active property) before it does
anything. That ensures that it behaves correctly when called directly
as well as when called from hiddenAPIExtractAndEncode().

Bug: 178361284
Test: m droid
      Verified that hiddenapi files (both aggregated ones and for the
      individual modules) are not affected by this change.
      Also verified that the hiddenapi files created when using the
      prebuilts (using SOONG_CONFIG_art_module_source_build=false) are
      the same as when using the source. There is a slight difference
      in the order but otherwise identical.
Change-Id: I7abb63fd310bb94787ab7f4821e5fd283dc03046
2021-02-08 19:10:50 +00:00
Paul Duffin
4fd997bc13 Refactor the hiddenAPI() method for reusability
A follow up change needs to be able to contribute to the information
the hiddenapi process collates without having a dex file encoded. This
change pushes all the functionality related to information gathering
into the hiddenAPIGenerateCSV() method and then renames it and the
hiddenAPI() method to make it clearer what they do.

Bug: 178361284
Test: m droid
      Verified that hiddenapi files (both aggregated ones and for the
      individual modules) are not affected by this change.
Change-Id: I04417720216a0fbadcd88e6185e7de6570af6216
2021-02-08 19:10:50 +00:00
Paul Duffin
5d0572b7eb Merge "Integrate hiddenapi processing into boot jars test" 2021-02-08 18:43:10 +00:00
Paul Duffin
1a75902832 Merge "Exclude exported_java_libs dependencies from visibility checks" 2021-02-08 18:40:46 +00:00
Paul Duffin
a7139425bc Exclude exported_java_libs dependencies from visibility checks
Test: m nothing
Change-Id: Iba45580c0711d48034898e9d42832c7e2b0e6284
2021-02-08 13:13:02 +00:00
Paul Duffin
89886cbdb0 Ensure subtest failures are reported on subtest
A subtest (code inside the func passed to t.Run(...)) are passed their
own t *Testing pointer to use to report errors in order to ensure that
they are treated as errors of the subtest and not the containing test.

This change ensures that the subtests in the following tests use the
correct t *Testing.
* TestPrebuiltExportDexImplementationJars
* TestBootDexJarsFromSourcesAndPrebuilts

Bug: 178361284
Test: m nothing
Change-Id: I4e8b166051cb6098c89d8e68a450c81a714f7677
2021-02-07 10:58:24 +00:00
Paul Duffin
f38931c287 Integrate hiddenapi processing into boot jars test
This change registers the hiddenapi singleton so that hiddenapi
processing is performed as part of
TestBootDexJarsFromSourcesAndPrebuilts so that additional hiddenapi
related tests can be added later.

The hiddenapi singleton uses the BootJars/UpdatableBootJars properties
from productVariables not the dexpreopt.GlobalConfig so this change
makes sure that they are consistent.

Performing hiddenapi processing causes the dex file used in "prebuilt
with source apex preferred" test to be encoded with hiddenapi
information which changes the path in the test.

Bug: 178361284
Test: m nothing
Change-Id: I2eb3d8cf11f6fb3bf4a34d6e4ae0c397c890191e
2021-02-07 10:58:24 +00:00
Bob Badour
02040de891 Add LOCAL_LICENSE_KINDS to build/soong
Added SPDX-license-identifier-Apache-2.0 to:
  Android.bp
  android/Android.bp
  android/soongconfig/Android.bp
  androidmk/Android.bp
  apex/Android.bp
  bazel/Android.bp
  bp2build/Android.bp
  bpf/Android.bp
  bpfix/Android.bp
  cc/Android.bp
  cc/config/Android.bp
  cc/libbuildversion/Android.bp
  cc/libbuildversion/tests/Android.bp
  cc/ndk_api_coverage_parser/Android.bp
  cc/ndkstubgen/Android.bp
  cc/symbolfile/Android.bp
  cmd/dep_fixer/Android.bp
  cmd/diff_target_files/Android.bp
  cmd/extract_apks/Android.bp
  cmd/extract_jar_packages/Android.bp
  cmd/extract_linker/Android.bp
  cmd/fileslist/Android.bp
  cmd/host_bionic_inject/Android.bp
  cmd/javac_wrapper/Android.bp
  cmd/merge_zips/Android.bp
  cmd/multiproduct_kati/Android.bp
  cmd/path_interposer/Android.bp
  cmd/pom2bp/Android.bp
  cmd/pom2mk/Android.bp
  cmd/sbox/Android.bp
  cmd/soong_build/Android.bp
  cmd/soong_env/Android.bp
  cmd/soong_ui/Android.bp
  cmd/zip2zip/Android.bp
  cmd/zipsync/Android.bp
  cuj/Android.bp
  dexpreopt/Android.bp
  dexpreopt/dexpreopt_gen/Android.bp
  env/Android.bp
  etc/Android.bp
  filesystem/Android.bp
  finder/Android.bp
  finder/cmd/Android.bp
  genrule/Android.bp
  jar/Android.bp
  java/Android.bp
  java/config/Android.bp
  kernel/Android.bp
  linkerconfig/Android.bp
  linkerconfig/proto/Android.bp
  makedeps/Android.bp
  partner/Android.bp
  phony/Android.bp
  python/Android.bp
  python/tests/Android.bp
  remoteexec/Android.bp
  rust/Android.bp
  rust/config/Android.bp
  scripts/Android.bp
  sdk/Android.bp
  sh/Android.bp
  shared/Android.bp
  symbol_inject/Android.bp
  symbol_inject/cmd/Android.bp
  sysprop/Android.bp
  tradefed/Android.bp
  ui/build/Android.bp
  ui/logger/Android.bp
  ui/metrics/Android.bp
  ui/metrics/proc/Android.bp
  ui/status/Android.bp
  ui/terminal/Android.bp
  ui/tracer/Android.bp
  xml/Android.bp
  zip/Android.bp
  zip/cmd/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD to:
  finder/fs/Android.bp
  third_party/zip/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all

Exempt-From-Owner-Approval: janitorial work

Change-Id: Ia47ca14f16b8c9f84f9d533a07e5b00e2c04e8d4
2021-02-06 04:23:21 +00:00
Treehugger Robot
b02128ad0b Merge "Remove libbinder_headers from apex_available allowlist" 2021-02-06 03:20:47 +00:00
Jooyung Han
7701309889 Merge "cc: fix version macro for stubs" 2021-02-06 01:41:31 +00:00
Liz Kammer
b7eab01167 Merge "bp2build: convert paths/module refs to Bazel label" 2021-02-05 13:39:08 +00:00
Yan Yan
3a5c0af0fb Merge "Change IKE min_sdk to 30" 2021-02-05 07:33:56 +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
Treehugger Robot
87bd0f3c22 Merge "New header lib added to apex/allowed_deps.txt" 2021-02-05 03:34:48 +00:00
Jooyung Han
11b0fbdbf6 cc: fix version macro for stubs
When a cc module is built against a stub, compiler passes version macro
of the stub lib. Version macro should be numeric, so codenames or
"current" should be mapped to numbers just like how ndkstubgen maps to.

* "current" -> future (10000)
* codenames -> look up api_level.json
* otherwise -> cast to int

Bug: 179329813
Test: m / soong test / manually check the output build.ninja
Change-Id: Ic0e1dd904984e161694a0b77fad5559c06a4462f
2021-02-05 11:27:57 +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
Jooyung Han
575b608683 New header lib added to apex/allowed_deps.txt
libbinder_headers_platform_shared is a new header lib shared between
libbinder/libbinder_ndk. Since it is re-exported via libbinder_headers,
it should be added to allowed_deps.txt as well.

Bug: 179020493
Test: m
Test: aidl_integration_test
Change-Id: I7fe89766c8e7924edf2a3ddd69c2876611d0dd0a
2021-02-04 11:30:49 +09:00
Yan Yan
4e9eef5702 Change IKE min_sdk to 30
This is generated by build/soong/scripts/update-apex-allowed-deps.sh

Bug: 177266501
Test: builds
Change-Id: Ie7d43501def9a72d019c886df1f379410ffb1527
2021-02-03 15:51:27 -08:00
Dario Freni
3627f8350d Add no_op binary.
Even if this binary is only used in a testing apex for dynamic common
library apex that will be removed once we have a production version
ready, we need said apex to be marked as updatable too.

Bug: 177879489
Bug: 179013728
Test: builds
Change-Id: I8ae519da164f1f5355d4c2dfeca88a497cda7990
(cherry picked from commit 0d3ff6d918)
2021-02-03 10:34:13 +00:00
Paul Duffin
5bbfef8718 Fix some minor issues with boot_image
Mistakenly used HostAndDeviceDefault (which builds host and device
variants by default) instead of HostAndDeviceSupported which only
builds a device variant by default.

Moved the test definitions of art and framework boot images from being
defined in all Java related tests into the test where they belong. This
is needed in order to improve the ART and framework boot image specific
testing.

Bug: 177892522
Test: m droid
Change-Id: I16771f09bd789033e18c58ae6dd4b6b9e865d831
2021-01-30 12:57:26 +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
Martin Stjernholm
c4e17317d1 Merge "Fix boot jar handling when both source and prebuilt APEXes and modules are present." 2021-01-29 13:15:02 +00:00
Nikita Ioffe
82aab58aea Turn apex compression from opt-out into opt-in
Compression is useful only for big enough apexes. We can manually opt-in
them, instead of trying to find list of apexes that should be opted-out.

Test: m
Bug: 178713634
Change-Id: Ice86fabb7c1db4a1e21e4c983d595cfd3a1c0b7a
2021-01-28 20:25:23 +00:00
Martin Stjernholm
1dc0d6d7f2 Fix boot jar handling when both source and prebuilt APEXes and modules
are present.

1) The boot jar to APEX mapping is maintained by the base names for
both of them. When building with prebuilt modules and APEXes, that
means we need to take care to compare them without regard to any
"prebuilt_" prefixes.

2) VisitAllModules can visit disabled modules and both source and
prebuilt modules, so they need some conditions to skip modules that
aren't applicable for boot jars.

Test: `m droid`
Test: `m droid SOONG_CONFIG_art_module_source_build=false`
  with fresh ART Module prebuilts in place
Bug: 171061220
Change-Id: Iced269d29127bc8b8f9b3171adb60a97d115628b
2021-01-28 20:09:24 +00:00
Paul Duffin
b9d731c8a9 Merge "Add boot_image module type" 2021-01-28 15:39:57 +00:00
Treehugger Robot
99afe0d442 Merge "apex: checks min_sdk_version for preview/current" 2021-01-28 13:04:52 +00:00
Paul Duffin
57eec1007e Merge "Make com.android.art related tests more realistic" 2021-01-27 10:03:42 +00:00
Treehugger Robot
fcf2da0b29 Merge "update apex allowed deps-2" 2021-01-27 01:06:48 +00:00
Jeongik Cha
40c6ae759d update apex allowed deps-2
an aidl module should specify its version. because of that some deps
which have version on its name is added.

Bug: 150578172
Test: m
Change-Id: If5c5d66e59f33ecf37d118b2b80db820ec78ea04
2021-01-26 23:05:42 +09:00
Paul Duffin
3451e1600f Add boot_image module type
Adds a boot_image module type. Follow on changes will add instances of
boot_image to represent the ART and framework boot images in the art
and frameworks/base repositories respectively.

For the moment they retrieve their associated boot image configuration
from the map returned by genBootImageConfigs() and leave the actual
work of creating the ninja rules to create the boot images to the
dex_bootjars singleton.

Bug: 177892522
Test: m droid
Change-Id: Ib69701de0d24d996bb8e8be7a20b941be907390e
2021-01-26 13:00:07 +00:00
Paul Duffin
d376f7925a Make com.android.art related tests more realistic
Previously, some tests used "com.android.art.something" as the name of
the APEX containing the ART boot jars but that is not the valid name
for an ART APEX. This change switches that to "com.android.art.debug".

Bug: 171061220
Test: m nothing
Change-Id: I057edc58ae81cdb14076a2d7d117ca1764aa3e52
2021-01-26 12:35:08 +00:00
Paul Duffin
092153de15 Fix problems with TestPrebuiltExportDexImplementationJars
Previously, the test mistakenly configured BootJars which meant the
test was testing not just the propagation of paths to files retrieved
from the prebuilt apex to the java_import module but also the process
of finding appropriate boot jars.

It also set "prefer: true" on the prebuilt_apex instead of the
java_import when checking to make sure that it still found the correct
module when both prebuilt and source were available and the prebuilt
was preferred.

Bug: 171061220
Test: m nothing
Change-Id: I4f2fa7ea372b14d4b169cdc78bdeb1ca4ac4dff8
2021-01-26 12:35:08 +00:00
Paul Duffin
4c183c7581 Merge "Make dexpreopt tools available for all java tests" 2021-01-26 12:08:30 +00:00