Commit graph

50667 commits

Author SHA1 Message Date
Ulya Trafimovich
6fad1d0dba Dexpreopt: use "speed-profile" if a system server jar has a profile.
The motivation is to reduce file size and in-process memory footprint
for "services" (which is currently the only system server jar that has a
profile). For other system server jars that have no profile keep using
"speed", as enabling "speed-profile" for them would completely disable
AOT-compiled code.

Compare .odex file size:
  - before: 44360 services.odex
  - after:  24968 services.odex

Bug: b/237399630
Test: lunch aosp_sargo-userdebug && m
Change-Id: I844b9607c496d3d6e7048dc6bb8cd958ecbaa441
2022-07-07 12:12:50 +01:00
Wei Li
40f9873612 Convert the property "manifest" properly for override_apex.
1) When it is not set in base apex, default file name should be set explicitly in bp2build converter of apex
2) The manifest file path should be used as-is when base apex and override_apex is in the same Android.bp
3) The manifest file path should be prepended with package of base apex when base apex and override_apex is in different Android.bp

Bug: 216442475
Test: m nothing
Change-Id: Icd3523ebc31d885f67bea02aec05dbfc77671e87
2022-05-23 17:22:35 -07:00
Liz Kammer
707f65d3d5 Merge "Remove library decorator for extracting headers" 2022-05-23 19:36:57 +00:00
Cole Faust
bd4c14a7f9 Merge "Add imports property to py_library rules" 2022-05-23 18:55:51 +00:00
Treehugger Robot
52edad230a Merge "Add blockers of cc mainline modules to allowlist" 2022-05-23 18:55:01 +00:00
Christopher Parsons
b002f87d2e Merge "cc bazel handlers: use better interface checking" 2022-05-23 18:54:50 +00:00
Treehugger Robot
5bec8d41ea Merge "Clean up some bp2build technical debt" 2022-05-23 18:01:04 +00:00
Jingwen Chen
d9d096ec7c queryview: don't generate 'for' attributes
'for' is a reserved keyword

Test: CI
Fixes: b/233579439
Change-Id: I7b94250574465353bbd6bfb82a7ea37ce9ae17a3
2022-05-23 09:38:39 +00:00
Treehugger Robot
14b500daba Merge "Revert "Use D8 by default for android_test"" 2022-05-23 05:49:40 +00:00
Jared Duke
4e445be558 Revert "Use D8 by default for android_test"
This reverts commit 02edc10047.

Reason for revert: Breaks test_suites_x86_64_coverage

Bug: 233421462
Change-Id: I7b04d3fd7802be0f271ea3c29ef25e3d08ab1389
2022-05-23 04:00:44 +00:00
Bob Badour
0507921dcf gen_module visibility tests.
Test: m cts dist reportmissinglicenses

Change-Id: Ib2f8d0ad46ffe795d392166a74a7c6309b1246e2
2022-05-20 16:54:13 -07:00
Bob Badour
a5ea2479d3 Fix bug: allow multiple gen_notice modules.
Test: m cts dist reportmissinglicenses

Change-Id: I07963c83eaddfe363a04871e813b56fe7f1465ad
2022-05-20 16:54:00 -07:00
Treehugger Robot
1811ed3764 Merge "Use D8 by default for android_test" 2022-05-20 22:46:15 +00:00
Wei Li
440c66a799 Merge "Change init process of bp2buildAllowlist so the Soong plugin of bp2build allowlist can hookup properly." 2022-05-20 20:36:40 +00:00
Jared Duke
02edc10047 Use D8 by default for android_test
android_test defaults to using R8, but with shrinking, optimization and
obfuscation disabled, eliminating most of the benefits of R8. Instead,
use D8 by default, improving build performance and avoiding any other
issues that may arise in test-specific code related to whole-program R8
execution. An initial audit shows that android_test targets that *do*
enable shrinking or optimization also explicitly opt in to R8.

A follow-up CL will do the same for android_test_helper_app, but that
requires some additional auditing of downstream targets.

