Commit graph

20491 commits

Author SHA1 Message Date
Paul Duffin
51a2bee304 java_sdk_library: Define relationship between api scopes
Needed for follow up changes.

Test: m checkapi
Bug: 155164730
Merged-In: I163223caed38161ce1fa7b96dc3772194c32c3e2
Change-Id: I163223caed38161ce1fa7b96dc3772194c32c3e2
(cherry picked from commit 97b53b83e4)
2020-05-07 11:37:06 +01:00
Paul Duffin
1b115d32b4 Add hook to be called after defaults have been applied
Previously, the only way for a module type to create modules (other
than defining its own mutator) was to register a LoadHook. However,
that is called before defaults are applied so any properties used in
that hook cannot take advantage of defaults, e.g. java_sdk_library
cannot use defaults to set its sdk_version property and have that
affect its child modules.

This change adds a new SetDefaultableHook() to DefaultableModule to
register a hook that is called after any defaults have been applied.

Also adds some tests to ensure that errors in the visibility property
introduced in a DefaultableHook are reported in the gather phase of
visibility processing.

A follow up change will switch java_sdk_library to use that instead
of the AddLoadHook() mechanism.

Bug: 155295806
Test: m checkapi
Merged-In: I13df3115f9e225f7324b6725eaeb16a78cc2538a
Change-Id: I13df3115f9e225f7324b6725eaeb16a78cc2538a
(cherry picked from commit afa9fa104d)
2020-05-07 11:36:57 +01:00
Paul Duffin
eedf3f1f4a Move prebuilts mutators after defaults have been applied
A follow up change will add a mechanism for a module to register a hook
that is called after any defaults have been applied. That is intended
for use by modules like java_sdk_library that create child modules that
are dependent upon properties that could be supplied by defaults.

Creating those child modules after prebuilts mutators are run will
cause problems if those child modules clash with prebuilts modules.
Moving the prebuilts mutators after the defaults mutators will fix
that.

Tests are currently being run with the mutators in different orders so
this change also cleans that up so they are consistent with the actual
code that is being run.

Bug: 155295806
Test: m checkbuild
Merged-In: I825c6df09058fb3a45db196661959eb332aca2f3
Change-Id: I825c6df09058fb3a45db196661959eb332aca2f3
(cherry picked from commit c988c8e202)
2020-05-07 11:36:44 +01:00
Paul Duffin
8de6aa4263 Encapsulate getter into an extractorProperty structure
Refactors the existing code to wrap a getter with a structure in order
to simplify adding additional per-property information. Adds an
emptyValue field to contain the empty value appropriate for the field
type.

Bug: 155628860
Test: m nothing
Merged-In: I7e169bd9b6e51b88e35bdf8673a5056337f778c1
Change-Id: I7e169bd9b6e51b88e35bdf8673a5056337f778c1
(cherry picked from commit b28369a982)
2020-05-07 09:53:32 +01:00
Paul Duffin
f3644f12d0 Encapsulate properties to be optimized in a container
This allows additional metadata to be associated with a set of
properties that will be used in a follow up change to filter
properties that are ignored in some variants (e.g. host variants).

Bug: 155628860
Test: m nothing
Merged-In: Ie83c1ffbb71fd5d7a08d350571dad3e3209b1431
Change-Id: Ie83c1ffbb71fd5d7a08d350571dad3e3209b1431
(cherry picked from commit f34f6d8538)
2020-05-07 09:53:05 +01:00
TreeHugger Robot
93f1d81cc0 Merge "Simplify package by using LoadHook instead of mutators" into rvc-dev 2020-05-07 06:56:29 +00:00
TreeHugger Robot
c40859ae12 Merge "Remove networkstack-aidl-interfaces-unstable-java from the whitelist" into rvc-dev 2020-05-07 05:43:24 +00:00
Colin Cross
76583a443e Add jni_uses_sdk_apis
NetworkStackTests is using platform APIs for its Java code, but needs
to use portable JNI libraries.  Add a jni_uses_sdk_apis so that it
can select the SDK variants of JNI libraries even though it doesn't
set sdk_version.

Bug: 154665579
Test: atest NetworkStackTests
Change-Id: I841fb761ec1c1ab8596aac44e01eb7eb91428006
2020-05-06 17:56:46 -07:00
Jaewoong Jung
a689ffe207 Make android_app_import multi targets arch module.
This makes it consistent with android_app. Also, most android_app_import
modules with JNI libs target a single arch.

(This is a cherry-pick change.)

