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)
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)
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)
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
This was causing build breaks when different devices moved to Android.bp
at different times.
Bug: 150878976
Test: build *_hwasan targets
Change-Id: I68912bb6a5696809c318d1ec816a1bcfbe2df245
@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
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
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
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)
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)
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)
* 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)
Not used anymore, as the make variables have been deleted.
Bug: 152479829
Test: m
Change-Id: I1b29ec33951588ab479fc3e14f85e9aa189b971b
Merged-In: I1b29ec33951588ab479fc3e14f85e9aa189b971b
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
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
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.
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
Compiling native modules against the NDK disables platform features
like ASAN. For anything shipped on the system image there is no
reason to compile against the NDK. Add a new mutator to Soong that
creates a platform and an SDK variant for modules that set
sdk_version, and ignore sdk_version for the platform variant. The
SDK variant will be used for embedding in APKs that may be installed
on older platforms. Apexes use their own variants that enforce
backwards compatibility.
Test: sdk_test.go
Test: TestJNIPackaging
Bug: 149591340
Change-Id: I7d72934aaee2e1326cc0ba5f29f51f14feec4521
Merged-In: I7d72934aaee2e1326cc0ba5f29f51f14feec4521
(cherry picked from commit 82e192c3ae)
Apps that expect to run on older platforms should use JNI libraries
that will also run on older platforms. Require that apps that set
sdk_version have jni_libs modules that also set sdk_version, or
set jni_uses_platform_apis: true to bypass the check.
Fixes: 149591057
Test: app_test.go
Change-Id: I76b9b45fb5773bc4dfc10520108f4f3578723909
Merged-In: I76b9b45fb5773bc4dfc10520108f4f3578723909
Because we already generate the latest current.txt and removed.txt
during the "main" metalava invocation (i.e. stub generation),
we don't have to use metalava for current API check.
Just use diff instead.
Bug: 151160048
Test: Remove @hide from Intent.EXTRA_INSTALL_RESULT, and do `m out/soong/.intermediates/frameworks/base/api-stubs-docs/android_common/check_current_api.timestamp`.
Result is:
```
FAILED: out/soong/.intermediates/frameworks/base/api-stubs-docs/android_common/check_current_api.timestamp
( true && diff -u -F '{ *$' frameworks/base/api/current.txt out/soong/.intermediates/frameworks/base/api-stubs-docs/android_common/api-stubs-docs_api.txt && diff -u -F '{ *$' frameworks/base/api/removed.txt out/soong/.intermediates/frameworks/base/api-stubs-docs/android_common/api-stubs-docs_removed.txt && touch out/soong/.intermediates/frameworks/base/api-stubs-docs/android_common/check_current_api.timestamp ) || ( echo -e "\n******************************\nYou have tried to change the API from what has been previously approved.\n\nTo make these errors go away, you have two choices:\n 1. You can add '@hide' javadoc comments (and remove @SystemApi/@TestApi/etc)\n to the new methods, etc. shown in the above diff.\n\n 2. You can update current.txt and/or removed.txt by executing the following command:\n make api-stubs-docs-update-current-api\n\n To submit the revised current.txt to the main Android repository,\n you will need approval.\n******************************\n" ; exit 38 )
Change-Id: Ib391ca2afb296b5c5174d755c7ffb66d3fa5810c
--- frameworks/base/api/current.txt 2020-04-16 17:50:21.911899599 -0700
+++ out/soong/.intermediates/frameworks/base/api-stubs-docs/android_common/api-stubs-docs_api.txt 2020-04-16 17:51:35.211792638 -0700
@@ -10415,6 +10415,7 @@ public class Intent implements java.lang
field public static final String EXTRA_INDEX = "android.intent.extra.INDEX";
field public static final String EXTRA_INITIAL_INTENTS = "android.intent.extra.INITIAL_INTENTS";
field public static final String EXTRA_INSTALLER_PACKAGE_NAME = "android.intent.extra.INSTALLER_PACKAGE_NAME";
+ field public static final String EXTRA_INSTALL_RESULT = "android.intent.extra.INSTALL_RESULT";
field public static final String EXTRA_INTENT = "android.intent.extra.INTENT";
field public static final String EXTRA_KEY_EVENT = "android.intent.extra.KEY_EVENT";
field public static final String EXTRA_LOCAL_ONLY = "android.intent.extra.LOCAL_ONLY";
******************************
You have tried to change the API from what has been previously approved.
To make these errors go away, you have two choices:
1. You can add '@hide' javadoc comments (and remove @SystemApi/@TestApi/etc)
to the new methods, etc. shown in the above diff.
2. You can update current.txt and/or removed.txt by executing the following command:
make api-stubs-docs-update-current-api
To submit the revised current.txt to the main Android repository,
you will need approval.
******************************
ninja: build stopped: subcommand failed.
```
Test: Remove @removed and @SystemApi from Intent.ACTION_MASTER_CLEAR, and do `m out/soong/.intermediates/frameworks/base/system-api-stubs-docs/android_common/check_current_api.timestamp`
Result is:
```
( true && diff -u -F '{ *$' frameworks/base/api/system-current.txt out/soong/.intermediates/frameworks/base/system-api-stubs-docs/android_common/system-api-stubs-docs_api.txt && diff -u -F '{ *$' frameworks/base/api/system-removed.txt out/soong/.intermediates/frameworks/base/system-api-stubs-docs/android_common/system-api-stubs-docs_removed.txt && touch out/soong/.intermediates/frameworks/base/system-api-stubs-docs/android_common/check_current_api.timestamp ) || ( echo -e "\n******************************\nYou have tried to change the API from what has been previously approved.\n\nTo make these errors go away, you have two choices:\n 1. You can add '@hide' javadoc comments (and remove @SystemApi/@TestApi/etc)\n to the new methods, etc. shown in the above diff.\n\n 2. You can update current.txt and/or removed.txt by executing the following command:\n make system-api-stubs-docs-update-current-api\n\n To submit the revised current.txt to the main Android repository,\n you will need approval.\n******************************\n" ; exit 38 )
--- frameworks/base/api/system-removed.txt 2020-04-16 17:50:21.911899599 -0700
+++ out/soong/.intermediates/frameworks/base/system-api-stubs-docs/android_common/system-api-stubs-docs_removed.txt 2020-04-16 17:53:45.319602905 -0700
@@ -55,7 +55,6 @@ package android.content {
public class Intent implements java.lang.Cloneable android.os.Parcelable {
field @Deprecated public static final String ACTION_DEVICE_INITIALIZATION_WIZARD = "android.intent.action.DEVICE_INITIALIZATION_WIZARD";
- field @Deprecated public static final String ACTION_MASTER_CLEAR = "android.intent.action.MASTER_CLEAR";
field @Deprecated public static final String ACTION_SERVICE_STATE = "android.intent.action.SERVICE_STATE";
field @Deprecated public static final String EXTRA_CDMA_DEFAULT_ROAMING_INDICATOR = "cdmaDefaultRoamingIndicator";
field @Deprecated public static final String EXTRA_CDMA_ROAMING_INDICATOR = "cdmaRoamingIndicator";
******************************
You have tried to change the API from what has been previously approved.
To make these errors go away, you have two choices:
1. You can add '@hide' javadoc comments (and remove @SystemApi/@TestApi/etc)
to the new methods, etc. shown in the above diff.
2. You can update current.txt and/or removed.txt by executing the following command:
make system-api-stubs-docs-update-current-api
To submit the revised current.txt to the main Android repository,
you will need approval.
******************************
```
Test: Add `baseline_file` to `check_api.current` and run `m`
FAILED: out/soong/build.ninja
out/soong/.bootstrap/bin/soong_build -t -l out/.module_paths/Android.bp.list -b out/soong -n out -d out/soong/build.ninja.d -globFile out/soong/.bootstrap/build-globs.ninja -o out/soong/build.ninja Android.bp
error: frameworks/base/StubLibraries.bp:86:1: module "api-stubs-docs" variant "android_common": current API check can't have a baseline file. (module %s): api-stubs-docs
ninja: build stopped: subcommand failed.
Test: With the above changes, run "m api-stubs-docs-update-current-api system-api-stubs-docs-update-current-api", make sure the API files got updated, and then run "m"
Merged-in: I47b146c6fe4caa65775ecf5425ab09b57f43f839
Change-Id: I3045bd8dc95d5f70893729ed65426d8cfc88c5ec
This CL fixes a bug with RuleBuilder's handling of remoteable actions.
It adds a new type of pool to identify remoteable rules by the android
module context. The pool is then set to nil to actually run actions at
NINJA_REMOTE_NUM_JOBS parallelism.
Bug: b/154712413
Test: built aosp crosshatch userdebug
Change-Id: I29452f6fc7a161b94189731e3e3cc1f34907b80c
Merged-In: I29452f6fc7a161b94189731e3e3cc1f34907b80c
All updatable modules are expected to declare their earliest platform
version they support.
Bug: 153539598
Test: m
Change-Id: I6243d276e5ab25a1007187ad34789ca1b4cc87bf
Merged-In: I6243d276e5ab25a1007187ad34789ca1b4cc87bf
Exempt-From-Owner-Approval: cherry-pick from aosp
(cherry picked from commit f40fc858a2)