Commit graph

5082 commits

Author SHA1 Message Date
Zi Wang
59929b0e9f Merge "Add variant_prepend test for cc_library" am: 60adbe233e am: b3af712c7a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2370191

Change-Id: I1aef57c78c1076dcc3a498ae4d1b872481be5e53
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-29 19:00:44 +00:00
Zi Wang
0f82844b75 Add variant_prepend test for cc_library
The comments in aosp/2336916 are also addressed here

Test: TH and TestCcLibraryVariantPrependPropOrder
Change-Id: If1472658fcd4b5544dec2e2691049a180520c84e
2022-12-28 11:18:11 -08:00
Yu Liu
67810eb926 Merge "We now support native code coverage in mixed build." am: acb884e2da am: 526ffcbeea
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2366500

Change-Id: Ie5c026cb3ebccd39c8fbc77270d8748c49974122
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-22 20:55:10 +00:00
Yu Liu
acb884e2da Merge "We now support native code coverage in mixed build." 2022-12-22 19:31:05 +00:00
Treehugger Robot
2a3432e15a Merge "Swap error before setting to prevent nil error" am: aebab397b3 am: f83163f77f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2366948

Change-Id: Ic2f10a7ed82c33705ec36681227a9592ebb8a670
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-22 09:20:48 +00:00
Treehugger Robot
aebab397b3 Merge "Swap error before setting to prevent nil error" 2022-12-22 08:12:06 +00:00
Yu Liu
482b0ecb80 We now support native code coverage in mixed build.
Bug: 233660582
Test: None
Change-Id: Ied34189293d754256a0f69a8473f77a5d27597ea
2022-12-21 14:31:43 -08:00
Colin Cross
e92a183394 Merge changes I47b8fdd9,Ifbd121ab am: 62e4fe15dc am: d89cb23df2
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2360867

Change-Id: I62e25fd1b329baad958ee761650f5e7161f490e7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-21 20:58:39 +00:00
Liz Kammer
44bc9a3bee Swap error before setting to prevent nil error
Test: go test soong tests
Change-Id: Ib6e3519f0f596b3699882fe682e648dd69ed5645
2022-12-21 15:02:20 -05: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
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
Jigar Thakkar
24878d5f2c Merge "Revert "Allow adding extra tradefed options in the Android.bp file"" am: 1d174b185f am: d53055390d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2364219

Change-Id: I2e1d04fe19d6d96c58b91abf4b637978cb0cb160
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-20 17:28:01 +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
Jingwen Chen
e44855d093 mixed builds: Make apex's GetBazelLabel return the label of the override_apex, if applicable. am: 889f2f2844 am: a9e0538107
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2363859

Change-Id: I1eef3e572af56557c2827260f0a64339bb07b8af
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-20 11:46:41 +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
317ebf2dcb Merge "mixed builds: add cc_test bazel handler, and add adbd_test to staging allowlist." am: 597894279d am: f5eaaae7f6
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2337087

Change-Id: Ic6209a74558401fc2e05c9ba6e8efe70aee2620f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-20 04:05:26 +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
Chris Parsons
6279a20744 Update allowlist to fix build am: 52b842a1fa am: 012e736bcb
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2364220

Change-Id: I711b9e935eb15bd7bdf5e8760bc847c839059ca5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-19 18:31:19 +00: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
Cole Faust
8aeade9c70 Merge "Allow exporting bazel mixed build allowlists to simple text files" am: abc182cc94 am: 770ee2e9a4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2356322

Change-Id: I9c2a1c2c7a7603ce1290129d5462550c66a885eb
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-19 04:23:56 +00:00
Cole Faust
abc182cc94 Merge "Allow exporting bazel mixed build allowlists to simple text files" 2022-12-19 03:09:11 +00:00
Treehugger Robot
9cc6a01ba1 Merge "Allow adding extra tradefed options in the Android.bp file" am: 2731ca8377 am: 38a70ef746
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2334246