Test: TreeHugger
Bug: 154281342
Change-Id: I5bbb2d2b733bbd6b868898285683ba5ff45be10b
Merged-In: I5bbb2d2b733bbd6b868898285683ba5ff45be10b
2020-05-06 15:19:42 -07:00
Artur Satayev
388d39ba9a Introduce min_sdk_version to deps info.
Bug: 149622332
Test: m
Change-Id: Ie6568cb8a82d5cca9a3dc91b5a068abf4b0632dc
Merged-In: Ie6568cb8a82d5cca9a3dc91b5a068abf4b0632dc
Exempt-From-Owner-Approval: cp from aosp
(cherry picked from commit 480e25b74f)
2020-05-06 15:01:14 +00:00
Artur Satayev
fb0a636f6d Merge "Introduce flat deps info list." into rvc-dev 2020-05-06 13:45:16 +00:00
Paul Duffin
a43e13e5d4 Simplify package by using LoadHook instead of mutators
This was not previously possible due to LoadHooks being run after the
module was registered.

Bug: 155462403
Test: m nothing
Merged-In: Ia8383b9d1272bb12c8a83948753a0e4b0d98a650
Change-Id: Ia8383b9d1272bb12c8a83948753a0e4b0d98a650
(cherry picked from commit cdfcec98bb)
2020-05-06 08:21:39 +01:00
Paul Duffin
2df45faa7b Improve error messages when output file is invalid
Bug: 155720025
Test: m nothing
Merged-In: I01eebaad58c5a6950e4419d0a8bf80bd02fed543
Change-Id: I01eebaad58c5a6950e4419d0a8bf80bd02fed543
(cherry picked from commit 712993cf0c)
2020-05-06 08:21:22 +01:00
Paul Duffin
6615b30812 Document preArch mutators
Bug: 155295806
Test: m checkbuild
Merged-In: I4cd6647a8707f49363d297a3b3082ef19ba93868
Change-Id: I4cd6647a8707f49363d297a3b3082ef19ba93868
(cherry picked from commit aa4162e71e)
2020-05-06 08:20:34 +01:00
Martin Stjernholm
bb0e839da9 Do not propagate dynamic dependencies for stub libs.
Test: m nothing
Test: Build an SDK snapshot including libc, check that the generated
  cc_prebuilt_library_shared for it is a stub that doesn't depend on
  ld-android.
Bug: 152255951
Bug: 154310674
Merged-In: Ie5ec02aebdf00b75756a6eda40db821488d30065
Change-Id: Ie5ec02aebdf00b75756a6eda40db821488d30065
(cherry picked from commit cc330d665a)
2020-05-06 08:19:07 +01:00
Martin Stjernholm
13b8b6ac70 Do not propagate the stub symbol file to prebuilts.
This partially reverts https://r.android.com/1278193. The propagated
symbol files contain all versions, even though only one is applicable
in a given SDK snapshot.

It's uncertain what repercussions this might have, but one is that if
we were to update a snapshot for a fixed version then it might change
because the symbol file contains new versions that aren't applicable.
Since the symbol file isn't actually needed at this point it's better
to wait with this step until the use cases for it are more clear.

Test: m nothing
Test: Create an SDK snapshot with Bionic libs, drop it into a
  master-art tree without bionic/ in it, build ART APEXes, and check
  that the Soong phase completes (specifically that the stubs are
  detected even without symbol files).
Bug: 152481980
Merged-In: Ic79f89bc6d11d0b6552fa20791f5680ff9a40c0d
Change-Id: Ic79f89bc6d11d0b6552fa20791f5680ff9a40c0d
(cherry picked from commit bdd0dffc1b)
2020-05-06 08:18:49 +01:00
Martin Stjernholm
cd497b0506 Propagate stubs to the SDK for libraries that have them.
Necessary to make the APEX build logic treat the libraries as API
boundaries rather than dependencies to bundle.

The .so files in the snapshots are the compiled stub libraries in this
case. They are strictly speaking redundant since they can be generated
from the .map.txt files in the snapshots, but doing that would require
extending the cc_prebuilt_library(_shared) module types with a full
compiler pass etc, and that would break a lot of assumptions in the cc
package.

Test: m nothing
Test: Create an SDK snapshot with Bionic libs, drop it into a
  master-art tree without bionic/ in it, build ART APEXes, and check
  that the Soong phase completes (specifically no errors about various
  APEX libs requiring libc that is not available to them).
