Commit graph

20373 commits

Author SHA1 Message Date
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
Yabin Cui
d62f376a36 Merge "Switch to clang-r383902 (11.0.1)." into rvc-dev 2020-05-05 20:36:16 +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
Paul Duffin
cceb7f2c10 Merge "Remove obsolete var apiFileMakeVariableSuffix" into rvc-dev 2020-04-29 08:22:35 +00:00
Roshan Pius
016159dfe4 Merge "soong: Add support for override_runtime_resource_overlay" into rvc-dev 2020-04-28 22:09:15 +00:00
TreeHugger Robot
70a42b405f Merge "Allow remote execution of link actions." into rvc-dev 2020-04-28 21:46:39 +00:00
Roshan Pius
b830796ca4 soong: Add support for override_runtime_resource_overlay
Bug: 154960712
Test: go test ./... -test.v -run TestOverrideAndroidApp
Change-Id: I8ca9d173b6ab7f9306c83c2b434107111aa2ca88
2020-04-28 13:08:55 -07:00
TreeHugger Robot
99899b3582 Merge "Fix RuleBuilder remoteable actions running in the local pool." into rvc-dev 2020-04-28 19:54:47 +00:00
Anton Hansson
e366fffa51 Remove obsolete var apiFileMakeVariableSuffix
Not used anymore, as the make variables have been deleted.

Bug: 152479829
Test: m
Change-Id: I1b29ec33951588ab479fc3e14f85e9aa189b971b
Merged-In: I1b29ec33951588ab479fc3e14f85e9aa189b971b
2020-04-28 19:30:04 +01:00
Jiyong Park
23ba7cc000 Merge "Add test_for property" into rvc-dev 2020-04-28 14:27:07 +00:00
Jiyong Park
e86c771cd0 Merge "Set apex_available property" into rvc-dev 2020-04-28 13:57:02 +00:00
Jiyong Park
f0d01b7c98 Add test_for property
This change adds 'test_for' property to cc_test_* types. The property is
used to mark a module as a test for one or more APEXes, in which case
the module has accecss to the private part of the listed APEXes. For
example, the module is linked with the actrual shared library in the
APEX instead of the stub of the shared library.

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

Bug: 129539670
Bug: 153046163
Test: m
Merged-In: I45ed0d7a15540b0d69b2a3b8d9c4cb202adff6f2
(cherry picked from commit 62304bbeec)
Change-Id: I45ed0d7a15540b0d69b2a3b8d9c4cb202adff6f2
2020-04-28 21:35:40 +09:00
Jiyong Park
5088a2cbd5 Set apex_available property
The marked library(ies) were available to the APEXes via the
hand-written whitelist in build/soong/apex/apex.go. Trying to remove the
whitelist by adding apex_available property to the Android.bp of the
libraries.

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

Bug: 150999716
Test: m
Merged-In: I11a4e877ee27f7c55e2f00371c6fa58daedb1a9f
(cherry picked from commit 601d31c234)
Change-Id: I11a4e877ee27f7c55e2f00371c6fa58daedb1a9f
2020-04-28 21:08:58 +09:00
Artur Satayev
785afdb04c Merge "Do not allow updatable apps without min_sdk_version." into rvc-dev 2020-04-28 12:05:38 +00:00
Ulyana Trafimovich
0f4c868616 Merge "Fix host path for dexpreopted system server modules defined in Make." into rvc-dev 2020-04-28 11:53:17 +00:00
Ulya Trafimovich
de962bd0a9 Fix host path for dexpreopted system server modules defined in Make.
Previously there was a discrepancy between the generated paths for
Soong modules that used "out/soong/system_server_jars" and Make modules
that used "out/system_server_jars". This happened because the default
output directory is $OUT/soong for the normal Soong config and jsut $OUT
for the reduced "null config" created by dexpreopt_gen.

As a result, class loader context for system server jars defined in Make
was referring to nonexistent jars, which caused non-fatal dex2oat errors
(the build was not broken, so the errors remained unnoticed):

  Failed to determine oat file name for dex location out/system_server_dexjars/[...]
  Could not open dex files from location: out/system_server_dexjars/[...]

Test: aosp_walleye-userdebug boots
Test: cherry-picked in master-arc-dev that has a Make system server jar
  arc-services, `lunch lunch cheets_x86-userdebug && m`, check that the
  generated dexpreopt.sh for arc-services contains paths starting with
  "out/soong/system_server_jars" rather than "out/system_server_jars".

Bug: 140712566
Change-Id: Ia7ea8ac383e32042c31d64971cdc8101ea3068cd
Merged-In: Ia7ea8ac383e32042c31d64971cdc8101ea3068cd
(cherry picked from commit 6cf2c0c197)
Exempt-From-Owner-Approval: cherry-pick of approved CL.
2020-04-28 08:31:35 +00:00
Dario Freni
73b6c98e10 Merge "Allow building unsigned APEXs payload for testing." into rvc-dev 2020-04-28 07:13:07 +00:00
Jooyung Han
d5c7ad63ec Merge "apex: file_contexts for override_apex flattened" into rvc-dev 2020-04-28 03:03:26 +00:00
Jiyong Park
28cb10ea68 Merge "mark platform un-availability" into rvc-dev 2020-04-28 02:29:55 +00:00
Jiyong Park
6a9ddc37a9 mark platform un-availability
A module is marked unavailable for platform when 1) it does not have
"//apex_available:platform" in its apex_available property, or 2)
it depends on another module that is unavailable for platform.

In that case, LOCAL_NOT_AVAILABLE_FOR_PLATFORM is set to true for the
module in the Make world. Later, that flag is used to ensure that there
is no module with the flag is installed to the device.

The reason why this isn't entirely done in Soong is because Soong
doesn't know if a module will be installed to the device or not. To
explain this, let's have an example.

cc_test { name: "mytest", static_libs: ["libfoo"]}
cc_library_static { name: "libfoo", static_libs: ["libbar"]}
cc_library { name: "libbar", apex_available: ["com.android.xxx"]}

Here, libbar is not available for platform, but is used by libfoo which
is available for platform (apex_available defaults to
"//apex_available:platform"). libfoo is again depended on by mytest
which again is available for platform. The use of libbar should be
allowed in the context of test; we don't want to make libbar available
to platform just for the dependency from test because it will allow
non-test uses of the library as well.

Soong by itself can't tell whether libfoo and libbar are used only in the
context of a test. There could be another module depending them, e.g.,

cc_library_shared { name: "mylib", static_libs: ["libfoo"] }

can exist and it might be installed to the device, in which case
we really should trigger an error.

Since Make has the knowledge of what's installed and what's not,
the check should be done there.

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

Bug: 153073816
Test: m
Test: remove "//apex_available:platform" from libmdnssd (it is currently
installed to /system/lib), and check that `m system_image` fails

Merged-In: Ia304cc5f41f173229e8a154e90cea4dce46dcebe
(cherry picked from commit 89e850ab84)
Change-Id: Ia304cc5f41f173229e8a154e90cea4dce46dcebe
2020-04-28 09:27:24 +09:00
TreeHugger Robot
ba505df1c4 Merge "Remove libopus from apex_available whitelist" into rvc-dev 2020-04-27 23:54:39 +00:00