Change-Id: I6322c026f82fafeb4b57b7d584f76b119ae22219
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-17 04:40:46 +00:00
Treehugger Robot
2731ca8377 Merge "Allow adding extra tradefed options in the Android.bp file" 2022-12-17 03:40:01 +00:00
Sasha Smundak
9c298ad440 Simplify soong_build top-level code am: 1845f42085 am: 554d061aea
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2352003

Change-Id: I998874a59631e452514df663e0e02d0c58c934ca
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-17 00:38:06 +00:00
Sasha Smundak
a01bac4a58 Keep all Soong command line arguments in a single structure am: af5ca926be am: 1cf3d473fb
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2347762

Change-Id: I1bbffe7e58d9c1cd9dc69aa4b1859f38a6e9bbba
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-17 00:36:58 +00: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
Sam Delmerico
9842311bd8 Merge "bp2build disable malloc-rss-benchmark" am: 484fb0907d am: 99a1fac6f4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2358899

Change-Id: I1f516981d810cfef167ff5f89e60fe0de61b9f0c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-15 23:17:56 +00:00
Sam Delmerico
484fb0907d Merge "bp2build disable malloc-rss-benchmark" 2022-12-15 22:04:15 +00:00
Treehugger Robot
315f837146 Merge "Allowlist build files in external/python/absl-py" am: a6d4e15c3a am: 20bcc8ce1b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2323093

Change-Id: Icc736e30f8ec2ef206e6e10949929afcbd5fa73a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-15 21:20:08 +00:00
Treehugger Robot
a6d4e15c3a Merge "Allowlist build files in external/python/absl-py" 2022-12-15 20:23:35 +00:00
Treehugger Robot
1fc92b97ab Merge "Strip device name from gen_notice license files" am: d42cb96940 am: 4c8fec1cbd
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2356723

Change-Id: I89965bbddbfac4ab3c96db0b825e637967318cc1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-15 16:11:31 +00:00
Treehugger Robot
d42cb96940 Merge "Strip device name from gen_notice license files" 2022-12-15 15:21:34 +00:00
Vinh Tran
09c9861dc0 Merge "Add ApexInfo.RequiresLibs to mixed build handler for apex" am: c935d777b7 am: f9a6519191
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2355806

Change-Id: I18110f10042cad06d41eb191d98343597bfe65ca
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-15 14:54:42 +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
b85f7b4952 Merge "Remove tzdata from staging allowlist." am: 328770db88 am: 3bcf655735
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2351442

Change-Id: I0c8cbbfee7be1964b44e118cd1639389215c8778
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-15 01:20:40 +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
Sam Delmerico
4df02d88c9 Merge "add APEX transitive dependency validation" am: 5a67ad19da am: 6146002e59
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2325607

Change-Id: I604dc474f1e9f24cff20560a41155804b6253ee6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-14 16:52:41 +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
Sam Delmerico
5a67ad19da Merge "add APEX transitive dependency validation" 2022-12-14 15:40:47 +00:00
Treehugger Robot
e8f7279940 Merge "Add arch variants for Intel Atom CPUs" am: 7853388422 am: 0c8d0c782c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2301565

Change-Id: I188dc6728fbaa9bef68d20334f9dad48a3c84f42
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-14 04:21:42 +00:00
Treehugger Robot
7853388422 Merge "Add arch variants for Intel Atom CPUs" 2022-12-14 03:32:13 +00:00
Treehugger Robot
a51d34e320 Merge "Workaround bazel command too long" am: b3b43822f9 am: d289dc2881
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2351082

Change-Id: I486cfee7e1c3b01b13b62154523d43d0c649af6b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-14 00:02:52 +00:00
Colin Cross
dab3e71066 Merge "Add external/musl to the bp2build allowlists" am: 7a9803cbde am: 560d8eef62
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2337364

Change-Id: I00f0d0ea1c6aefbed0f3cd15ff57d4e15047ccaf
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-13 20:51:57 +00:00