Commit graph

5447 commits

Author SHA1 Message Date
Alix Espino
d3ffe6475e Merge "refactor of api_levels map for soong injection" 2023-02-23 16:35:35 +00:00
Yu Liu
6f6abe34d1 Merge "Only apply apex transition to DCLA libs for now." am: 995a3a192f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2449906

Change-Id: Ib7f45430cce41a261afdbc035b48d077c0e23085
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-23 03:42:31 +00:00
Yu Liu
bfb2362cde Only apply apex transition to DCLA libs for now.
Bug: 270339610
Test: mixed_droid.sh
Change-Id: I6a8b7fdefeb504a25256e92647de9b487d5b65a3
2023-02-22 10:43:46 -08:00
Treehugger Robot
5a183c9e6a Merge "Allowlist frameworks/hardware/interfaces/stats/aidl" am: 14584beec6
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2447862

Change-Id: Icf2144aa2d84396e88fc965193fc22d83ca4c51e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-22 05:22:27 +00:00
Treehugger Robot
14584beec6 Merge "Allowlist frameworks/hardware/interfaces/stats/aidl" 2023-02-22 04:10:01 +00:00
Yu Liu
c07bb5799a Support DCLA am: e43124023c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2393572

Change-Id: Iae2d689e9c09838a82d78d44416e1629dcb03eb6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-22 01:35:44 +00:00
Vinh Tran
9b09bc5e3a Allowlist frameworks/hardware/interfaces/stats/aidl
This fixes current breakage on aosp-master-bazel on bp2build-incremental. aosp/2401793 addes android.frameworks.stats-V2-ndk to libtestvendoratoms but android.frameworks.stats aidl_interface is not allowlisted yet.

However, `//frameworks/proto_logging/stats/stats_log_api_gen:libtestvendoratoms` is still not building because of another issue in genrule + proto.

```
ERROR: out/soong/workspace/frameworks/proto_logging/stats/stats_log_api_gen/BUILD.bazel:87:8: Executing genrule //frameworks/proto_logging/stats/stats_log_api_gen:test_vendor_atoms.cpp failed: (Segmentation fault): bash failed: error executing command (from target //frameworks/proto_logging/stats/stats_log_api_gen:test_vendor_atoms.cpp) /bin/bash -c ... (remaining 1 argument skipped)i
```

The fix to this is similar to aosp/2401794 and is fixed in aosp/2449265

Test: presubmit
Bug: 270131691
Change-Id: I8bcc336d843ee4f0de44f377c828a9a4c959b0ec
2023-02-21 16:24:00 -05:00
Alix
c566ad8a4f refactor of api_levels map for soong injection
Change-Id: I58449fc84617e46727f23ab3d8dd5f118d2ee0d2
Bug: 249265719
Test: go test ./bp2build and locally ran bazel tests
2023-02-21 18:55:37 +00:00
Liz Kammer
e15c77caac Merge changes Iab00c839,I5962b27f am: d3c240fbd8
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2431539

Change-Id: I6198275c8b2245487df04a56398ee70c0e8fcd3d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-21 18:34:37 +00:00
Yu Liu
e43124023c Support DCLA
Bug: 240424572
Test: Manual tests:
1. m --dev-mode-staging com.android.adbd com.android.media.swcodec.
2. verify the DCLA libs from the two apexes have the same size and
   sha1sum, and also match the libs in bazel-out.
3. empty the DCLA libs list in allowlist.go and repeat step 1
4. repeat step 2 and verify the opposite result
5. build git_master: mainline_modules_bundles-userdebug in ABTD
   with the cl, then follow go/build-sideload-dcla-locally to
   download the adbd and swcodec aab files, run the DCLA trimming
   workflow locally, and verify the symlinks in the two trimmed
   apexes are identical and also match the lib path in the DCLA
   apex that was created by the workflow.

Change-Id: Ib2f8a29126a54829c0e10eba17b256a79930fd70
2023-02-21 10:12:47 -08:00
Liz Kammer
d3c240fbd8 Merge changes Iab00c839,I5962b27f
* changes:
  Handle aquery build statements in a goroutine
  Use aquery proto directly
2023-02-21 18:02:42 +00:00
Alix
79f853d7b9 temporary unblock for builds using sdkSystem
Bug: 215230098
Change-Id: I521342c676f3362d3e1db0aab7924a04602525e1
Test:  built captiveportal-lib and inspected BUILD file
2023-02-21 17:01:16 +00:00
Treehugger Robot
9bd0f928f1 Merge "Fix symlinks from APEX to partitions" am: 4196e13a6a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2442922

Change-Id: Iefadf2775084969290aef45b3f4377ec1a4d57b6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-21 04:35:26 +00:00
Jiyong Park
ce2436302a Fix symlinks from APEX to partitions
Previously, the symlink optimization for APEXes assumed that the target
of the symlinks are in the system partition. The assumption however
doesn't hold always because the file that was added to the APEX might be
with system_ext_specific: true or vendor: true.

Bug: 265598720
Test: m nothing
Change-Id: Ieb9a6769320c0ec697a88c0cae977e7d65288362
2023-02-17 18:22:25 +09:00
Treehugger Robot
46fa42c54c Merge "Add com.android.adbd and adbd_test to AOSP prod allowlist." am: ec8f7543f6
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2355102

Change-Id: Ic906782b30596a49d8ea53ae6f1be0c6fd0431bb
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-16 12:28:40 +00:00
Treehugger Robot
ec8f7543f6 Merge "Add com.android.adbd and adbd_test to AOSP prod allowlist." 2023-02-16 12:23:52 +00:00
Jingwen Chen
98bf5cca87 Add com.android.adbd and adbd_test to AOSP prod allowlist.
Test: presubmits
Bug: 260617515
Fixes: 260617515
Change-Id: Iadfd5ec2793d98d90c4be6a30ff706735327c299
2023-02-16 07:58:10 +00:00
Treehugger Robot
5e1919e9bb Merge "Add Always_use_prebuilt_sdks into variableProperties" am: 9fca81a6ec
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2428254

Change-Id: I938f4246bfe0afc1a52643fd24c27af70a883fdd
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-16 01:27:06 +00:00
Treehugger Robot
9fca81a6ec Merge "Add Always_use_prebuilt_sdks into variableProperties" 2023-02-16 01:03:42 +00:00
Romain Jobredeaux
c68105aff3 Merge "Allowlist metalava and dependencies." am: 47c71e840b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2438452

Change-Id: Iebb03b15e86b6574f9f284d6b68113d676e53c53
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-15 22:06:14 +00:00
Sorin Basca
be302733f6 Reland^2 "Target Java 17"
This reverts commit 91ba6c7e01.

Reason for revert: Relanding Java 17

Change-Id: I6d0e64bb86b9f4a0f41baa33c3226c6316718456
2023-02-15 17:52:27 +00:00
Romain Jobredeaux
477733404d Allowlist metalava and dependencies.
Change-Id: Ief72b982b11db20b82bb4678f0cf87550b9fd9e4
2023-02-15 11:32:39 -05:00
Liz Kammer
a4655a96c0 Handle aquery build statements in a goroutine
Creation of build statements is largely parallelizable because each
action is independent apart from updates/reads to
depsetHashToArtifactPathsCache. Locally resulted in build statements
taking ~.45 seconds on staging mode to ~.02 seconds

Test: CI
Change-Id: Iab00c8394a9eab17353f71230885ff0870e17f24
2023-02-15 11:29:49 -05:00
Zi Wang
2da9f46ee8 Merge "Add limited bp2build converter of java_sdk_library" am: c451830446
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2411046