Bug: 152481980
Merged-In: I31b928e6261198b6dd6f6b17196e714f07b64172
Change-Id: I31b928e6261198b6dd6f6b17196e714f07b64172
(cherry picked from commit c5dd4f7c1f)
2020-05-06 08:18:35 +01:00
Martin Stjernholm
8c0db63809 Don't run new test on Darwin that lacks snapshot support.
Test: m nothing
Bug: 152514829
Bug: 152255951
Merged-In: Ib14af7caa408e252242e6933f7281aab3888789c
Change-Id: Ib14af7caa408e252242e6933f7281aab3888789c
(cherry picked from commit 66a06945aa)
2020-05-06 08:18:15 +01:00
Martin Stjernholm
bddfbc463d Propagate empty vs unspecified system_shared_libs correctly.
Necessary to get correct prebuilts for many Bionic libs.

Cleaned up numerious "system_shared_libs: []" from test fixtures, since
they otherwise would need correction in the expected results, and it is
better to have a single test focused on testing system_shared_libs
propagation.

Test: m nothing
Bug: 152255951
Merged-In: If2e8a5296223e6281d833312660e8e9e4cd184c0
Change-Id: If2e8a5296223e6281d833312660e8e9e4cd184c0
(cherry picked from commit 10566a035f)
2020-05-06 08:17:57 +01:00
Martin Stjernholm
fcb99e07fc Add SDK member support for cc_object.
Test: m nothing
Test: Add
    sdk {
        name: "runtime-module-sdk",
        native_shared_libs: [
            "libc",
            "libdl",
            "libm",
            "ld-android",
        ],
        native_objects: [
            "crtbegin_dynamic",
            "crtbegin_static",
            "crtend_android",
        ],
    }
  to bionic/apex/Android.bp. Then:
    build/soong/scripts/build-aml-prebuilts.sh runtime-module-sdk
  Take the generated runtime-module-sdk-current.zip and unzip into a
  master-art tree without bionic/, edit the generated Android.bp to
  extend cc_prebuilt_* modules with:
    nocrt: true,
    stl: "none",
    system_shared_libs: [],
    apex_available: ["//apex_available:anyapex"],
    recovery_available: true,
    vendor_available: true,
    ramdisk_available: true,
  Then "m com.android.art.debug". This passes Soong but fails in the
  build step because more members are required.
Bug: 148934017
Merged-In: I2ab8f6aadb1440b325697cae4a8ed761c62d15d2
Change-Id: I2ab8f6aadb1440b325697cae4a8ed761c62d15d2
(cherry picked from commit cd07bce437)
2020-05-06 08:17:10 +01:00
Martin Stjernholm
39978527ce Add cc_prebuilt_object.
To be used for prebuilt object support in SDK snapshots.

Test: m nothing
Bug: 148934017
Merged-In: I53d58100cc1d410c5cf5b7906de7ed6f7add2035
Change-Id: I53d58100cc1d410c5cf5b7906de7ed6f7add2035
(cherry picked from commit 0b92ac8e43)
2020-05-06 08:16:53 +01:00
Jeongik Cha
255a570e6d Remove networkstack-aidl-interfaces-unstable-java from the whitelist
networkstack-aidl-interfaces-*java has explicit apex_available now.
Accordingly, remove it from the whitelist

Bug: 133526962
Test: m nothing
Change-Id: If5427afb2470a7dffbd418e1c405af508577ad93
2020-05-06 05:20:13 +00:00
Yabin Cui
d62f376a36 Merge "Switch to clang-r383902 (11.0.1)." into rvc-dev 2020-05-05 20:36:16 +00:00
Artur Satayev
5e7c32d6cb Introduce flat deps info list.
Compared to full list, flat list drops dependency edges and simply
lists all transitive dependencies for a top-level apex bundle.

Bug: 149622332
Test: m, manually build flatlist
Change-Id: Ibd521c96b7aeab90b95965c1b524e0a0152aaf5a
Merged-In: Ibd521c96b7aeab90b95965c1b524e0a0152aaf5a
Exempt-From-Owner-Approval: cp from aosp
(cherry picked from commit a8bd113a69)
2020-05-05 17:28:41 +00:00
Artur Satayev
334b51730a Export depsInfo into android package.
Move depsInfo into android for easier sharing with APK code.

Bug: 149622332
Test: m, diff'ing outputs for conscrypt module.
Change-Id: If0ee967d37425540e69b4ce9304229d9f2cd86bd
Merged-In: If0ee967d37425540e69b4ce9304229d9f2cd86bd
Exempt-From-Owner-Approval: cp from aosp
(cherry picked from commit 872a144dca)
2020-05-05 16:19:07 +00:00
Paul Duffin
5d5804a81f Merge changes I101fa6b0,Ic1a9bb1e into rvc-dev
* changes:
  Report visibility errors in both check and gather phases
  Reduce duplication in visibility property management
