Commit graph

62330 commits

Author SHA1 Message Date
Colin Cross
4a80a158d4 Don't add dexpreopt compat deps to android_library modules
android_library modules are only dexpreopted when built into an app,
and the app will already get the dexpreopt compat dependencies itself.
Adding the compat dependencies to android_library modules causes
circular dependencies when the android_library is used to build
part of the framework, which is then used to build the compat libraries,
which is added as a dependency to the andorid_library.

Test: TestUsesLibraries
Change-Id: I3aca780858c7e5f19d270bcbbe18e6cff8616b43
2022-12-21 21:56:16 -08:00
Treehugger Robot
9f8599549d Merge changes Ib4fe4def,I6fdecefa
* changes:
  Disable sanitizer for vendor_snapshot_object modules
  VSDK: capture hwasan static libs for vsdk snapshot build
2022-12-22 03:52:47 +00:00
Miguel Aranda
fe12962e13 Merge "Add conscrypt updatable certificates." 2022-12-21 23:20:39 +00:00
Colin Cross
62e4fe15dc Merge changes I47b8fdd9,Ifbd121ab
* changes:
  Return linux as host OS from getConfigString when using musl
  Use //build/bazel/platforms/os:linux_glibc for osLinux
2022-12-21 19:33:14 +00:00
Vinh Tran
72e1d65f05 Merge "Remove creation of has_stubs in cc_library_shared by bp2build" 2022-12-21 03:16:08 +00:00
Colin Cross
046fcea830 Return linux as host OS from getConfigString when using musl
linux_musl is an alternative host OS, return "linux" from
getConfigString when it is being used.

Bug: 259266326
Test: build/bazel/ci/mixed_libc.sh
Test: USE_HOST_MUSL=true build/bazel/ci/mixed_libc.sh
Change-Id: I47b8fdd93b36345f82dd4e8455edb4c579f805e9
2022-12-20 15:32:18 -08:00
Colin Cross
133782e4bb Use //build/bazel/platforms/os:linux_glibc for osLinux
osLinux is implicitly glibc, use //build/bazel/platforms/os:linux_glibc
for the configurability select key for it.

Bug: 259266326
Test: build/bazel/ci/mixed_libc.sh
Test: USE_HOST_MUSL=true build/bazel/ci/mixed_libc.sh
Change-Id: Ifbd121ab3d943f3fdfbd3f6c3e982d1eaaaa9ec1
2022-12-20 15:29:31 -08:00
Mark Dacek
003cbe3bc5 Merge "Add bazel metrics proto." 2022-12-20 22:38:35 +00:00
Yu Liu
295cdfc79c Merge "Enable code coverage for cc shared library" 2022-12-20 20:20:12 +00:00
Treehugger Robot
463c15de15 Merge "Make more cc tests parallel" 2022-12-20 19:38:58 +00:00
MarkDacek
2ee2db3bf4 Add bazel metrics proto.
This is to marshal Bazel metrics for the sake of uploading to the
Android metrics pipeline.
Test: m nothing
Test: run the regen script

Change-Id: Ia4eca879cff07425c389e30a385418f9865159d6
2022-12-20 18:34:22 +00:00
Jigar Thakkar
1d174b185f Merge "Revert "Allow adding extra tradefed options in the Android.bp file"" 2022-12-20 16:24:20 +00:00
Jason Wu
1c6ca94935 Merge "Delete Stale Metrics Files" 2022-12-20 15:56:21 +00:00
Jingwen Chen
889f2f2844 mixed builds: Make apex's GetBazelLabel return the label of the override_apex, if applicable.
And add test1_com.android.tzdata to prod allowlist.

Fixes: 261054570
Bug: 261054570
Test: mkcompare
Change-Id: I314a4e44ade958ba9a91f71430d76175d734579e
2022-12-20 07:35:20 +00:00
Treehugger Robot
597894279d Merge "mixed builds: add cc_test bazel handler, and add adbd_test to staging allowlist." 2022-12-20 03:12:53 +00:00
Jared Duke
5979b30170 Revert "Revert "Include proguard flag files from transitive java_library deps""
This reverts commit 6f7e288fb5.

Reason for revert: Downstream proguard usage has been fixed.

