Commit graph

66393 commits

Author SHA1 Message Date
Colin Cross
120b55a7ca Merge "Add tests for code that will be affected by resource processor feature" into main 2023-07-11 20:17:05 +00:00
Wei Li
1ab0564e65 Merge "Add integration test for m build SBOM of APEXs/APKs." into main 2023-07-11 18:25:39 +00:00
Treehugger Robot
71f5a63267 Merge "Turn on Global ThinLTO by default" into main 2023-07-11 17:42:12 +00:00
Treehugger Robot
da7973112a Merge "Experiment with not using ninja weights" into main 2023-07-11 17:42:06 +00:00
Jiakai Zhang
3444e561dc Change the profile path on host.
This is to decouple profile generation from image configs. A boot image
profile is either for a mainline module or for the platform, which is
orthogonal to boot images.

Bug: 290583827
Test: m nothing
Change-Id: I0918f2fa945a2af1839f1a08ecede331c64d0317
2023-07-11 17:59:24 +01:00
Jiakai Zhang
b1639db53f Extract duplicate code to common helper functions.
Also, fall back to using a default name for the dexpreopt directory if
we are not building for Android.

Bug: 290583827
Test: m nothing
Change-Id: I3fc6ff9142a2dcdf995796f75891b242fe2848d0
2023-07-11 17:59:05 +01:00
Colin Cross
4c90f99cb3 Use depsets for transitive manifests and assets
Instead of rolling assets and manifests up through each static lib,
provide them as a DepSet.  This will help with the next patch, which
needs to pass all the transitive manifests and R.txt files together.

Test: app_test.go
Change-Id: Id8b3aa2bed3771e82ab6bde192c9b43baa38b54c
2023-07-11 09:54:59 -07:00
Jiakai Zhang
da47d3c6f3 Fix dumpOatRules.
This method generates a build rule that runs oatdump for debugging
purposes.

- Pass "--runtime-arg -Xgc:CMC" to oatdump if UFFD GC is enabled.
- Build the phony name from the image name to avoid conflicts when using
  this method for multiple boot images.

Bug: 290583827
Test: m dump-oat-boot
Change-Id: I7adc97cb85b571486b78f173fb80ff7da2c4bfe4
2023-07-11 16:27:01 +01:00
Jiakai Zhang
f7f782c4f1 Remove Modules() from BootclasspathFragmentApexContentInfo.
The Modules() method was for the ART boot image in the ART APEX. It's no
longer needed because we don't install the ART boot image in the ART
APEX anymore.

Bug: 290583827
Test: m nothing
Change-Id: I674a5fa1ed18908413a64129df5947c7d26e638e
2023-07-11 15:29:17 +01:00
Jiakai Zhang
b69e89559f Fix some tests for dexpreopt and remove unnecessary tests.
This CL is to prepare for the changes in http://r.android.com/2652081.
See the description of that CL for the reasons.

Some tests were set up in a fragile way and were easy to be broken when
the implementation changes. This CL is a pure test change that fixes
them.

This CL also removes TestNoUpdatableJarsInBootImage. That test checks
what should go to the ART boot image and what should go to the
platform one, which does not apply today because boot images are not
associated with mainline modules anymore: a boot image may take jars
from multiple mainline modules and the platform, and a mainline module
can contribute to multiple boot images. In practice, we have ART jars in
the platform boot image, and we are going to add core-icu4j and
consrypt to the ART boot image, which is now for testing only.

Bug: 290583827
Test: m nothing
Change-Id: I22c45cbf6f853b030b68edb51197854e9c53a02e
2023-07-11 15:29:12 +01:00
Romain Jobredeaux
aa634fdbdb Merge "Support target and max sdk version in app bp2build." into main 2023-07-11 13:34:29 +00:00
Liz Kammer
796921d211 Ensure data is passed to all generation actions
Test: go test genrule tests
Test: build/soong/tests/genrule_sandbox_test.py \
      framework-cppstream-protos framework-javastream-protos
Change-Id: I16fa939280c7ff0f230a0a8cf18af5e55f16eb03
2023-07-11 08:27:51 -04:00
Yi Kong
add6375a10 Turn on Global ThinLTO by default
Build C/C++ targets with ThinLTO with "--lto-O0" by default. This takes
advantage of better dead code elimination and CFG simplification due to
ThinLTO's global view of the program, but do not enable the costly LTO
optimizations. This also makes builds faster because we can avoid doing
codegen for the dead code.

Code size for panther-userdebug:
                   /system/bin  /system/lib  /system/lib64
Original           57648        86264        181700
Global ThinLTO     55764        84916        175728
                   -3.27%       -1.56%       -3.29%

Build time for aosp_arm64-userdebug:
                   clang time   linker time
Original           56993.87s    1712.36s
Global ThinLTO     52839.18s    3114.93s

saving 4.68% build time in total.