Bug: 192032291
Test: m + presubmit
Change-Id: I5b14a0986dde210f241a77c3a93daacf9e53d667
2022-05-20 12:02:13 -07:00
Lukács T. Berki
4668e9968c Merge "Remove memberInterVersionMutator." 2022-05-20 15:21:00 +00:00
Chris Parsons
6ce2cf9b69 cc bazel handlers: use better interface checking
This is a far better approach for ensuring that bazel handlers implement
the BazelHandler interface, as it causes a compile error if they do not
implement the appropriate interface methods.

Test: Manually verified no change in ninja file
Change-Id: I63a4f8b57e3aedd4c0915c2fd2eb7029e9a993aa
2022-05-20 10:54:17 -04:00
Christopher Parsons
489128b8ef Merge "Refactor mixed builds to only take one pass" 2022-05-20 14:13:49 +00:00
Chris Parsons
f874e46153 Refactor mixed builds to only take one pass
This large refactoring has both immense performance implications and
improves mixed builds complexity / usability. Summary:

1. Queueing calls to Bazel is done in a new mutator instead of a full
   soong_build pass. Normal soong_build flow is interrupted (via a
   functional hook in blueprint) to invoke bazel and parse its response.
2. Implementing mixed build support for additional modules is as simple
   as implementing MixedBuildsBuildable. In this interface, define the
   request that must be queued to Bazel, and then subsequently define
   how to handle the returned bazel cquery metadata.
3. Mixed builds consists of only a single pass. This greatly
   improves mixed build performance.

Result:
  A 33% runtime improvement on soong analysis phase with mixed builds.

Caveats:
  C++ BazelHandler handling still remains a bit of a mess; I did what
  I could within this CL's scope, but this may require additional cleanup.

Test: Treehugger
Test: Verified that aosp_arm ninja file is bit-for-bit identical with or
without this change.

Change-Id: I412d9c94d429105f4ebfafc84100d546069e6621
2022-05-20 10:04:13 -04:00
Paul Duffin
e73d52cb9b Merge "Add custom java_sdk_library info to the SDK info file" 2022-05-20 13:59:19 +00:00
Lukacs T. Berki
ab392edc47 Remove memberInterVersionMutator.
paulduffin@ says it's not necessary anymore.

Test: Presubmits.
Bug: 232546567
Change-Id: I6ac69fbdc7a202ac54f250ea6cde0ea99d75864c
2022-05-20 15:23:06 +02:00
Md Shahriar Hossain Sajib
cf5161be7c Merge "Revert "Turn gtest isolated true by default"" 2022-05-20 08:16:01 +00:00
Md Shahriar Hossain Sajib
d8b58663ff Revert "Turn gtest isolated true by default"
This reverts commit d2a9d88410.

Reason for revert: DroidMonitor-triggered revert due to breakage https://android-build.googleplex.com/builds/quarterdeck?branch=git_master&target=aosp_bramble-userdebug&lkgb=8618360&lkbb=8620137&fkbb=8618374, bug b/233280626

Bug: 233280626
Change-Id: If56b36ea1c883415b90bd2153707cb69df29776e
2022-05-20 08:02:50 +00:00
Yi Kong
8e836ba4b7 Merge "Rename modulesAddedWall to modulesWarningsAllowed" 2022-05-20 00:26:18 +00:00
Colin Cross
6c04c66b7e Merge "Don't call dexpreopter methods on host modules" 2022-05-19 20:46:23 +00:00
Julien Desprez
754edfa660 Merge "Turn gtest isolated true by default" 2022-05-19 20:38:45 +00:00
Cole Faust
b09da7e863 Add imports property to py_library rules
This is to avoid having it hardcoded in a fork of the
py_library rule.

Most import attributes should just be set to ".", but
our previous solution always hardcoded it to ".." instead,
for ndkstubgen. ndkstubgen uses pkg_path: "ndkstubgen",
i.e., it set pkg_path to the name of the folder that
contained the Android.bp file. In this specific scenario,
imports = ".." works. Recreate that behavior here as well,
because we don't handle pkg_path properly yet.