Change-Id: I3667e7e908eebc62c640b42cb96b04993fc66e45
2022-12-19 23:05:28 +00:00
Jason Wu
cc166a77bd Delete Stale Metrics Files
Test: Run `m --bazle-mode-dev nothing` again  after `m --bazel-mode-dev nothing`.
bp2build_metrics.pb no longer exists, the rest metrics files
have the timestamp of the latest creation time.

Bug: 256617990
Change-Id: I869d1b9c3abcb517744e66b21e5c12d6b5b1e97b
2022-12-19 21:16:50 +00:00
Vinh Tran
83f88cdc8b Remove creation of has_stubs in cc_library_shared by bp2build
Because when stubs_symbol_file is defined on cc_library_shared, has_stubs is already implied to be true.

Bug: 260771171
Test: go test
Change-Id: I3b9a2cfb9000411d1b5f22da87dc339267775799
2022-12-19 13:56:11 -05:00
Chris Parsons
52b842a1fa Update allowlist to fix build
A dependency added in aosp/2353522 resulted in bazel-mode-dev to start
failing. This CL updates the allowlist to support the new dependency.

Test: build/bazel/ci/mixed_libc.sh
Change-Id: I03ac035517a66ff0b21543e8b94d71c9d7ddb461
2022-12-19 11:45:23 -05:00
Tahsin Loqman
77dc7d0839 Revert "Allow adding extra tradefed options in the Android.bp file"
This reverts commit 8ec823cba1.

Reason for revert: DroidMonitor: Potential culprit for Bug b/262965953 - verifying through ABTD before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted.

Change-Id: I236cc36981d8b30527ca286632727f8ca267e969
2022-12-19 16:27:25 +00:00
Justin Yun
08270c6c2d Disable sanitizer for vendor_snapshot_object modules
vendor_snapshot_object modules do not provide sanitizers.
Avoid sanitizer mutation for these modules.

Bug: 234772527
Test: build against the vsdk with SANITIZE_TARGET=hwaddress
Change-Id: Ib4fe4def673aa77a4321f47c09393adcb2fa2964
2022-12-19 23:04:08 +09:00
Treehugger Robot
0db300d9da Merge "Add test for missing certificate with AllowMissingDependencies" 2022-12-19 13:11:16 +00:00
Justin Yun
8814fc5c20 VSDK: capture hwasan static libs for vsdk snapshot build
When generating vsdk snapshot with SANITIZE_TARGET=hwaddress option,
include hwasan static libraries to the vendor snapshot.

Bug: 234772527
Test: build against the vsdk with SANITIZE_TARGET=hwaddress
Change-Id: I6fdecefaa8557b5c968745487a3ed7c959e682f9
2022-12-19 17:18:22 +09:00
Cole Faust
abc182cc94 Merge "Allow exporting bazel mixed build allowlists to simple text files" 2022-12-19 03:09:11 +00:00
Kevin Dagostino
32edd1a608 Add tradefed attributes to cc_test bazel macro
The BUILD file will now have the needed attributes to run the tradefed
test rules.

Test: b test //packages/modules/adb:adbd_test --platforms=//build/bazel/platforms:android_target
Change-Id: I5cb84ccdde27a7fadbef479269df594344a29187
2022-12-18 04:38:16 +00:00
Treehugger Robot
2731ca8377 Merge "Allow adding extra tradefed options in the Android.bp file" 2022-12-17 03:40:01 +00:00
Colin Cross
ed8b52ca27 Merge "Revert "Include proguard flag files from transitive java_library deps"" 2022-12-17 03:15:36 +00:00
Colin Cross
6f7e288fb5 Revert "Include proguard flag files from transitive java_library deps"
This reverts commit 9c54f032b9.

Reason for revert: b/262940536

Bug: b/262940536
Change-Id: I8140eacc7ca8716f799561412cb5cef29df35d29
2022-12-17 03:15:22 +00:00
Treehugger Robot
c1260dd095 Merge "Include proguard flag files from transitive java_library deps" 2022-12-17 01:39:08 +00:00
Yu Liu
f01a0f0ca9 Enable code coverage for cc shared library
Bug: None
Test: Manual and unit tests
Change-Id: I5064e4407d3451ff172ab203256f3c073cc0ad1b
2022-12-16 14:16:22 -08:00
Jared Duke
9c54f032b9 Include proguard flag files from transitive java_library deps
Ensure proguard flag files specified by java_library targets propagate
to downstream targets. This matches bazel behavior, as well as
behavior for transitive android_library deps.

