Commit Graph

6775 Commits

Author SHA1 Message Date
Liz Kammer
9e2a5a7d6d Don't panic for unhandled product vars
Instead, we return an error. This allows us to access some product
variable information earlier when it will not be used as an attribute
without panicing

Test: m nothing
Change-Id: Id094b2b9e1364a8d174d99b3824fa149fb235b3e
2023-09-19 15:58:22 -04:00
Liz Kammer
e0cbc983ec Always convert prebuilt libraries
Test: CI
Test: patch in CL using prebuilt mainline modules & build
Bug: 300640274
Change-Id: Ie00b111a04198b266985f3e1c34c960844c0a327
2023-09-19 15:58:22 -04:00
Liz Kammer
9a97a8f62a Implement bp2build for java_sdk_library_import
Test: go test bp2build conversion tests
Test: enable modules build from prebuilt and m nothing
Bug: 300640274
Change-Id: I8c015aec546d052bef6c42869e12db4e87d39780
2023-09-19 15:58:22 -04:00
Liz Kammer
86a407f284 Always convert prebuilt cc library headers
Test: go tests
Test: CI
Test: patch in CL using prebuilts for mainline modules and build
Bug: 300640274
Change-Id: I73f70dac679e341670e1484ce57bc984f413d409
2023-09-19 15:58:20 -04:00
Cole Faust
b4cb0c857f Move the android_platform next to it's entrypoint product config file
Because we're going to start generating partition images for the
product, and the partitions will eventually be checked in, we want
them to be in sensible locations. And the platform should be there as
well so all the targets for a product are co-located.

Bug: 297269187
Test: m nothing && b build --config=android //build/bazel/examples/apex/minimal:build.bazel.examples.apex.minimal
Change-Id: Iaa25c44aa00295ada279d5fd49b5498bbafb89d5
2023-09-19 09:54:59 -07:00
Jingwen Chen
3aaf1a80bd Merge "[bp2build] android_test bp2build." into main am: 088c4b652b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2727561

Change-Id: Id15bc7e836370645f6777ecc4ad1f34cd678ba07
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-19 00:04:46 +00:00
Jingwen Chen
088c4b652b Merge "[bp2build] android_test bp2build." into main 2023-09-18 23:27:14 +00:00
Treehugger Robot
48b6649189 Merge "Sort always convert by type list" into main am: 35f1ae0721
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2754805

Change-Id: Ib624dd4be4dd06aae0f6ab4338113089d3b4fb36
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-18 18:55:13 +00:00
Treehugger Robot
35f1ae0721 Merge "Sort always convert by type list" into main 2023-09-18 18:03:58 +00:00
Liz Kammer
4fc71fff30 Sort always convert by type list
Test: CI
Change-Id: Icdf1f4e8132d959b494e2570854ee06973a816b0
2023-09-18 09:11:18 -04:00
Jingwen Chen
e12c083198 [bp2build] android_test bp2build.
android_test is just an android_app, but the test bits are handled
purely in Starlark (tradefed_test_impl).

This enables building HelloWorldTests (android_test) with Bazel.

Bug: 297030120
Bug: 297029612
Test: WIP
Change-Id: I6d287c94b31698ea247da48e4cd6b5a75bc71e11
2023-09-18 12:39:06 +00:00
Sam Delmerico
a588d153c8 support sandboxed rust rules
This commit adds support for compiling rust rules inside the sbox
sandbox. To compile a rust module with sandboxing enabled, the entry
point to the crate must be specified via the `crate_root` property, and
all input sources and compile-time data must be specified via the `srcs`
and `compile_data` properties.

Bug: 286077158
Change-Id: I8c9dc5cf7578037a583b4be2e2f73cf20ffd4408
2023-09-15 22:46:56 +00:00
Sam Delmerico
d96a60685a conditionally escape rule builder command
For rules which use RuleBuilder with Ninja variables (using the
BuildWithUnescapedNinjaVars function) but are not sandboxed, the command
output by RuleBuilder must not be escaped, or else Ninja variables will
not be evaluated until they are run on the command line.

Test: m libnum_traits liboid_registry crosvm droid
Change-Id: I81611368ab1975220f7f517df2f57646deac2af8
2023-09-15 22:41:58 +00:00
Sam Delmerico
0e2d63e4d2 Revert^2 "allow Ninja variables in RuleBuilder API"
7b02d8159e

Change-Id: I9f2031162b019e51b869ea0db151c86db447b23d
2023-09-15 22:41:56 +00:00
Sam Delmerico
9333ac1249 Revert^2 "add rust_toolchain_rustc_prebuilt module type"
400749d1f0

Change-Id: I63f04e13605c43f800f01f45345e4b3dc61aefb7
2023-09-15 22:40:16 +00:00
Treehugger Robot
3a01b22df2 Merge "Allowlist ndk STL dependencies" into main am: 9f7028852c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2750725