2020-05-05 11:33:11 +00:00
Artur Satayev
b25992b4eb Merge "Ensure APEX's Java deps use stable SDKs." into rvc-dev 2020-05-05 09:59:34 +00:00
Anton Hansson
3292836210 Merge "Treat lint warnings as errors" into rvc-dev 2020-05-05 09:58:51 +00:00
Paul Duffin
b33d21bdaf Report visibility errors in both check and gather phases
Previously, errors that were found when splitting visibility rules were
only reported in the check phase and simply ignored during the gather
phase. That was because every visibility property that was processed in
the gather phase had already been checked in the check phase. However,
that is not strictly true as it has always been possible to add a
mutator between the check and gather phases that creates a module with
invalid visibility properties that will just be ignored. Fortunately,
that has not happened.

A follow up commit will add the capability to create modules after the
defaults have been applied which means the chances of invalid visibility
properties being ignored will increase.

This change makes both phases report any errors they find. It will not
have any impact on existing code as if any errors are reported in the
check phase then the build will exit before the gather phase. It will
prevent any invalid visibility errors from being ignored.

Bug: 155295806
Test: m nothing
Merged-In: I101fa6b03d2530b16e4394a9e466fead48be0ff0
Change-Id: I101fa6b03d2530b16e4394a9e466fead48be0ff0
(cherry picked from commit 0c83aba28e)
2020-05-05 10:34:55 +01:00
Paul Duffin
abc9a647a2 Reduce duplication in visibility property management
Adds a couple of new methods to manage visibility property instances to
reduce duplication and encapsulate the implementation slightly better.

The AddVisibilityProperty method is exported as it will be needed by
other packages in follow up commits.

Bug: 155295806
Test: m nothing
Merged-In: Ic1a9bb1e151fc6ae65761344fd210b4e4ba74fbc
Change-Id: Ic1a9bb1e151fc6ae65761344fd210b4e4ba74fbc
(cherry picked from commit 5ec73ecc08)
2020-05-05 10:34:30 +01:00
Anton Hansson
e714565ce8 Treat lint warnings as errors
Warnings get lost in the build spam and never get fixed. Right now is
the best time to do this, because we only track the warnings/errors
since the last released API. The API has just been frozen, so the number
of warnings is at an all-time low.

Whitelist the car lib and test stubs for now, which produce a lot of
warnings.

Bug: 154317059
Test: presubmit
Change-Id: I9aa7cb1b947c6c664f15e2bd5835d76eaac1237a
2020-05-04 21:47:34 +01:00
Anton Hansson
fc39bd861d Merge "Disable "check last" for test api" into rvc-dev 2020-05-04 17:44:05 +00:00
Artur Satayev
2eedf623ff Ensure APEX's Java deps use stable SDKs.
Test: m
Bug: 153333044
Change-Id: Ib1acf3073e96fe23c92d292ec0b1a91e2cd408db
Merged-In: Ib1acf3073e96fe23c92d292ec0b1a91e2cd408db
Exempt-From-Owner-Approval: cp from aosp
(cherry picked from commit 8cf899afcc)
2020-05-04 16:51:59 +00:00
Anton Hansson
e16ca7d52d Merge "Make prebuilt_sdk support module-lib and system-server" into rvc-dev 2020-05-04 12:51:31 +00:00
Dan Willemsen
7b6af23db6 Don't tell make about modules in other namespaces
This was causing build breaks when different devices moved to Android.bp
at different times.

Bug: 150878976
Test: build *_hwasan targets
Change-Id: I68912bb6a5696809c318d1ec816a1bcfbe2df245
2020-05-03 21:30:43 -07:00
Svet Ganov
ec83fd0642 Updating platform SDK version for R
* Update SDK versions

Test: build + boot

 bug:150281259

Change-Id: I30d7cda3c95327c4080e279e876129eb9e6a8091
Merged-In: I30d7cda3c95327c4080e279e876129eb9e6a8091
2020-05-03 09:41:41 -07:00
Anton Hansson
8b9273d99e Merge "Fix soong crashing when there's no baseline file" into rvc-dev 2020-05-02 10:23:16 +00:00
Anton Hansson
5ff28e50b8 Disable "check last" for test api
@TestApi does not have stability requirements, so we shouldn't be
checking its compatibility with the last released version.

This CL removes the expectation that a test-removed.txt is checked in
for each module during finalization.

Bug: 155197156
Test: m (with SDK 30 imported)
Change-Id: Ib3f671493f1d230116bec51b884e8072643b10d4
2020-05-02 11:19:36 +01:00
Colin Cross
2a5fb91370 Merge changes from topic "sdk_version_variant" into rvc-dev
* changes:
  Add sdk mutator for native modules
  Require apps built against the SDK to use JNI built against the NDK