Bug: 212623640
Test: m + presubmit
Change-Id: I61abaf1fd43d6f06bb610383751bb26e9a1bafd6
2022-12-16 14:09:08 -08:00
Sasha Smundak
1845f42085 Simplify soong_build top-level code
* `android.Context` holds `android.Config`, so provide an accessor to it
  and avoid passing them separately to a lot of functions.
* factor common code in `readBazelPaths`/`getExistingBazelRelatedFiles`
  into `readFileLines`
* refactor check-error-and-quit into `maybeQuit`
* use switch instead of if-elseif-... where appropriate
* rearrange the code in `runApiBp2build`, `runSymlinkForestCreation`

Test: treehugger
Change-Id: I639929c21ec4999cdfd737c07136f32df2d488bc
2022-12-16 11:03:17 -08:00
Sasha Smundak
af5ca926be Keep all Soong command line arguments in a single structure
Define a structure android.CmdArgs and keep all soong_build command line
arguments used to build a configuration in it. Some of them related to BazelMode
were previously kept in Blueprint's bootstrap.Args where they do not belong.
This simplifies the code and lays the gound work for future simplifying changes.

Test: treehugger
Change-Id: I995871f4e6b0e95cc9df65696ad2020df221d8c8
2022-12-16 11:02:12 -08:00
Cole Faust
705968d043 Allow exporting bazel mixed build allowlists to simple text files
So that they the allowlists can be read from build_mainline_modules_bundles.sh.

Bug: 262302253
Test: m out/soong/bazel_prod_mixed_builds_enabled_list.txt out/soong/bazel_staging_mixed_builds_enabled_list.txt && cat out/soong/bazel_prod_mixed_builds_enabled_list.txt && echo && cat out/soong/bazel_staging_mixed_builds_enabled_list.txt
Change-Id: Id5f89ebb651a52dc5368681a20d6183703e05bd4
2022-12-15 15:40:36 -08:00
Treehugger Robot
841fc797c1 Merge "Enable -Wno-xor-as-pow for external code." 2022-12-15 22:21:35 +00:00
Sam Delmerico
484fb0907d Merge "bp2build disable malloc-rss-benchmark" 2022-12-15 22:04:15 +00:00
Treehugger Robot
a6d4e15c3a Merge "Allowlist build files in external/python/absl-py" 2022-12-15 20:23:35 +00:00
Paul Crowley
e7e9e09128 Merge "Fix go link given when stubby is absent." 2022-12-15 18:42:59 +00:00
Treehugger Robot
0bf1ff9fe1 Merge "Add Soong test to verify runtime_deps doesn't have afdo variant" 2022-12-15 18:12:56 +00:00
Miguel
32b0280098 Add conscrypt updatable certificates.
This cl adds a new PrebuiltEtcCaCertsFactory used by ca_certificates_apex in order to create the prebuilts used by the conscrypt apex.

Test: TrustedCertificateStoreTest
Change-Id: Iecac0e4b7ccdce77abb5140db944ea6f42c7d77f
2022-12-15 15:53:42 +00:00
Vinh Tran
9c6080cc4b Add Soong test to verify runtime_deps doesn't have afdo variant
Test: go test
Change-Id: If6ef4f5ee529b322a251b11ebdceca4bbcacdd63
2022-12-15 15:31:31 +00:00
Treehugger Robot
d42cb96940 Merge "Strip device name from gen_notice license files" 2022-12-15 15:21:34 +00:00
Sam Delmerico
847178fed1 bp2build disable malloc-rss-benchmark
Bug: 262707795
Change-Id: I5968c18a9d36f4bcee615f74ea62e208889c2df5
2022-12-15 09:44:17 -05:00
Vinh Tran
c935d777b7 Merge "Add ApexInfo.RequiresLibs to mixed build handler for apex" 2022-12-15 13:58:31 +00:00
Jingwen Chen
3952a9039e mixed builds: add cc_test bazel handler, and add adbd_test to staging allowlist.
This will allow the test_suites_{arm64, x86_64} CI targets on
git_master-bazel to build adbd_test with bazel in `m`.