Change-Id: Iaf07178e65d0f05e623f27ef3c4856636c2e8d48
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-15 03:30:45 +00:00
Zi Wang
c451830446 Merge "Add limited bp2build converter of java_sdk_library" 2023-02-15 02:32:48 +00:00
Treehugger Robot
bad86dde5d Merge "Fix typo" am: 7ec899ac67
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2434854

Change-Id: I7574aa6c884f523a9a2e773b0e1f21cbfcfedf52
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-15 00:40:52 +00:00
Treehugger Robot
7ec899ac67 Merge "Fix typo" 2023-02-14 23:51:13 +00:00
Julien Desprez
212860594e Merge "Revert "Reland "Target Java 17""" am: 4d3f11ccb3
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2435953

Change-Id: I1818b3b7c16414f24f5e094ba3402b16a5c220d7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-14 23:42:45 +00:00
Julien Desprez
4d3f11ccb3 Merge "Revert "Reland "Target Java 17""" 2023-02-14 22:21:26 +00:00
Zi Wang
b2179e397a Add limited bp2build converter of java_sdk_library
Only public, system, test, module_lib and system_server are
converted in order to generate api_fingerprint.txt in Bazel.

Test: java_sdk_library_conversion_test.go and TH

Bug: 266973526
Change-Id: I67a00806165e5afad3876b6cd5cdbc6b0dd65d8b
2023-02-14 13:21:21 -08:00
Julien Desprez
91ba6c7e01 Revert "Reland "Target Java 17""
This reverts commit 1fbf7f21a4.

Reason for revert: broke docker image, pinning is incomplete it seems

Change-Id: I7102cb233a4fe5ce0f5a1ead98cfc661c3d82ce5
2023-02-14 20:26:31 +00:00
Treehugger Robot
43002dd9e9 Merge "Collect more metrics for aquery handling" am: 80936bd15f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2431534

Change-Id: I583e1913f14cb9ad9ad5ce6b7180d55d581ee7e7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-14 19:51:29 +00:00
Romain Jobredeaux
f5f849d917 Merge "Allowlist MusicKotlin, jsr305. No manual BUILD for jsr305 and QuickSearchBox." am: 9d16531909
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2420222

Change-Id: Ic9cba3d2ddfd62ef5a0b620cde803f0e84a76e30
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-14 19:49:59 +00:00
Treehugger Robot
80936bd15f Merge "Collect more metrics for aquery handling" 2023-02-14 19:25:53 +00:00
Romain Jobredeaux
9d16531909 Merge "Allowlist MusicKotlin, jsr305. No manual BUILD for jsr305 and QuickSearchBox." 2023-02-14 19:07:30 +00:00
Liz Kammer
690fbac200 Collect more metrics for aquery handling
Test: go test soong tests
Test: m nothing & verify metrics
Change-Id: Id19e004d90dfbaa1b1706c607d5250bf845c0f3b
2023-02-14 11:10:19 -05:00
Jiyong Park
9785915c2d Fix typo
Bug: N/A
Test: m nothing
Change-Id: Ia8b8ba7582ac93643d485cf3340066efdbddcae5
2023-02-14 17:07:41 +09:00
Treehugger Robot
e4795460ce Merge "Revert "Dynamically assemble the list of python launcher shared libs for precompiling"" am: 811f5c9471
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2434093

Change-Id: Ifa0b594ab500b6b0e6a3e601ad542205d0f8ffc0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-14 07:33:33 +00:00
Treehugger Robot
811f5c9471 Merge "Revert "Dynamically assemble the list of python launcher shared libs for precompiling"" 2023-02-14 07:05:50 +00:00
Cole Faust
cbeb24ce35 Merge "Add ConvertApexAvailableToTags" am: 1d09ec6fca
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2431432

Change-Id: I3a062563717841fe323696bbd31c66a125e63a21
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-14 00:58:24 +00:00
Cole Faust
1d09ec6fca Merge "Add ConvertApexAvailableToTags" 2023-02-14 00:26:52 +00:00
Cole Faust
909d237c84 Revert "Dynamically assemble the list of python launcher shared libs for precompiling"
This reverts commit aa5b377ee9.

Reason for revert: this broke musl builds by removing the install dependency from python binaries to the launcher shared libraries: https://android-build.googleplex.com/builds/submitted/9600042/unit_tests_x86_64_musl/latest/view/logs/build_error.log

Change-Id: I4e13f333f287831ba13724f13ab2be789a92b476
2023-02-13 23:17:40 +00:00
Sam Delmerico
310b6023f5 Merge "pass TIDY_EXTERNAL_VENDOR envvar to Bazel" am: e56fd9467d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2431538

Change-Id: I74df3c289572e41a72be4717fedb889f6748d696
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-13 19:37:52 +00:00
Cole Faust
bcd201e86c Merge "Dynamically assemble the list of python launcher shared libs for precompiling" am: 8b0c15b083
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2419263

Change-Id: I9b093629fc66f094aa6fbe5b01ca44aeffc4d1bb
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-13 19:36:54 +00:00
Sam Delmerico
e56fd9467d Merge "pass TIDY_EXTERNAL_VENDOR envvar to Bazel" 2023-02-13 19:02:29 +00:00
Cole Faust
8b0c15b083 Merge "Dynamically assemble the list of python launcher shared libs for precompiling" 2023-02-13 18:25:08 +00:00
Cole Faust
fb11c1ce81 Add ConvertApexAvailableToTags
This is a more flexible version of ApexAvailableTags
that can be used for the aidl modules.

Bug: 260694842
Test: go test
Change-Id: Iddb15e737c19e95977f74e8c627d6044d8875746
2023-02-13 10:23:36 -08:00
Treehugger Robot
2e25039c2f Merge "Write product config files only if changed." am: 8916b21320
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2421759

Change-Id: Id4aec4a75093fccac6045988d04592cfc0fd8fc1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-11 04:45:03 +00:00
Treehugger Robot
8916b21320 Merge "Write product config files only if changed." 2023-02-11 03:59:01 +00:00
Chris Parsons
7f3bf453cb Avoid rewriting soong_build outputs if unchanged am: 1a12d03230
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2424625

Change-Id: I1d6ff45df2954dbae88d05fb846227ce9e3708a4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-11 01:04:31 +00:00
Sam Delmerico
700b4d3e1a pass TIDY_EXTERNAL_VENDOR envvar to Bazel
Bug: 268668248
Test: verify that Bazel tidy actions don't have a large diff from Soong tidy actions:
  (add -v to Ninja invocation in ui/build/ninja.go [and disable fifo file])
  WITH_TIDY=1 DISABLE_ARTIFACT_PATH_REQUIREMENTS=true m com.android.adbd 2>&1 | tee soong_build-tidy.adbd &&
  WITH_TIDY=1 DISABLE_ARTIFACT_PATH_REQUIREMENTS=true m com.android.adbd --bazel-mode-staging 2>&1 | tee mixed_build-tidy.adbd &&
  grep -Po "prebuilts/clang/host/linux-x86/clang-r475365b/bin/clang-tidy.sh \K\S+" soong_build-tidy.adbd | sort -u > soong-clang-tidy.adbd &&
  grep -Po "prebuilts/clang/host/linux-x86/clang-r475365b/bin/clang-tidy.sh \K\S+" mixed_build-tidy.adbd | sort -u > mixed-clang-tidy.adbd &&
  vimdiff soong_build-tidy.adbd mixed_build-tidy.adbd