Fixes: 233081071
Test: build/bazel/ci/bp2build.sh
Change-Id: Ib5e6a8edf428c74d4b5947f0ec53a2151001367a
2022-05-19 12:38:27 -07:00
Bob Badour
335a4333fe Merge "Add gen_notice module." 2022-05-19 18:03:09 +00:00
Jingwen Chen
37232d819a Merge "bp2build: keep existing build files for prebuilts/build-tools recursively." 2022-05-19 15:27:52 +00:00
Lukács T. Berki
913b3c7585 Merge "Keep a "sanitizer dependency" flag for each sanitizer." 2022-05-19 12:14:04 +00:00
Yi Kong
de936474bc Rename modulesAddedWall to modulesWarningsAllowed
MODULES_ADDED_WALL is deceiving and it actually meant which modules are
allowed to have warnings (do not automatically append -Werror flag).

Test: presubmit
Bug: 233183337
Change-Id: Ibd21e269eba04d01f13026d70a9e34ccb1cf26d7
2022-05-19 20:11:10 +08:00
Jingwen Chen
23ca2d2d26 bp2build: keep existing build files for prebuilts/build-tools recursively.
This lets us test https://cs.android.com/android/platform/superproject/+/master:prebuilts/build-tools/tests/BUILD.bazel;l=2;drc=d3dc3d5f20dee2a67dabc1a89dcc9ce93d6f5d44

Test: CI
Change-Id: Ic7c43e3ca655a222ed9113b31761f3cb0d8a45f3
2022-05-19 09:53:56 +00:00
Lukacs T. Berki
2da6c3cc86 Keep a "sanitizer dependency" flag for each sanitizer.
This is so that we can avoid mutating state in sanitizerMutator, as
would be necessary if we only had a single bit for every sanitizer
together.

Test: Presubmits.
Change-Id: I5576367c12972fbea64342ab123118ec5a2cfeec
2022-05-19 09:48:57 +02:00
Yi Kong
6769323a44 Merge "Only set -Wall once." 2022-05-19 07:43:08 +00:00
Bob Badour
eef4c1c563 Add gen_notice module.
Refactor notices to support notices for multiple modules.

Enforce visibility and handle missing dependencies.

Bug: 213388645

Change-Id: Id6a81987f087419ad37d0cce57a71e8a7c4cd6e0
2022-05-18 16:38:19 -07:00
Chih-Hung Hsieh
8212621410 Reduce default global google-* clang-tidy checks
Now only keep the ones that do not have thousands of warnings.
We can add more such checks locally or when more warnings
are fixed or suppressed in source files.

Bug: 112478838
Bug: 218759304
Test: make tidy-soong_subset
Change-Id: Iac93310441cdc64ed80e8c30159a08f95e1e9ebc
2022-05-18 14:49:31 -07:00
Elliott Hughes
ed4a27b2e1 Only set -Wall once.
We set -Wall in the global cflags, and then again at the point where we
decide whether or not to add -Werror. The trouble with this is that it
undoes the effect of any attempt to disable a warning implied by -Wall.

Discovered while trying to enable -Wmisleading-indentation (which is
part of -Wall) in a way that doesn't apply to external/ or vendor/.

Test: treehugger
Change-Id: I68d74fb05922dd9f6bd4c8423ca69b485c15e3d2
2022-05-18 13:15:00 -07:00
Lukács T. Berki
53c6c67cbb Merge "Make java_fuzz_host not implement Sanitizeable." 2022-05-18 06:43:42 +00:00
Colin Cross
61df14acce Don't call dexpreopter methods on host modules
Only call the dexpreopter methods on device modules so broken
dexpreopt configs don't break host-only unbundled builds.