This is currently implemented similar to the cc_binary handler to
hydrate the output path field.

The tradefed config is still currently handled by Soong in
testBinary#install, which is called from both ProcessBazelQueryResponse
and GenerateAndroidBuildActions. We'll move the tradefed config path to
a mixed builds handler when it's ready on the cc_test bazel rule side.

Tested with `atest` with cuttlefish. Since `atest` doesn't have a way to pass
--bazel-mode-staging to its internal call to Soong, so I manually tested
this by adding adbt_test to the prod allowlist, and confirmed that the
installed adbd_test is the same binary as the one in bazel-out.

Test: $ showcommands adbd_test | grep bazel-out | tail -n1

```
/bin/bash -c "rm -f
out/target/product/vsoc_x86_64/data/nativetest64/adbd_test/adbd_test &&
cp -f -d
out/bazel/output/execroot/__main__/bazel-out/android_x86_64_silvermont-opt-ST-59d4124ca041/bin/packages/modules/adb/adbd_test
out/target/product/vsoc_x86_64/data/nativetest64/adbd_test/adbd_test"
```

Test: Add adbd_test to prod allowlist and run 'lunch aosp_cf_x86_64_phone-userdebug; atest adbd_test', all tests pass.
Bug: 258426425
Bug: 261692372
Change-Id: I6be329f39d607af8daa1dc772b23e8dd0247418c
2022-12-15 08:01:44 +00:00
Cole Faust
328770db88 Merge "Remove tzdata from staging allowlist." 2022-12-15 00:15:55 +00:00
Vinh Tran
b6803a5f52 Add ApexInfo.RequiresLibs to mixed build handler for apex
Adding ApexInfo.RequiresLibs from Bazel to apexBundle.requiredDeps which is eventuallyread by apex androidmk writer for LOCAL_REQUIRED_MODULES to ensures the libs are installed as part of a bundle build.

In Soong, apexBundle.requiredDeps is set in
https://cs.android.com/android/platform/build/soong/+/master:apex/apex.go;l=2305-2323;drc=cb7e73bc0130a95f5991c925c349387185abc098

The same logic is replicated in Bazel at
https://cs.android.com/android/platform/build/bazel/+/master:rules/apex/cc.bzl;l=141-163;drc=cb7e73bc0130a95f5991c925c349387185abc098.

This CL is porting the required libs set by Bazel in mixed build.

Test: go test
Test: run build/bazel/ci/mixed_libc.sh
Bug: 215500321
Change-Id: Id7256d279ac09a8fd42db391a7e93ce0021d8345
2022-12-14 18:54:47 -05:00
Colin Cross
95f18bd6c5 Strip device name from gen_notice license files
The output libcore-library-notices gen_notice module is embedded in
core-module-lib-stubs, which is a transtiive dependency of effectively
every javac invocation targeting the device.  The output files listed
in the notice file can contain a path that includes the device name,
for example "target/product/generic_arm64/system/framework/core-libart.jar".
This causes the stubs contents to be different for every product,
which drastically reduces the cache hit rate of RBE.  Strip the
"out/target/product/generic_arm64" prefix from paths in the notice
file.

Bug: 262620891
Test: unzip -p out/soong/.intermediates/libcore/art.module.public.api.stubs.module_lib/android_common/turbine-combined/art.module.public.api.stubs.module_lib.jar NOTICES/libcore-NOTICES.txt
Change-Id: I705ed1252ef2a595dae53873993adefa1ea85662
2022-12-14 15:43:39 -08:00
Krzysztof Kosiński
af32e1ba3f Enable -Wno-xor-as-pow for external code.
Bug: 145211022
Test: presubmit
Change-Id: I025842df61cfd3657b21159fe4c05da857043a4c
2022-12-14 22:38:51 +00:00
MarkDacek
421a4d6d28 Remove tzdata from staging allowlist.
This is redundant as it's already in prod.
Test: m nothing

Change-Id: I49f75ce9ed514b77df8089a90a0339a4ab3f1d0b
2022-12-14 16:26:30 +00:00