Change-Id: I22804d6d92ed56d9727eaf430318df0b041712a8
2023-02-10 16:46:33 -05:00
Chris Parsons
0008cf8b24 Write product config files only if changed.
Test: Manually verified artifact timestamps are unchanged on a second
invocation of `m nothing` (with bp changes)
Test: Presubmits

Change-Id: I6bdf106a464597a07ac290cb575425d700721ffe
2023-02-10 16:03:26 -05:00
Chris Parsons
1a12d03230 Avoid rewriting soong_build outputs if unchanged
This changes bp2build codegen, symlink forest generation, and
soong_build so that they do not rewrite output files if the contents are
unchanged.

Bug: 266983462
Test: m droid
Test: canonical_perf.sh benchmarking
Test: Manually verified that rerunning analysis did not regenerate
out/soong/workspace/prebuilts/sdk/BUILD.bazel unless contents changed

Change-Id: I5ec227df7a32b53c7fa0d741fb1403a51931024b
2023-02-10 15:34:06 -05:00
Kevin Dagostino
f5e54f0959 Merge "Removing libutils_test which depends on libunwindstack." am: 7d4e3be8e6
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2424626

Change-Id: I9c837e93283a1b78d90c8ac5bc7f7356112da127
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-09 20:56:29 +00:00
Kevin Dagostino
7d4e3be8e6 Merge "Removing libutils_test which depends on libunwindstack." 2023-02-09 20:20:50 +00:00
Sorin Basca
542f261172 Merge "Reland "Target Java 17"" am: f96b899f59
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2421499

Change-Id: Ib6d8322941f66d102ad599950bcdbe8f1c020b6a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-09 14:43:09 +00:00
Sorin Basca
f96b899f59 Merge "Reland "Target Java 17"" 2023-02-09 14:12:14 +00:00
Jeongik Cha
f08e59c0d7 Add Always_use_prebuilt_sdks into variableProperties
Unbundled build needs switch mechanism between prebuilt and source.
So add Always_use_prebuilt_sdks because Unbundled_build doesn't gurantee
prebuilts is used.

Bug: 264498267
Bug: 246897249
Test: build
Change-Id: I069d4d9e804b4cf96ae70855c7eee3a6c940c9dc
2023-02-09 10:47:59 +09:00
Treehugger Robot
c29c3ad951 Merge "Remove unnecessary pass in validatePath." am: 60b3fed203
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2424707

Change-Id: I83c80f6198da3664ccca873f1cd483aa5d14e2f3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-08 21:09:51 +00:00
Sam Delmerico
8e305ef1af Merge "mixed build targets need transitive tidy files" am: e413f4046f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2421470

Change-Id: Id21d4d2c8e2eddb5e80effd2c5256c4e9eb94ad4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-08 21:07:32 +00:00
Treehugger Robot
60b3fed203 Merge "Remove unnecessary pass in validatePath." 2023-02-08 20:29:35 +00:00
Sam Delmerico
e413f4046f Merge "mixed build targets need transitive tidy files" 2023-02-08 20:11:30 +00:00
Treehugger Robot
d759f80358 Merge "Call hook in java_sdk_library after droidstubs generation" am: 667200e25b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2411284

Change-Id: I883b5c4b13c233f22b6b79477ea3a6420eb2cddd
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-07 22:24:08 +00:00
Treehugger Robot
667200e25b Merge "Call hook in java_sdk_library after droidstubs generation" 2023-02-07 21:59:20 +00:00
Sam Delmerico
4ed95e263f mixed build targets need transitive tidy files
Previously in mixed builds, only the tidy files for the boundary module
were built, whereas all of its transitive dependencies' tidy files were
not being built. Instead we should export the list of transitive tidy
files for a module so that we can run clang-tidy for the boundary module
as well as its dependencies.

Bug: 195029134
Test: WITH_TIDY=1 DISABLE_ARTIFACT_PATH_REQUIREMENTS=true mss tidy-packages-modules-NeuralNetworks --bazel-mode-dev
Change-Id: I463646d2ae1fc4aa075a54c264e1c34571c3fd5c
2023-02-07 16:50:30 -05:00
Sam Delmerico
3e83b52aba Merge "export allowlist of environment variables to Bazel" am: db23e22835
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2421469

Change-Id: I737c772c39100936506eafe59c86652e2169658b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-07 20:07:36 +00:00
Sam Delmerico
db23e22835 Merge "export allowlist of environment variables to Bazel" 2023-02-07 19:25:39 +00:00
Jihoon Kang
d48abd566b Call hook in java_sdk_library after droidstubs generation
Currently, droidstubs module create java_api_contribution module, but
when a java_sdk_library module dynamically creates a droidstubs module,
java_api_contribution is not created as the hook inside droidstubs get
lost. Therefore, call hook inside sdk_library after creating the
droidstubs module.

Test: m
Change-Id: I68bf1d796f6f9a6f81011ae35e4991b6ed1421ea
2023-02-07 18:45:38 +00:00
Jingwen Chen
24d0c56350 Remove unnecessary pass in validatePath.
Perform a single pass over pathComponents in both validatePath and
validateSafePath instead.

Test: presubmits
Change-Id: I1499183e345ca180900c54a18f9dc8bd534f2588
2023-02-07 09:29:36 +00:00
Kevin Dagostino
2c3be41226 Removing libutils_test which depends on libunwindstack.
Test: b test //system/...
Change-Id: Iceeaa5302931bb45aae4077677ceeee2f86d27a0
2023-02-07 04:11:29 +00:00
Christopher Parsons
85cae04fb2 Merge "Only write soong_injection files if changed" am: a9242e32d5
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2420380

Change-Id: Ie782225c3f885f4ce079c39de1542e78dbc2568b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-06 23:07:21 +00:00
Christopher Parsons
a9242e32d5 Merge "Only write soong_injection files if changed" 2023-02-06 22:23:54 +00:00
Sam Delmerico
cb3c52c766 export allowlist of environment variables to Bazel
Previously, Bazel was invoked during mixed builds with a stripped down
environment. This CL adds an allowlist of environment variables that are
passed to Bazel.

Test: WITH_TIDY=1 DISABLE_ARTIFACT_PATH_REQUIREMENTS=true mss tidy-packages-modules-NeuralNetworks --bazel-mode-dev
Change-Id: I23147bec59f6522953cf623e7bcaa0f1f99a75a3
2023-02-06 14:34:43 -05:00
Chris Parsons
3a8d0fbede Only write soong_injection files if changed
This also fixes determinism of these files (by ensuring that bazel
requests and their configurations are sorted, as these are used in the
soong_injection file output)

Bug: 266983462
Test: Manually verified soong_injection files are the same among
multiple runs
Test: Unit test
Test: m nothing

Change-Id: I1568930549cff0bc5676825434cc448d16ebdd4e
2023-02-03 18:29:02 -05:00
Sorin Basca
1fbf7f21a4 Reland "Target Java 17"
This reverts commit 384250c7c4.

Reason for revert: Relanding the feature.

Bug: 233029164
Change-Id: Ib66deabbf6e9604798c70edaf581f46db848e6ca
2023-02-03 18:20:03 +00:00
Romain Jobredeaux
0bffcb8ad2 Allowlist MusicKotlin, jsr305. No manual BUILD for jsr305 and QuickSearchBox.
Allowlisting MusicKotlin gives us CI coverage on android apps with kotlin code.
jsr305's auto-generated BUILD file is working for us for now.
QuickSearchBox has been migrated to Kotlin and now has an unsupported dependency.