Bug: 169004486
Test: presubmit
Change-Id: Idb0f4675ca4750b8b12b24f4679579419d3448c8
2023-07-11 21:26:52 +09:00
Aditya Kumar
9488eb82d4 Merge "gsimple-template-names" into main 2023-07-11 05:54:11 +00:00
Treehugger Robot
5af242249d Merge "Copy imported APKs to output filename" into main 2023-07-11 04:52:46 +00:00
Igor Foox
24739676c7 Remove openwrt modules from genrule denylist.
With the other change in this topic,
`OpenwrtControlServerProto_h` and
`OpenwrtControlServerProto_cc` both successfully build with sandboxing
on.

Test: build/soong/tests/genrule_sandbox_test.py --show-diff OpenwrtControlServerProto_h OpenwrtControlServerProto_cc
Test: GENRULE_SANDBOXING=true m OpenwrtControlServerProto_h OpenwrtControlServerProto_cc
Test: GENRULE_SANDBOXING=true m droid
Change-Id: Id56824ed935e1d16d2333e5a1aeac248cdfcaeb6
2023-07-10 23:15:43 -04:00
Igor Foox
921a465919 Merge "Update genrule denylist to make m droid build." into main 2023-07-10 22:51:44 +00:00
Wei Li
59df0ee442 Add integration test for m build SBOM of APEXs/APKs.
Bug: 266726655
Test: build/soong/tests/sbom_test.sh
Change-Id: Id8002042f607f8e158f561ca47e0a84a8b8927e2
2023-07-10 15:50:38 -07:00
Colin Cross
5780d57a71 Copy imported APKs to output filename
android_app_import and android_test_import modules with processed: true
and skip_preprocessed_apk_checks are used directly from the source tree.
If the source file name doesn t match the module name and the file is
used as test data it can result in the wrong filename being used.  Copy
the source file to an output file with the correct name first.

Bug: 290376750
Test: m CtsAppSecurityHostTestCases
Change-Id: I4a6dd1c5e48db7085ea41035def31f0844948a46
2023-07-10 22:18:01 +00:00
Fabián Cañas
bc10544dec Make clang debug level configurable
The -g flag is controllable with CLANG_DEFAULT_DEBUG_LEVEL from -g0 to
-g3. The default remains -g

Test: Build with CLANG_DEFAULT_DEBUG_LEVEL=debug_level_1

Change-Id: I913d3a0cb028484f9496a7e0a2298852f9b699cd
2023-07-10 20:49:22 +00:00
Igor Foox
04ff5f90ae Update genrule denylist to make m droid build.
Test: lunch aosp_cf_x86_phone && GENRULE_SANDBOXING=true m droid
Change-Id: I9092df9a407ffe9a7f1c12f18fb0ce1c5fa027a1
2023-07-10 14:58:51 -04:00
AdityaK
423e4ce9e3 gsimple-template-names
Based on: https://chromium-review.googlesource.com/c/chromium/src/+/3988987

```
Savings are almost 330M on 11G

du -s out.diff/target/product/vsoc_arm64/symbols
10751692        out.diff/target/product/vsoc_arm64/symbols
du -s out/target/product/vsoc_arm64/symbols
11086508        out/target/product/vsoc_arm64/symbols
```

Change-Id: I49a5c4cadc77cb0d97e680e95c4efa7156a42f13
2023-07-10 17:36:22 +00:00
Romain Jobredeaux
496660d38a Support target and max sdk version in app bp2build.
Test: Unit tests + CI
Bug: 285304294
Bug: 280465047
Change-Id: I9bb1b6f9729ad783a43837d77dcf2d02b50ca77e
2023-07-10 11:50:00 -04:00
Elliott Hughes
ff96fe1589 Merge "Remove -fstrict-aliasing from arm32." into main 2023-07-10 14:37:39 +00:00
Liz Kammer
b492843c3f Handle static binary repetition of system deps
Test: b build `bmod toybox-static`
Test: go test bp2build tests
Change-Id: Id728f6fd08832a4fc153f0ff5282cdfb6b19c2f6
2023-07-10 10:28:02 -04:00
Treehugger Robot
ab8ed75b6b Merge "kzip build: pipe error message to stderr." into main 2023-07-10 11:45:09 +00:00
Jingwen Chen
ce08efd395 kzip build: pipe error message to stderr.
This was going to stdout so it wasn't showing up on build_error.log.

Test: n/a
Change-Id: I58ac08961b089d06720a307ece3398594b3456de
2023-07-10 08:18:58 +00:00
Treehugger Robot
b2ace8d72d Merge "Implement OutputFileProducer for android_app_import and android_test_import" into main 2023-07-08 00:36:53 +00:00
Liz Kammer
8822ff5193 Experiment with not using ninja weights
Test: CI
Change-Id: Id611059dba35aaaebc7cf787381669c4294ceb53
2023-07-07 18:31:39 -04:00
Treehugger Robot
00042a4875 Merge "rust: Allow any host tool for custom_bindgen" into main 2023-07-07 22:10:25 +00:00
Elliott Hughes
9bbe96068d Remove -fstrict-aliasing from arm32.
Our global default is -fno-strict-aliasing (including for 32-bit x86),
so let's avoid a source of arm32-only bugs.