Change-Id: I6419fd0cb9cb50e9f2d993df8d77456458a3c5b9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-15 21:49:46 +00:00
Treehugger Robot
9f7028852c Merge "Allowlist ndk STL dependencies" into main 2023-09-15 21:23:49 +00:00
Yu Liu
8c21c60e66 Merge "Support aconfig_declarations, aconfig_values and aconfig_value_set" into main am: e6153b54bc
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2741124

Change-Id: I69520f0c66a3b42c7c161cedbf06ae711d9f93e4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-15 17:22:06 +00:00
Yu Liu
e6153b54bc Merge "Support aconfig_declarations, aconfig_values and aconfig_value_set" into main 2023-09-15 16:46:01 +00:00
Christopher Parsons
215849163c Merge "Add unit test for parsing build files in bp2build" into main am: 3671c385c7
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2751688

Change-Id: I69cb0e41bfd6bca70683a1f35e3c1dce0feb517e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-15 01:14:23 +00:00
Christopher Parsons
3671c385c7 Merge "Add unit test for parsing build files in bp2build" into main 2023-09-15 00:04:09 +00:00
Usta (Tsering) Shrestha
8ae2b77eaa Merge "Bp2build-convert droiddoc_exported_dir" into main am: 4e86d7a342
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2734933

Change-Id: I27cccf8626c2ae3a29816b5fa4a94b9c67f7182d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-14 20:44:17 +00:00
Chris Parsons
5011e61c71 Add unit test for parsing build files in bp2build
This involves some minor changes to testing infrastructure.

This is a rollforward of aosp/2628496 with a couple of minor changes:

- In ParseBuildFiles, filter out all build files that are kept due
  to ShouldKeepExistingBuildFileForDir

- Add some minor test infrastructure for StubbedBuildDefinitions, with a
  couple of proof of concept tests used to demonstrate its usage. This
  pattern will become immensely more common as we implement allowlist v2
  (as we will need to update all tests which today simulate build
  definitions that have missing deps)

Bug: 285631638
Fixes: 286545783
Test: bp2build.sh
Test: m nothing
Change-Id: I7c3a03b02098e39dd8e51d327482b440f294478f
2023-09-14 19:19:28 +00:00
Spandan Das
3d6ac190f2 Allowlist ndk STL dependencies
Bug: 298088835
Test: TH
Change-Id: I43942ad17645c99de82a966d674ef80100eaffd0
2023-09-14 17:34:30 +00:00
usta
72c6c6c8be Bp2build-convert droiddoc_exported_dir
Bug: 283299388
Test: `m bp2build` and manual inspection
Change-Id: Ieec2094e446bb030f30103a7e1a06e35cbdcc72e
2023-09-14 12:06:54 -04:00
Treehugger Robot
ccceb1b092 Merge "Allowlist more targets for framework" into main am: ece322f640
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2745834

Change-Id: I1c8531acc3f0dd62291b5cc77a6625f11d9d3236
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-13 22:08:24 +00:00
Liz Kammer
b70eae04ce Allowlist more targets for framework
Test: bp2build.sh
Change-Id: I4bd080dd795f40d9095157fe4ba4ec7f0e251757
2023-09-13 11:28:02 -04:00
Liz Kammer
b6d89afe2d Merge "Sort do not convert for unconverted deps" into main am: 7ebb91a449
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2744700

Change-Id: Id2fb4d9070d0880186c1c65c55b106ad26fa005b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-12 15:22:07 +00:00
Liz Kammer
f673c2ea9f Sort do not convert for unconverted deps
Test: n/a
Change-Id: Id86986f17d23fe47e47b303a1828478b8e887513
2023-09-12 09:08:17 -04:00
Treehugger Robot
684cdf8a49 Merge "Allowlist packages instead of modules" into main am: 0e3da8162c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2747533

Change-Id: I29f570158b77e6623909c76464f80631236e0b48
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-12 02:14:10 +00:00
Treehugger Robot
0e3da8162c Merge "Allowlist packages instead of modules" into main 2023-09-12 01:53:49 +00:00
Zi Wang
28907d4680 Merge "Allowlist libprotobuf-java-full" into main am: 37aa1729b0
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2746115

Change-Id: I5a8d551d5f39932cbe9d44088d5bb75294019f67
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-11 22:59:44 +00:00
Zi Wang
37aa1729b0 Merge "Allowlist libprotobuf-java-full" into main 2023-09-11 22:50:40 +00:00
Vinh Tran
9226051310 Allowlist packages instead of modules
bp2build doesn't support allowlisting fully qualified module names. Hence, when modules such as libui and libbinder have duplicate names with corresponding fdo_profile modules, bp2build yields an error. See b/299663210 for more context.