Change-Id: I9d9e6abf49875b0f5981fbcefdbd70a1bff62a83
2023-02-03 10:21:44 -05:00
Cole Faust
aa5b377ee9 Dynamically assemble the list of python launcher shared libs for precompiling
Still fall back to the hardcoded list for what to put in LOCAL_SHARED_LIBRARIES,
because I couldn't figure out a good way to get those modules at the moment.

Bug: 259718110
Test: Presubmits
Change-Id: Ia992ffea8819d8c67280b08bc45505f77af09de0
2023-02-02 13:47:56 -08:00
Kelvin Zhang
991caa3576 Merge "Revert "Target Java 17"" am: d60722c204
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2419659

Change-Id: Ibdffdd1d3b1198884113e5800d311fbc52dd330b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-02 21:36:59 +00:00
Dennis Shen
0c9fc6fb7d Merge "Add soong unit test for trimmed apex build" am: a928c8dae1
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2412712

Change-Id: I2a849c536e409fda1573b7086febfa99c0a11348
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-02 21:35:52 +00:00
Sam Delmerico
9f257daf53 Merge "clean up CL for androidmk variables" am: 1978fdf9b2
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2406216

Change-Id: Icf5772f6fd93f1430e8a5902283849646f93ebfa
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-02 21:31:58 +00:00
Sorin Basca
024f16c2f8 Merge "Target Java 17" am: ac9938dddc
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2243015

Change-Id: I330481f3f67039db34bcf82ea716b80c6f29a256
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-02 21:09:54 +00:00
Yu Liu
2d2c3c4564 Merge "Denylist libunwindstack for now until later." am: 249998d290
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2400013

Change-Id: I19d8fa30e313ed657f1be701ccec555fc17fe7b0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-02 20:52:39 +00:00
Kelvin Zhang
d60722c204 Merge "Revert "Target Java 17"" 2023-02-02 18:51:26 +00:00
Sorin Basca
384250c7c4 Revert "Target Java 17"
This reverts commit d6be9e51ca.

Reason for revert: b/267608166.

Change-Id: Ie07caa5ace3bcb290829e6fa476c5e1d47b975ba
Fixed: 267608166
2023-02-02 17:56:19 +00:00
Dennis Shen
a928c8dae1 Merge "Add soong unit test for trimmed apex build" 2023-02-02 14:39:53 +00:00
Sam Delmerico
1978fdf9b2 Merge "clean up CL for androidmk variables" 2023-02-02 14:11:12 +00:00
Sorin Basca
ac9938dddc Merge "Target Java 17" 2023-02-02 11:38:32 +00:00
Yu Liu
249998d290 Merge "Denylist libunwindstack for now until later." 2023-02-02 07:07:40 +00:00
Yu Liu
828c4065e1 Denylist libunwindstack for now until later.
Bug: 266446882
Test: b and m build tzdata and adbd
Change-Id: Idb931c37b082743251aae0e633fd7e51ca651a9b
2023-02-01 20:40:42 +00:00
Dennis Shen
d4f5d932a1 Add soong unit test for trimmed apex build
BUG: b/259381334
TEST: m nothing
Change-Id: I49e5d31a6f5c4f9a72a6a4b3b2ab7114b996adbc
2023-02-01 20:23:46 +00:00
Treehugger Robot
1921fb2454 Merge "Rename API surface provided to mainline modules" am: 9bedfd0d4b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2400022

Change-Id: Iadf6eba8f3e90c075c1d67bb14e8b4741dc6a995
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-01-30 23:44:58 +00:00
Treehugger Robot
9bedfd0d4b Merge "Rename API surface provided to mainline modules" 2023-01-30 23:06:22 +00:00
Usta (Tsering) Shrestha
9e130a27da Merge "prune out empty bazel depsets" am: e136efdcfa
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2404275

Change-Id: If6f62a507931557dd72c8d263d4a574fb5cfc533
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-01-30 21:41:47 +00:00
Usta (Tsering) Shrestha
6a144eddcb Merge "soong_build cmline args validation" am: 28b5ac6db5
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2366952

Change-Id: I569526044d3787f1235be41e30e90699e8b18140
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-01-30 21:40:22 +00:00
Usta (Tsering) Shrestha
e136efdcfa Merge "prune out empty bazel depsets" 2023-01-30 21:04:08 +00:00
Usta (Tsering) Shrestha
28b5ac6db5 Merge "soong_build cmline args validation" 2023-01-30 20:50:44 +00:00
Usta Shrestha
13fd5aead7 prune out empty bazel depsets
Instead of using a sentinel file that was created under bazel_workspace
prune them out. The sentinel file was being created under bazel_workspace,
which would be deleted and thus rendered useless from the perspective of
not retriggering a build.

Test: `touch Android.bp` then `NINJA_ARGS="-d explain" m --bazel-mode-staging adbd_test`
Bug: 265155778
Change-Id: If5d8f0ea7f3b8828fda0646faafd1a621f0cb27c
2023-01-30 11:37:04 -05:00
Sam Delmerico
7832824f43 Merge "add androidmk cc-related variables to androidmk" am: 78aca80710
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2393585

Change-Id: Ideba553c98c11c09d4c7074a5ae236f8f71c788c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-01-27 21:39:15 +00:00
Sam Delmerico
78aca80710 Merge "add androidmk cc-related variables to androidmk" 2023-01-27 21:04:29 +00:00
Sam Delmerico
5fb794ae37 clean up CL for androidmk variables
Change-Id: If14d1925bea78f467740f8395f1d529db00b618c
2023-01-27 16:01:37 -05:00
Treehugger Robot
d6e0551c23 Merge "Read ApexMkInfo for modules to be installed." am: 6e7441edde
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2402832

Change-Id: I5d7e9a9e4287a9f1d8e0536f74680b66abae2917
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-01-27 20:23:43 +00:00
Dennis Shen
8a28b319c1 Merge "Support trimmed variant build in soong" am: 0c79be54b6
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2384492

Change-Id: Id290d10c8814fa511eb30b486563ff6db4d3cca9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-01-27 20:22:10 +00:00
Treehugger Robot
6e7441edde Merge "Read ApexMkInfo for modules to be installed." 2023-01-27 15:45:08 +00:00
Dennis Shen
0c79be54b6 Merge "Support trimmed variant build in soong" 2023-01-27 13:11:50 +00:00
Jingwen Chen
29743c8423 Read ApexMkInfo for modules to be installed.
This piggybacks onto the ApexInfo cquery handler, so we're issuing a
single bazel query call that reads two providers in the starlark expr.

Also rename requiredDeps to makeModulesToInstall to differentiate it from
APEX's required/provided libs in the apex manifest.

Test: unit test
Test: mkdiff
Fixes: 263123189
Change-Id: Ib7e43f1586f29864eee8627dba3631bfaff27afa
2023-01-27 04:02:45 +00:00
Spandan Das
627fc3e436 Rename API surface provided to mainline modules
This API surface is provided by platform and mainline modules to other
mainline modules. Rename it to module-lib API surface to align it with
the terminology in go/android-api-types

Test: go test ./bp2build
Test: go test ./cc
Change-Id: Ieb9f3214e66366fc2ceb6f47e2d6623acb537827
2023-01-26 23:02:53 +00:00
Usta Shrestha
cae3bfa702 soong_build cmline args validation
Bug: NA
Test: +ve: `m bp2build`, `m libc` etc. -ve: `m --bazel-mode-dev --bazel-mode-staging libc`, `m bp2build libc` etc
Change-Id: Idc6f3cc7b96c49a5a5e00f203c8d00a4777880c9
2023-01-26 18:22:18 +00:00
Dennis Shen
e2ed70c61a Support trimmed variant build in soong
variable.go:
add a new product variable TrimmedApex which is controlled by
environment variable PRODUCT_TRIMMED_APEX