Bug: 207813628
Test: tradefed branch builds
Change-Id: I41deb765a29c5cef9130a4d26aad7f956f75cdd5
2022-05-17 13:15:39 -07:00
Treehugger Robot
478db1a882 Merge "bp2build: add support for planting unresolved symlinks in the symlink forest." 2022-05-17 19:39:42 +00:00
Treehugger Robot
822029166d Merge "Fix prebuilts of overridden apps" 2022-05-17 19:03:42 +00:00
Jingwen Chen
d4b1dc8b2a bp2build: add support for planting unresolved symlinks in the symlink forest.
In the isDir check, there's a possibility that the Stat check fails
because the path is an unresolved symlink. Verify it with Lstat (which
would succeed, since it doesn't follow links), and treat it like a file
if Lstat succeeds.

Test: new integration test
Fixes: 232370097
Change-Id: I9807ca363a5dbdc20639b489b54627bd2cc1ca60
2022-05-17 12:17:53 +00:00
Lukacs T. Berki
8c77ae369a Make java_fuzz_host not implement Sanitizeable.
Also remove a tiny bit of state mutation from sanitizerMutator. Every
little bit helps!

Test: Prebuilts + comparing soong/build.ninja .
 Your branch is up to date with 'aosp/master'.

Change-Id: I73b28b660b572610242765d87b70ab081b0b43df
2022-05-17 11:25:28 +02:00
Treehugger Robot
7583481570 Merge "Make "overrides" attribute of Android_app overridable" 2022-05-17 06:38:19 +00:00
Colin Cross
aaa0c1ffcd Fix prebuilts of overridden apps
AndroidApp had its own HideFromMake method and flag that shadowed
the one in ModuleBase.  This caused performOverrideMutator to set the
AndroidApp flag, but ModuleBase.skipInstall to read the ModuleBase
flag, resulting in a conflicting install rule being created.  Remove
AndroidApp's HideFromMake in favor of the ModuleBase one.

Bug: 232788722
Test: TestOverrideAndroidAppWithPrebuilt
Change-Id: I8c0dfcb50ff4dc1e4d0574f150b10d79908f46aa
2022-05-16 18:27:00 -07:00
zhidou
198f589222 Make "overrides" attribute of Android_app overridable
Move overrides attribute from appProperties to overridableAppProperties

Bug: 220029162
Test: m
Change-Id: I6f527df3173f142311734333ad37018c83d5e279
Merged-In: I6f527df3173f142311734333ad37018c83d5e279
(cherry picked from commit a2ce78f80d)
2022-05-16 18:26:52 -07:00
Mark Dacek
0de6fdde4d Merge "Grammar nit. Test: N/A" 2022-05-16 19:37:07 +00:00
Paul Duffin
958806b8c8 Add custom java_sdk_library info to the SDK info file
Previously the SDK info file only contained basic common information
about each member. This change adds support for each member to
provide custom information to add to the info file.

It uses that mechanism to add the following:
* "dist_stem"
* "scopes" object containing:
  * for each scope a:
    "<scope>" object containing:
    * "current_api" - the path within the snapshot for the API's .txt
                      file.
    * "removed_api" - the path within the snapshot for the removed
                      API's .txt file.
    * "latest_api" - the path within the build to the latest finalized
                     API .txt file.
    * "latest_removed_api" - the path within the build to the latest
                             finalized removed API .txt file.

In order to access the latest API files it was necessary to add and
resolve dependencies on the module that makes them available. In order
to do that safely the code for creating the names of the modules was
refactored to avoid duplicating the name creation logic.

Bug: 204763318
Test: m nothing
Change-Id: Ica68abbd2b2c7c2b2b7877b502f96cc89f06fd68
2022-05-16 17:09:10 +00:00
Alix Espino
5b75bf1d7e Merge "convert Dynamic_list property" 2022-05-16 16:33:51 +00:00
Liz Kammer
5454944b9a Remove library decorator for extracting headers
It is unused and removing it allows us to use the same function for
prebuilt/not libraries.

Test: bp2build.sh
Change-Id: I92ac56496cff2c2e55d6eb9f261fe75a1b232856
2022-05-13 19:52:27 -04:00