Test: CI
Bug: 299663210
Change-Id: Ic175f5aea38139d34c5df8b9d02e7d82d9b3fc10
2023-09-11 18:15:35 -04:00
Cole Faust
acb8ca12a0 Merge "Allow actions to read BUILD_BROKEN_INCORRECT_PARTITION_IMAGES" into main am: 7a05d1392a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2746357

Change-Id: I6efc7cf9adabf83c9e0d86d49b56f7db73ec763f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-11 18:07:51 +00:00
Cole Faust
7a05d1392a Merge "Allow actions to read BUILD_BROKEN_INCORRECT_PARTITION_IMAGES" into main 2023-09-11 17:25:18 +00:00
Yu Liu
2cc802a442 Support aconfig_declarations, aconfig_values and aconfig_value_set
Bug: 297356603
Test: Unit tests
Change-Id: I2f797578a35322440db0f281b4d46b6652512e00
2023-09-09 12:33:40 -07:00
Treehugger Robot
b6a5fe6bcc Merge "Re-enable partition test" into main am: edbf854aa5
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2745801

Change-Id: I261046406a9fa429abd21e3655523e5f62cefdfd
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-08 23:42:20 +00:00
Treehugger Robot
edbf854aa5 Merge "Re-enable partition test" into main 2023-09-08 23:16:58 +00:00
Cole Faust
ded796030b Allow actions to read BUILD_BROKEN_INCORRECT_PARTITION_IMAGES
To maintain good backwards compatibility with the legacy partition
building behavior, allow actions to read
BUILD_BROKEN_INCORRECT_PARTITION_IMAGES so that we don't have to rerun
analysis.

Bug: 205632228
Test: Presubmits
Change-Id: I2b55c0143cbdaf010e6b5fd0c3d51d6930a94eff
2023-09-08 15:58:13 -07:00
Sam Delmerico
45b366c587 Merge changes from topic "revert-2605644-rulebuilder-ninja-vars-OAAWYCDDLT" into main am: 1d3740a274
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2746977

Change-Id: Ie660c5611ea4938afa8abd0e64d1db788a811ae1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-08 21:20:28 +00:00
Sam Delmerico
f7ea23c683 Revert "allow Ninja variables in RuleBuilder API" am: 7b02d8159e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2746975

Change-Id: I3fa604a507c4fe1370ca8706ed6edb1e80953cd6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-08 21:20:15 +00:00
Sam Delmerico
1d3740a274 Merge changes from topic "revert-2605644-rulebuilder-ninja-vars-OAAWYCDDLT" into main
* changes:
  Revert "add rust_toolchain_rustc_prebuilt module type"
  Revert "add crate_root property to rust modules"
  Revert "allow Ninja variables in RuleBuilder API"
2023-09-08 20:46:55 +00:00
Cole Faust
9a6fa98cd3 Re-enable partition test
Due to the series of recent reverts, it's working now.

Bug: 297269187
Test: m bazel_sandwich
Change-Id: I010a942918467713e08b900aec06c7011c40c3be
2023-09-08 12:00:39 -07:00
Treehugger Robot
3a9ce197a9 Merge changes I86f30b99,I2769c0d5 into main am: 3fb2002c9e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2746855

Change-Id: Ie61359bea67a9afdf9e1e2e3e29568edfeccba79
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-08 16:31:33 +00:00
Treehugger Robot
e701757b08 Merge "Add all of hardware/interfaces/media to allowlist" into main am: b091d3b688
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2746853

Change-Id: I19f41491f92834e3803998e134a84e140b603214
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-08 16:31:16 +00:00
Sam Delmerico
7b02d8159e Revert "allow Ninja variables in RuleBuilder API"
Revert submission 2605644-rulebuilder-ninja-vars

Reason for revert: b/299568218

Reverted changes: /q/submissionid:2605644-rulebuilder-ninja-vars

Change-Id: Ia738c100b8431dea6151939a800b992f877b5bb8
2023-09-08 16:10:54 +00:00
Sam Delmerico
400749d1f0 Revert "add rust_toolchain_rustc_prebuilt module type"
Revert submission 2605644-rulebuilder-ninja-vars

Reason for revert: b/299568218

Reverted changes: /q/submissionid:2605644-rulebuilder-ninja-vars

Change-Id: Ic3d1ba7e8a61427b52f31cc3f187c9d5a7d9a7bb
2023-09-08 16:10:47 +00:00
Treehugger Robot
3fb2002c9e Merge changes I86f30b99,I2769c0d5 into main
* changes:
  Do not convert resource dirs without resources
  Do not convert java libraries with core_platform
2023-09-08 16:04:45 +00:00
Treehugger Robot
b091d3b688 Merge "Add all of hardware/interfaces/media to allowlist" into main 2023-09-08 16:04:44 +00:00