config.go:
all config to check if trimmed build is turned on or not

apex.go:
add overridable apex module property:
use_DCLA: <DCLA apex module>

"use_DCLA" allows user to just use the lib list in DCLA to determine
which native shared libraries to trim. This property is no-op if
TrimApexEnabled is set to false.

builder.go
1, if it is to produce a trimmed variant, fix the default version code
by making the last variant digit to 2. this is only useful in local
build. in production build, there is apex manifest injection by
coastguard that determines the actual version code.

2, create a new apex rule called: "TrimmedApexRule", this rule invokes
an apexer wrapper called apexer_with_trim_preprocessing which will
properly trim the target libs.

BUG: b/259381334
TEST: adbd banchan build for both static and trimmed variant
Change-Id: I38a91cdef86a3c9185d00610ab3dd7acd07fd90a
2023-01-26 15:57:21 +00:00
Sam Delmerico
4e115cc90d add androidmk cc-related variables to androidmk
The adbd_test androidmk definition is missing some cc-related variables
for cc_test in mixed builds. These variables should be populated from
information from Bazel.

Bug: 265758350
Change-Id: I59d017e2eb2f139188ba3383c457cc0055372b61
2023-01-25 15:14:03 -05:00
Sam Delmerico
9a84ff206d Merge "add error handling to cquery in MockBazelContext" am: 9202bb01de
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2400093

Change-Id: Ia3a57a6a55728fff0d076d6028380549cb2718b8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-01-25 18:17:05 +00:00
Sam Delmerico
9202bb01de Merge "add error handling to cquery in MockBazelContext" 2023-01-25 17:08:12 +00:00
Treehugger Robot
8ec5a6bd66 Merge "bp2build support .kt in android_library" am: 7c30b6bad7
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2395474

Change-Id: I748160d43eeb6777bc020d3f94b092ca1370611c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-01-25 16:28:05 +00:00
Treehugger Robot
7c30b6bad7 Merge "bp2build support .kt in android_library" 2023-01-25 15:47:49 +00:00
Treehugger Robot
bc7d701416 Merge "Add additional adbd related tests to mixed staging" am: 8153bc40bb
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2401284

Change-Id: I87dd748399f00a724c67a6e083ba6589152b73b2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-01-25 14:00:52 +00:00
Liz Kammer
9c667416de Add additional adbd related tests to mixed staging
Test: CI
Change-Id: I724e854dbbc67a1a37109e19935b28627066acc8
2023-01-24 10:47:18 -05:00
Sam Delmerico
ce39f83538 add error handling to cquery in MockBazelContext
Change-Id: Ia01072b6528caff2f3ceaca67cdba8b900924fe5
2023-01-24 10:39:07 -05:00
Alix
36795a74dc bp2build support .kt in android_library
Bug: 258690851
Test: bp2build tests and built target renderscript_toolkit
Change-Id: I43ddf5637c97e4849b63abd2423f29519d44c28f
2023-01-24 14:53:44 +00:00
Xin Li
aa7f6f103e Merge "Merge tm-qpr-dev-plus-aosp-without-vendor@9467136" into stage-aosp-master 2023-01-13 07:32:55 +00:00
Treehugger Robot
a458ac0ede Merge "Optimize isAncestor" 2023-01-12 22:14:46 +00:00
Treehugger Robot
26248cf580 Merge changes I48426a8e,Ic991e3ae,I9768241f
* changes:
  bp2build apex min_sdk_version w/ soong config var
  Handle soong config vars for string attrs
  bp2build correctly handle empty soong_config_var
2023-01-12 19:11:27 +00:00
Cole Faust
3ac7db80f1 Optimize isAncestor
Remove string copies.

Test: go test (there are existing visibility tests)
Change-Id: I575dcd8497527da03f88003ff0805f3d1271983e
2023-01-12 11:00:40 -08:00
Alix Espino
ed2491cf20 Merge "java_binary with kotlin sources" 2023-01-12 14:40:46 +00:00
Xin Li
2391a2c527 Merge tm-qpr-dev-plus-aosp-without-vendor@9467136
Bug: 264720040
Merged-In: I70802042e5665baa471a3e9e0bc27efaf7a97944
Change-Id: If7ed30b5104e479d61245a768507715c249ec583
2023-01-11 22:46:06 -08:00
Liz Kammer
f3963f8b9c bp2build correctly handle empty soong_config_var
Previously in cases where a variable value was set but empty in a bp
file we ignored the value in bp2build; however, the correct behavior is
to take the empty value for each case. The tests for soong config vars
with empty_prop_for_string_var and unused_string_var:
https://cs.android.com/android/platform/superproject/+/master:build/soong/android/soong_config_modules_test.go;l=243-283;drc=72beb34609217f3c98623fb6795b6417c7f0fc65
highlight the difference in when conditions default should be used or
not.

Test: go test bp2build tests
Change-Id: I9768241f013a1a1bc8fa23657a066b5b3f52f09b
2023-01-11 22:01:01 -08:00
Sasha Smundak
39a301c963 Clean up mixed builds module names filtering
* Remove `Bp2buildCcLibraryStaticOnlyList` it is never set
* Remove the rest of the sutff related to it
* Streamline MixedBuildsEnabled
* Rename BazelContext.BazelAllowlisted to BazelContext.NameFilter
  to reflect its action
* Rename bazelContext to mixedBuildBazelContext
* Fix minor warnings from Go static analyzer

Test: treehugger
Change-Id: Ie245c992f94bbfd5c7c23dd06917026200a28263
2023-01-12 00:32:45 +00:00
Jason Wu
c69b26311b Merge "Delete the noisy error message" 2023-01-11 21:21:32 +00:00
Sorin Basca
d6be9e51ca Target Java 17
Bug: 233029164
Test: TH
Change-Id: I750b866565c264eb4f4ac14ebc88be6fc9b1b458
2023-01-11 12:47:10 +00:00
Spandan Das
3dfb939243 Merge "Create a "Toolchain" API surface" 2023-01-11 01:08:25 +00:00
Treehugger Robot
0f2d054e4f Merge "Optimize PathForBazelOutRelative" 2023-01-10 22:58:07 +00:00
Jason Wu
ff1bb31670 Delete the noisy error message
Test: m nothing, m --bazel-mode-dev nothing
Bug: 263127170
Change-Id: I876311f0746f5291076827e0bba71bb0b6a72646
2023-01-10 17:36:41 -05:00
Cole Faust
0abd4b4f5d Optimize PathForBazelOutRelative
This isn't benchmarked or anything, but should give
minor performance improvements.

Test: Verified ninja files didn't change on aosp_arm64-userdebug
Change-Id: I030991f91c326669b7b7e73b8171da4b2a68cbb4
2023-01-10 11:38:40 -08:00
Paul Duffin
d6dd6a3c56 Merge changes I55dc71d2,I250ee4e1
* changes:
  Avoid separate call to module factory to create conditional properties
  Test using soong_config_module_type with singleton module type
2023-01-10 10:42:06 +00:00
Paul Duffin
0c79abc971 Merge "Dedup registration of Soong config module types" 2023-01-10 10:33:22 +00:00
Cole Faust
483d1f7a6b Remove SourcePath.srcDir
This was always set to "." after aosp/1652613 and
aosp/1796650. While doing some rudimentary performance
profiling of soong, it turned out that SourcePath.String()
was taking 600+MB of memory joining the "." to the rest
of the path. Remove it for performance gains.