Bug: http://b/31600139
Test: treehugger
Change-Id: Iaf3069200b2969718593387dc5b756c574a5d68a
2023-07-07 19:45:24 +00:00
Trevor Radcliffe
e3c6a296cf Revert "Revert "add media.swcodec to Bazel prod allowlist""
This reverts commit 061012475c.

Reason for revert:
Debugging the failures from the previous attempt

Change-Id: Ide7161ca46fd3bac087e976712e07ddeecf6335e
2023-07-07 19:29:04 +00:00
Jason Macnak
4ae9c14557 Merge "Remove FrontendStub_[cc|h] from SandboxingDenyModuleList" into main 2023-07-07 19:16:14 +00:00
Colin Cross
5368d0b44a Implement OutputFileProducer for android_app_import and android_test_import
Fixes: 290376750
Test: builds
Change-Id: I5fc3a759462cfd4342b9330ac8978368feee26ca
2023-07-07 18:36:08 +00:00
Colin Cross
ff3ff7f354 Add tests for code that will be affected by resource processor feature
Add a test for the aapt2 resource processing code that will be affected
by the resource processor feature in a subsequent CL.

Test: TestAndroidResourceProcessor
Change-Id: I39712853f7bbfb7963f1b71e234d039d5ccaae53
2023-07-07 10:58:31 -07:00
Colin Cross
702ef0a07a Merge changes I70f81120,If8f2534e into main
* changes:
  Export ReverseSliceInPlace and ReverseSlice
  Make CopyOf generic
2023-07-07 17:07:50 +00:00
Andrei Homescu
4494685aec rust: Allow any host tool for custom_bindgen
Switch custom_bindgen to use any HostToolProvider
instead of just Rust modules, so any host binary can
be used as the bindgen wrapper.

Bug: 242243245
Test: presubmit
Change-Id: I9ba189b2857b3049dcf14842c178ce5846bab2f7
2023-07-07 04:59:07 +00:00
Yabin Cui
f67bc44848 Merge "Update clang version to clang-r498229" into main 2023-07-06 23:54:42 +00:00
Colin Cross
b5e3f7dad5 Export ReverseSliceInPlace and ReverseSlice
... and add tests.

Test: TestReverseSliceInPlace, TestReverseSlice
Change-Id: I70f811207fdb2af891f7ef3fe19cbe5c7276135a
2023-07-06 16:36:50 -07:00
Cole Faust
39381dc2bd Merge "Handle RepoMappingManifest actions" into main 2023-07-06 23:14:11 +00:00
Colin Cross
13aeb689af Make CopyOf generic
Test: util_test.go
Change-Id: If8f2534ec454903eb967dc9ec0c8708096d1baff
2023-07-06 15:02:56 -07:00
Cole Faust
950689a9c2 Handle RepoMappingManifest actions
These are essentially FileWrite actions, like SourceSymlinkManifest.

However, currently aquery appears to give non-deterministic results
for the file content. Emit an empty file for now to avoid the
non-determinism.

Fixes: 288292933
Bug: 287539324
Test: Presubmits
Change-Id: Ieaf8aff0d58d2d69087e4e34dc99074a015e700c
2023-07-06 09:44:14 -07:00
Treehugger Robot
a9778d576b Merge "Revert "Commend out dcla_apex_comparison_test.sh"" 2023-07-06 01:27:04 +00:00
Treehugger Robot
253054a175 Merge "Add comment for afdo flag" 2023-07-05 20:40:46 +00:00
Treehugger Robot
0b42c30273 Merge "Remove --skip-soong-tests from kzip builds" 2023-07-05 17:00:41 +00:00
Vinh Tran
056effb8b1 Add comment for afdo flag
Change-Id: If80df0ac0527784b13158325589c29587db8d5f9
Test: N/A
2023-07-05 15:48:21 +00:00
Liz Kammer
e58161b93f Remove --skip-soong-tests from kzip builds
Bug:289993105
Change-Id: I12d0a980141a9ef03a42c943ae92d19b717e7ff9
2023-07-05 12:27:49 +00:00
Yi Kong
b9d5046d8b Simplify LTO flags handling
... and add more comments about the use of --lto-O0.

Test: presubmit
Change-Id: I2ef7bf4f100a8d7559a6b738e9211c596d579dc6
2023-07-03 17:16:42 +09:00
Treehugger Robot
222995b2c1 Merge "don't export systemserverclasspath_fragment if contents are empty" 2023-07-01 00:07:12 +00:00
Treehugger Robot
ece97e5658 Merge "Suppress resourceshrinker stdout in soong" 2023-06-30 23:26:28 +00:00