2020-05-02 01:41:18 +00:00
Yabin Cui
2547d40a3b Switch to clang-r383902 (11.0.1).
Also suppress some warnings/flags globally to pass compilation.

Bug: 149839606
Test: build aosp_arm64-userdebug.
Change-Id: I0ed740e51b6b39c58842a58eabcf3cdf404e73fa
Merged-In: I0ed740e51b6b39c58842a58eabcf3cdf404e73fa
(cherry picked from commit 8ec05ff5f6)
2020-05-01 11:36:21 -07:00
Yabin Cui
da831ae8a8 Merge changes I27c31563,I126d2f51 into rvc-dev
* changes:
  Disable cert-dcl51-cpp and -cert-dcl37-c.
  Disable bugprone-reserved-identifier
2020-05-01 18:34:09 +00:00
Anton Hansson
0fd1de5f0b Make prebuilt_sdk support module-lib and system-server
This makes prebuilt_sdk look for and create modules in the module-lib
and system-server subdirs too, e.g.:
    framework-wifi.api.module-lib.latest

Bug: 149293194
Test: follow-up change
Change-Id: Idbded6b633315034e669e9c5dd2bd30725d5c76b
2020-05-01 18:37:15 +01:00
Anton Hansson
34ced82d2a Fix soong crashing when there's no baseline file
Soong was referencing the baseline file regardless of whether it was
valid or not.

Also update the lint message to match the one metalava itself prints,
which only suggests whitelisting the error if it's not possible to fix
it properly.

Bug: 154616909
Test: m (with lint error)
Change-Id: I4c6ec327a59aefe74825b4c4719393dd267ba3aa
2020-05-01 17:12:36 +01:00
Paul Duffin
bd650a1198 Merge "java_sdk_library: Correct stubs source generation classpath" into rvc-dev 2020-05-01 14:12:06 +00:00
Paul Duffin
5a9c628f9d Merge "Fix definition of android_stubs_current in sdk tests" into rvc-dev 2020-05-01 14:11:45 +00:00
Paul Duffin
da36425419 java_sdk_library: Correct stubs source generation classpath
The stubs source should be generated using the same classpath that is
used to compile the implementation library, i.e. sdk_version,
system_modules and libs/static_libs.

Previously, the sdk_version used to generate the stubs was different.
It provided access to a wider API surface than was necessary. This
change fixes that.

Test: m checkapi
Bug: 155164730
Merged-In: I7bc54dc4ad12a7d6c7503111d1322ee35c56d713
Change-Id: I7bc54dc4ad12a7d6c7503111d1322ee35c56d713
(cherry picked from commit 7b78b4d404)
2020-05-01 10:38:42 +01:00
Paul Duffin
608bcf73ee Fix definition of android_stubs_current in sdk tests
This change fixes an issue with the definition of the
android_stubs_current (and similar) modules in the sdk tests. They were
incorrectly defined as java_sdk_library_import and not java_import.

Test: m nothing
Bug: 155164730
Merged-In: I4e9bfebdd2ff0a374e12284ccdf5ee5518968969
Change-Id: I4e9bfebdd2ff0a374e12284ccdf5ee5518968969
(cherry picked from commit 260bd316bf)
2020-05-01 10:23:12 +01:00
Yabin Cui
1014de7951 Disable cert-dcl51-cpp and -cert-dcl37-c.
Disable them for the next clang compiler update.

Bug: 153464409
Test: WITH_TIDY=1 make

Change-Id: I27c315637e02c7c6c708a24a04220f10136b681a
Merged-In: I27c315637e02c7c6c708a24a04220f10136b681a
(cherry picked from commit 70ba0e23a4)
2020-04-30 15:58:59 -07:00
Chih-Hung Hsieh
465da2f849 Disable bugprone-reserved-identifier
* Disable it for the next clang compiler update
  until all source files with this warning are fixed.

Bug: 153464409
Test: WITH_TIDY=1 make
Change-Id: I126d2f5170f3883192348577e523ef99f5c5a70e
Merged-In: I126d2f5170f3883192348577e523ef99f5c5a70e
(cherry picked from commit 3d3df826c1)
2020-04-30 15:58:59 -07:00
Nicolas Geoffray
101a7622fe Fix dex2oat symlink now that we generate dex2oat32/dex2oat64.
Test: m
Bug: 155257660
Change-Id: I466feabc64c0fb77fcf652be81bc0c4944b84ac0
2020-04-29 12:00:41 +01:00