Bug: 262629589
Test: Verfied ninja files didn't change with this cl on aosp_arm64-userdebug
Change-Id: Id6b552ab8defe37e0c2b58e813fb1dbae427ae96
2023-01-09 14:35:27 -08:00
Alix
7c8eaebc4f java_binary with kotlin sources
Test:  bp2build conversion tests and inspected build file for AnalyzerKt
Change-Id: I0f6d5c3d371a9dbd000b74144ad68d5d8bd156cf
2023-01-09 20:09:37 +00:00
Paul Duffin
e8b4768134 Avoid separate call to module factory to create conditional properties
Previously, the soong_config_module_type (and related module types)
would make a special call to the module factory of the module type
being customized to get the properties from which it created the
conditional properties. That caused problems when trying to customize
a singleton module. See the bug for more details.

This change avoids that special call by deferring the creation of the
conditional properties struct until just after the
soong_config_module_type's factory function calls the customized module
factory to create the module and properties. The properties are then
used to create the conditional properties struct avoiding the extra
factory call.

The conditional properties struct is only created once per module type
that soong_config_module_type (and related module types) creates.

Bug: 264876909
Test: m nothing
Change-Id: I55dc71d2553cb59d921a96c6458d0bc877512bbb
2023-01-09 16:49:00 +00:00
Paul Duffin
f1e6a048d0 Test using soong_config_module_type with singleton module type
Singleton module types have some special behavior that can cause
problems when trying to extend them with soong_config_module_type so
this adds some tests of how they work together.

Currently, the tests show that they do not work together, a follow up
change will correct that.

Bug: 264876909
Test: m nothing
Change-Id: I250ee4e18b3c04d1c91808f55722da74b813a570
2023-01-09 16:48:56 +00:00
Paul Duffin
3229998d37 Dedup registration of Soong config module types
Bug: 264876909
Test: m nothing
Change-Id: I467a2090b32438cbbf88bbb453bb4960757ec37a
2023-01-09 16:48:46 +00:00
Treehugger Robot
aceb04fb1b Merge "Remove memberDepsMutator, SdkAware et al" am: 351ca9aa81 am: 8f2dfe4dea
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2314941

Change-Id: I6cc1c7e6d784fc1f58f49cf9d8faed384c913c3c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-01-07 15:41:54 +00:00
Treehugger Robot
0bba2d1ef1 Merge changes I07db8afc,Ia89e0239 am: 4520481c6a am: 8054072814
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2318638

Change-Id: Ia6b00e270390237cbb2491655aef19d0e7711d23
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-01-07 15:41:44 +00:00
Treehugger Robot
f10e829b94 Merge "Remove SdkAware.SdkMemberComponentName" am: 3c867b6ce8 am: 711b970c56
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2318637

Change-Id: I05fd6c8faa662b24b50c5bd059639c5873eb0fc6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-01-07 15:41:33 +00:00
Treehugger Robot
351ca9aa81 Merge "Remove memberDepsMutator, SdkAware et al" 2023-01-07 14:51:43 +00:00
Treehugger Robot
4520481c6a Merge changes I07db8afc,Ia89e0239
* changes:
  Stop module types being SdkAware
  Replace usages of SdkAware in sdk module with Module
2023-01-07 14:46:22 +00:00
Treehugger Robot
3c867b6ce8 Merge "Remove SdkAware.SdkMemberComponentName" 2023-01-07 14:36:24 +00:00
Cole Faust
392ba475f0 Merge "Bp2build support for multiple product configs" am: 501a7976be am: 25ba48a5ca
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2316418

Change-Id: I11ba1c9246a4bf79097f6dd0c30611a306c407b6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-01-07 04:12:48 +00:00
Cole Faust
501a7976be Merge "Bp2build support for multiple product configs" 2023-01-07 03:09:08 +00:00
Paul Duffin
fe6cc5b133 Merge "Remove IsModuleInVersionedSdk" am: e76fa00998 am: 377dae0a30
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2318636

Change-Id: I01f2bdb3b24e2ed7ed6378c2fc06fd8a809b1f15
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-01-06 23:45:36 +00:00
Paul Duffin
e76fa00998 Merge "Remove IsModuleInVersionedSdk" 2023-01-06 22:37:59 +00:00
Sam Delmerico
290d17f7fd bp2build converts android.hardware.audio AIDL am: a2cccc3926 am: a7282fb5b9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2376316

Change-Id: Ib9c538d66bfb3f6e1d36048b30b9476c7c6c705b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-01-06 02:54:07 +00:00
Sam Delmerico
a2cccc3926 bp2build converts android.hardware.audio AIDL
Test: build --config=android //hardware/interfaces/audio/aidl:android.hardware.audio.effect-V1-ndk_aidl_code_gen
Change-Id: I55764604fbed4e40dd85b1e2fd1491fa043c92f8
2023-01-05 16:55:28 -05:00
Cole Faust
b85d1a15cc Bp2build support for multiple product configs
Create a
build/bazel/product_config/generated/products/<product_name>/BUILD
file that contains the platform definitions needed for
a particular product. Currently we just create it for the
current lunch target, but the idea is that eventually when
all product config is in starlark, all the products will
have their platform definitions in the tree at once.

Bug: 249685973
Test: Presubmits
Change-Id: I08c82ff28dcf62f09d3b1d2e3186a6b961e12f6e
2023-01-05 12:49:14 -08:00
Paul Duffin
74fec4396f Merge "Stop changes to BAZEL_METRICS_DIR regenerating ninja file" am: 58f7784e95 am: 27139a1412
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2366149

Change-Id: Ib55774e848185be19defb9351859a9590c2f2d68
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-01-05 19:32:03 +00:00
Paul Duffin
58f7784e95 Merge "Stop changes to BAZEL_METRICS_DIR regenerating ninja file" 2023-01-05 18:02:10 +00:00
Cole Faust
1e905903ea Merge "Use WriteFileRule instead of custom echo commands" am: da5e739628 am: ce8d7f6d71
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2362261

Change-Id: Ia8861a4bf7bc8212de4f83d14b61e9f85ab33b4c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-01-04 20:38:01 +00:00
Paul Duffin
184366a18f Stop changes to BAZEL_METRICS_DIR regenerating ninja file
Bug: 262738679
Test: BAZEL_METRICS_DIR=dir1 m nothing
      BAZEL_METRICS_DIR=dir2 m nothing
      # Make sure that the second does not regenerate the ninja file.
Change-Id: If30f13eee5d27d902c894af04af38078f437b6df
2023-01-04 10:55:20 +00:00
Cole Faust
a734749148 Use WriteFileRule instead of custom echo commands
These instances could use WriteFileRule instead of
making their own shell code to write a file.

Test: Presubmits
Change-Id: I9c809b2164a68b4ce1c22fbbd0d7497240110b39
2023-01-03 14:42:23 -08:00
Spandan Das
5c8b2611bd Merge "Create (API) bp2build converters for droidstubs" am: 87c149dccb am: be85f83fa3
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2322300

Change-Id: Ib4c7a32e94d3af8d9a8284913dcff7fb105142c7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-29 19:01:04 +00:00
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
Spandan Das
87c149dccb Merge "Create (API) bp2build converters for droidstubs" 2022-12-29 17:58:45 +00:00
Spandan Das
4ac2aed136 Create a "Toolchain" API surface
This creates a new API surface for the APIs provided by ART to compile
other API domains (e.g. this contains LambdaMetaFactory). The scope of
this API surface is restricted to compile-time. Unlike the other API
surfaces (e.g. public) whose APIs will exist on device in the form of
implementation libraries, these classes are not guaranteed to exist on
device.

This also updates the naming convention map used in Multi-tree API
export

Bug: 261244752
Test: TH
Change-Id: I164714d68618a3c289bac1a695958e36fdbbda5d
2022-12-28 23:58:55 +00:00
Spandan Das
0b555e323b Create (API) bp2build converters for droidstubs
- The converter runs for api_bp2build, not bp2build workspace
- Since droidstubs is an internal module created by java_sdk_library,
  the conversion encompasses the latter as well
- Since droidstubs do not have an api_surface attribute, this conversion
  uses naming convention to infer the api_surface represented by the api
  file e.g. *stubs.source -> publicapi, *stubs.source.system -> systemapi)
- Also adds an SdkIntraCore enum to represent the API surface provided
  by one core module to another

There is also ongoing work to check in java_api_contribution modules in
Soong. Once we have that, we can update this converter to operate on
that module type instead

Test: go test ./bp2build
Change-Id: Ia85828e04c738d9ffcc524856d7c3034ee29bbf9
2022-12-28 23:58:52 +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
Treehugger Robot
6c3f089e09 Merge "Streamline AndroidMk generation" am: 16d87f33a2 am: c8d9d50240
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2334437

Change-Id: I80d64edb7399fc8cbf2e7c1522d6b8ae3593e15f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-13 20:51:18 +00:00
Colin Cross
d5c7ddb4df Workaround bazel command too long
Write long bazel commands returned by aquery to a shell script
before executing them to work around command line length limits.

Bug: 261536423
Test: USE_HOST_MUSL=true build/bazel/ci/mixed_libc.sh
Change-Id: Id98a07800df82d1538e6b16b733488a1b9943bf3
2022-12-13 12:40:03 -08:00
Colin Cross
7a9803cbde Merge "Add external/musl to the bp2build allowlists" 2022-12-13 20:00:55 +00:00
Sam Delmerico
eddd3c0ba4 add APEX transitive dependency validation
Bug: 218419109
Test: b build //packages/modules/adb/apex:com.android.adbd
Change-Id: I93b0c99d6521e419e52c63271646448f6d708c22
2022-12-13 14:32:19 -05:00
Sasha Smundak
dcb6129269 Streamline AndroidMk generation
Add AndroidMkEmitAssignList to emit a line to assign the items from
the given list of string arrays.

Test: treehugger
Change-Id: Id5acbef38ea4e91349bd2461f226db352d4b8123
2022-12-12 18:06:49 -08:00
Cole Faust
de12be3fb1 Allowlist build files in external/python/absl-py
Needed because we import absl-py in our bazel.workspace file.
It only worked before in b, not mixed builds, because b was
run from the real android tree instead of out/soong/workspace.

Bug: 234449134
Bug: 249685973
Test: Presubmits
Change-Id: Ie6985582c55a4a95338fb3a8ff7b13ddb522c391
2022-12-12 12:27:31 -08:00
Paul Duffin
0e2a5bc075 Remove memberDepsMutator, SdkAware et al
Previously, the memberDepsMutator was responsible for tracking the
membership of modules in an sdk/module_exports (or corresponding
snapshot). That was only used to determine whether a module was in a
versioned sdk snapshot so that it could be treated differently by the
build. As there are no versioned sdk snapshots these can now be
removed.

This change removes the memberDepsMutator, along with SdkAware and
related types that are no longer used.

Bug: 260237150
Test: m nothing
Change-Id: I2668679a42d5b3f33f9e06d5b59804dfdae5f6da
2022-12-12 17:33:06 +00:00
Paul Duffin
d796f6f6dc Stop module types being SdkAware
Removes all usages of SdkBase and InitSdkAwareModule.

Bug: 260237150
Test: m nothing
Change-Id: I07db8afc805eadbeb5b23f2e1d2f51567eecfab0
2022-12-12 17:33:06 +00:00
Paul Duffin
2178762a8a Remove SdkAware.SdkMemberComponentName
That method was provided to allow a java_sdk_library_import that was
part of a versioned sdk snapshot to create the name of its component
modules consistent with the way in which modules were named within the
sdk snapshot. As versioned sdk snapshots have all been removed this is
no longer necessary.

Bug: 260237150
Test: m nothing
Change-Id: Iee35abd6d210d9a33dfd8ef2f9c77a53329fda24
2022-12-12 17:33:06 +00:00
Paul Duffin
5e71e68a82 Replace usages of SdkAware in sdk module with Module
Previously, the sdk snapshot code used SdkAware instead of Module to
ensure that all its members had implemented SdkAware. However, it never
used any of the methods provided by SdkAware, or if it did it no longer
does. So, this change replaces usages of SdkAware with Module in
preparation for deleting it completely.

Bug: 260237150
Test: m nothing
Change-Id: Ia89e02394f27b2da776f0cf0f0bc86835a03433a
2022-12-12 17:33:06 +00:00
Paul Duffin
458a15bd8a Remove IsModuleInVersionedSdk
Previously, as all versioned sdk snapshots have been removed from
Android.bp files this method would always return false. This change
effectively replaces all calls to it with false, and then optimizes
away any unused code.

Bug: 260237150
Test: m nothing
Change-Id: I1b717ee8345e807bd888451f6e7e3c3a0d391ee2
2022-12-12 17:33:05 +00:00
Cole Faust
8ec823cba1 Allow adding extra tradefed options in the Android.bp file
Some tests need to add custom tradefed options, but still want to
keep most of the soong autogenerated tradefed xml file.

Expose a test_options: { tradefed_options: [...] } property that
will allow tests to add more options to the autogenerated xml file.

Fixes: 184895128
Test: go test, and verified that the ninja files did not change for aosp_arm64
Change-Id: I75f7eb002c8325ce7cdc76e12e76e16195320620
2022-12-09 15:23:26 -08:00
Colin Cross
20c89f1adf Add external/musl to the bp2build allowlists
Add external/musl to the bp2build allowlists.  Disable libc_musl_sysroot,
which fails due to a $(locations) reference to a glob that is
unsupported in bazel.

Bug: 259266326
Test: //external/musl:libc_musl builds
Change-Id: Icf0ea2f89854ba3605096dcaa95c1c829af34dc3
2022-12-09 13:58:58 -08:00
Treehugger Robot
b8422f4223 Merge "Add adbd to staging allowlist" am: 3784d14404 am: b0208fb5c7
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2336162

Change-Id: If61f121e0b5428bea8d2b0801b66ee4c00449d4d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-08 22:48:59 +00:00
Chris Parsons
9f0e552bb9 Add adbd to staging allowlist
Bug: 254081374
Test: lunch aosp_arm64 && m --bazel-mode-staging
Test: Manual inspection of `ninja -f out/combined-aosp_arm64.ninja -t commands com.android.adbd | grep "bazel"` after the above command
Change-Id: Ic5a553e1442b22ad2a57456d34cbec6a14e8a950
2022-12-08 14:34:32 -05:00
Treehugger Robot
70d9855cfb Merge "Streamline NewBazeContext code" am: 41ec4e6548 am: 17d64e538a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2331702

Change-Id: Ib96d53bdafc5ac2eba7c0e60bc3f35095bfd2d0c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-07 19:41:19 +00:00
Treehugger Robot
41ec4e6548 Merge "Streamline NewBazeContext code" 2022-12-07 19:11:49 +00:00
Sorin Basca
bc1cb99891 Merge "Remove unused rules for platform-robolectric-4.5.1-prebuilt" am: 50e007643b am: 7e05636029
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2329898

Change-Id: Ieeecd4e0758c593e5c5812ebd5833f5d64fbe926
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-07 12:40:57 +00:00
Sasha Smundak
dc87f2db0e Streamline NewBazeContext code
Test: treehugger
Change-Id: I707636fef70d35dcb29796d3faed2168bf5adb15
2022-12-06 20:29:28 -08:00
utzcoz
682bc9d4c9 Remove unused rules for platform-robolectric-4.5.1-prebuilt
platform-robolectric-4.5.1-prebuilt was removed by
https://android-review.googlesource.com/c/platform/prebuilts/misc/+/2314082,
and soong's special rules for platform-robolectric-4.5.1-prebuilt
is not needed anymore.

Test: m

Signed-off-by: utzcoz <utzcoz@gmail.com>
Change-Id: I953ec775505ccd0924f5a3f7fc29bdc7e573d335
2022-12-06 21:43:17 +08:00
Spandan Das
09ccdb9eaa Merge "Register singletons in api_bp2build" am: c74bf95708 am: 16909873a3
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2322299

Change-Id: I95683c6dc38f95fcfbf99abded5df482c4dac144
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-06 02:03:50 +00:00
Spandan Das
c74bf95708 Merge "Register singletons in api_bp2build" 2022-12-06 00:57:06 +00:00
Spandan Das
bd7850f20e Create a new product variable to gate blueprint files am: c576383336 am: ff5b89e55d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2297118

Change-Id: I2da17a8f4c06a4b1bd3b1a124006ecaa1fb53b20
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-06 00:50:21 +00:00
Spandan Das
75e139b50e Register singletons in api_bp2build
Singleton modules are not used in this workspace (they do not implement
`ConvertWithApiBp2build`). However, we still need to add them since
there is a check in `SingletonModuleFactoryAdaptor` that depends on the
singletons being registered. We do this for bp2build as well (see
`RegisterForBazelConversion`)

This was probably always an issue in api_bp2build, but became
incompatible as a side-effect of the refactoring in aosp/2287719
that removed ctx.Register() from the newContext function.

Test: m api_bp2build --skip-soong-tests
Change-Id: I9ba1df2cc1e8ec916635e5280c66f8df68d7e79b
2022-12-05 22:27:06 +00:00
Spandan Das
c576383336 Create a new product variable to gate blueprint files
Users can use this feature by
1. Setting PRODUCT_INCLUDE_TAGS += <val> in their product mk files
2. Set
```
blueprint_packge_includes {
  match_al: ["<val>"],
}

other_module_type {name: foo}
other_module_type {name: bar}
```

bar and foo will be included if and only if <val> is set

Test: Unit tests in blueprint
Test: TH

Change-Id: I32eed4e3b5ac47fb565c62d13d8881fa984c86f4
2022-12-05 19:15:06 +00:00
MarkDacek
fe065a19f4 Add command line flag for extra bazel-built modules am: d06db5dd5b am: ad4560237e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2320576

Change-Id: Icbdd13a5676a4ba2681af32413e5b06eeb1f8bde
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-02 23:00:02 +00:00
MarkDacek
d06db5dd5b Add command line flag for extra bazel-built modules
Test: m libcore --bazel-mode-staging --bazel-force-enabled-modules=libcore and find out/bazel/ -name libcore*

Change-Id: I065696d06ce07e05300a41e133867a6e7a891b5e
2022-12-02 21:16:11 +00:00
Paul Duffin
a59846ccbd Merge "Support running bp2build tests in fixtures" am: de47ec777f am: b4c2b782d0
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2281252

Change-Id: I74ee5cddc1dbe4b20fc7580c801f6e3feb48e1f1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-02 17:04:08 +00:00
Treehugger Robot
f4c850bb1a Merge changes Ia4016240,Iba586155 am: a36589c4ca am: 1ed3a7a0f7
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2309617

Change-Id: I43eb1f0948db5b3de6bdc3a593549df206718f7c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-02 11:49:46 +00:00
Paul Duffin
4c0765a669 Support running bp2build tests in fixtures
Previously, the fixture test infrastructure was hard coded to
initialize itself in preparation for invoking the PrepareBuildActions()
method. That meant it could not be used for testing the bp2build and
apiBp2build modes which required different initialization and called a
different method.

This change extracts that behavior into a FixtureTestRunner and adds an
implementation that allows it to test the above two modes. It then uses
that to implement the runBp2BuildTestCaseWithSetup method.

The TestPrebuiltLibraryAdditionalAttrs was the only test which broke as
it supplied an invalid path to the MockFS (it does not support using a
trailing / to represent an empty build directory). So, it was modified
to add a couple of files inside those directories instead.

Test: m nothing
Change-Id: I6798a4f761160af8d1bfed81d46de9628bda3eb9
2022-12-02 11:14:17 +00:00
Treehugger Robot
a36589c4ca Merge changes Ia4016240,Iba586155
* changes:
  Allow choosing which soong_build invocations to run in the debugger
  Show module type in a module section of the Android-TARGET.mk
2022-12-02 10:36:07 +00:00
Jingwen Chen
73c3171859 Merge "Convert apex_available (for supported modules) to bazel tags." am: 8ec23f846d am: 9867290c71
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2321580

Change-Id: I5755b47b6d486b137da60d1f2251d48737d1b49e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-02 08:12:33 +00:00
Jingwen Chen
8ec23f846d Merge "Convert apex_available (for supported modules) to bazel tags." 2022-12-02 07:22:10 +00:00
Sasha Smundak
5c4729df93 Show module type in a module section of the Android-TARGET.mk
The first line of each section will be
```
include $(CLEAR_VARS)  # <module type>
...
```

Bug: 257037252
Test: treehugger
Change-Id: Iba586155b682fe4e1e5817d8397eda8f9d9c8789
2022-12-01 21:12:11 -08:00
Treehugger Robot
d405dffd7c Merge "Print error code when bazel invocation fails" am: 591c5ee0fb am: 33738d9c0e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2323957

Change-Id: Iccc71f415493bcd8dce337c1c6a48769e6f32828
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-02 01:18:36 +00:00
Treehugger Robot
591c5ee0fb Merge "Print error code when bazel invocation fails" 2022-12-02 00:10:02 +00:00
Liz Kammer
8532b38022 Merge changes Ia165e4be,I63fe74fb am: f843436455 am: f9420ac643
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2260886

Change-Id: I7cb7bdd7d7f315741f070ec4457e6a78b8079173
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-01 23:05:24 +00:00
Liz Kammer
f843436455 Merge changes Ia165e4be,I63fe74fb
* changes:
  Update sanitize to not modify user properties
  Extend sanitize_test.go
2022-12-01 22:10:18 +00:00
Sasha Smundak
0e87b186cb Print error code when bazel invocation fails
Also, fix compiler warnings about deprecated ioutil.WriteFile/ReadFile
and about redundant variables

Test: treehugger
Change-Id: Iaf8f89b0e991dae8c5da403d4a1ec3a270f1ae29
2022-12-01 13:37:48 -08:00
Kevin Dagostino
e8b08ce5e3 Merge "Use existing BUILD files for test-related tools." am: dfc72a8ca2 am: 2090f1104c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2309887

Change-Id: I94b0128f2d992842f51bc8676cc16b3c8ab68000
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-01 08:32:58 +00:00