Commit Graph

5208 Commits

Author SHA1 Message Date
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
Kevin Dagostino
dfc72a8ca2 Merge "Use existing BUILD files for test-related tools." 2022-12-01 07:32:59 +00:00
Jingwen Chen
c4c34e1eab Convert apex_available (for supported modules) to bazel tags.
The tags will then be read by an aspect applied from apex attributes to
validate that the deps are explicitly opt-in to the appropriate apex.

The semantics of this is the same as the Soong apex_available property.

This also adds the "base_apex_name" attr to override_apex conversion so
that apex_available checks continue to work on the non-Google and non-Go
apex names.

Test: presubmits
Fixes: 218841706
Change-Id: I19b3637da9aa47573b252d74f62b601fbdc3784d
2022-12-01 06:25:25 +00:00
Christopher Parsons
d7e43c20d6 Merge "Revert "Revert "Add tzdata do the Bazel mixed build prod mode allowlist.""" am: e2da96f892 am: 2487ea1f52
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2320454

Change-Id: Icd43930bb3de3e33571ad12d22a0fe6d90806643
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-30 20:57:11 +00:00
Sam Delmerico
043565cbde Merge "fallback to nonmixed builds for unsupported builds" am: d0b3cd0733 am: 350f6df957
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2302774

Change-Id: I17a5db3ff57e8ed188f909ce453c52f361194ff9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-30 20:24:29 +00:00
Christopher Parsons
e2da96f892 Merge "Revert "Revert "Add tzdata do the Bazel mixed build prod mode allowlist.""" 2022-11-30 20:02:52 +00:00
Sam Delmerico
d0b3cd0733 Merge "fallback to nonmixed builds for unsupported builds" 2022-11-30 19:40:59 +00:00
Yu Liu
d88efc5548 Merge "Support abi check in bazel." am: 734fefdf90 am: 67841b7226
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2300265

Change-Id: I89680dfd0aa497c74eb483ca403967dccdfcaaea
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-30 18:45:27 +00:00
Treehugger Robot
f9e5636c1b Merge "Add more cases to vendor-installed module" am: d0cd326415 am: 92b787bb3f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2319850

Change-Id: If84c80687f795067fa6609d21f014e14f84f27ed
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-30 18:13:36 +00:00
Yu Liu
734fefdf90 Merge "Support abi check in bazel." 2022-11-30 17:57:42 +00:00
Treehugger Robot
d0cd326415 Merge "Add more cases to vendor-installed module" 2022-11-30 17:19:25 +00:00
Christopher Parsons
ff4cceb7bc Revert "Revert "Add tzdata do the Bazel mixed build prod mode allowlist.""
This reverts commit f8ab0321e3.

Reason for revert: Fixed underlying bugs (aosp-riscv and llvm breakages)

Change-Id: Ib7fe8e39af5bbe40bac615c815307ad9f05e83d3
2022-11-30 15:44:15 +00:00
Sam Delmerico
5150d0d309 fallback to nonmixed builds for unsupported builds
Bug: 253664931
Change-Id: I8026d0412b8dd62f55edf776f72747209ce2e955
2022-11-30 10:36:48 -05:00
Treehugger Robot
68c6270955 Merge "Revert "Allowlist build files in external/python/absl-py"" am: f219c0fc87 am: 7f61a3b638
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2322224

Change-Id: I3825bcb5fc27cadf98174eb3a0e72c3f49455eed
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-30 08:50:23 +00:00
Treehugger Robot
f219c0fc87 Merge "Revert "Allowlist build files in external/python/absl-py"" 2022-11-30 07:47:26 +00:00
Kevin Dagostino
3e2da94e2d Use existing BUILD files for test-related tools.
Allowlist BUILD files of test-related tools so that they appear in the final bp2build workspace. This is required for Bazel test rules that are dependent on these projects.

Test: b build //prebuilts/runtime/... //tools/asuite/atest:atest-tradefed  //tools/asuite/atest/bazel/reporter/...
Change-Id: Ie34658706efe6ca7657c935528df8daef61bfc0c
2022-11-30 06:07:59 +00:00
Cole Faust
762c2def20 Revert "Allowlist build files in external/python/absl-py"
Revert submission 2308141-colefaust_run_b_from_out_folder

Reason for revert: Breaks CI due to more instances of the bazel shutdown issue
Reverted Changes:
I51c28e232:Allowlist build files in external/python/absl-py
I9e6530d95:Cd into the bazel workspace instead of using --pac...

Change-Id: Ice47ef2baaef9976546f9562dc7dd9b19b383d59
2022-11-30 05:16:30 +00:00
Krzysztof Kosiński
4e7442326d Merge "Revert "Add tzdata do the Bazel mixed build prod mode allowlist."" am: b35b88ee82 am: d867b39f76
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2321954

Change-Id: I5f1ab496e51c4f20df88f721712f48878357279a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-30 01:09:23 +00:00
Krzysztof Kosiński
b35b88ee82 Merge "Revert "Add tzdata do the Bazel mixed build prod mode allowlist."" 2022-11-30 00:19:17 +00:00
Treehugger Robot
8594199a11 Merge "Disable bazel for riscv_64" am: 00652e7570 am: acf6f6e606
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2322093

Change-Id: I4165f4414f82fea05adb4b84a930f0c5a7e78b41
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-30 00:04:42 +00:00
Krzysztof Kosiński
f8ab0321e3 Revert "Add tzdata do the Bazel mixed build prod mode allowlist."
This reverts commit ff387e55fc.

Reason for revert: breaks aosp-riscv target
https://android-build.googleplex.com/builds/submitted/9347261/aosp_riscv64-userdebug/latest/view/logs/build_error.log

Change-Id: I789d0af91ab18185fbbe68616c6e10f59be4169c
2022-11-29 23:16:13 +00:00
Treehugger Robot
00652e7570 Merge "Disable bazel for riscv_64" 2022-11-29 22:58:59 +00:00
Cole Faust
2db7d85bcd Merge "Allowlist build files in external/python/absl-py" am: 5d4f066ec9 am: 59e28e489a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2308367

Change-Id: Ie9f33cb39b049ece57609bbe7e6e73f7febd2fd4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-29 20:51:46 +00:00
Chris Parsons
428c30f89a Disable bazel for riscv_64
This product is experimental and unsupported for Bazel at this time

Test: lunch aosp_riscv64-userdebug && m nothing
Test: lunch aosp_arm64-userdebug && m nothing
Change-Id: I761afb9524f1008f9d5472d2de19bb84342e9e29
2022-11-29 15:35:56 -05:00
Cole Faust
5d4f066ec9 Merge "Allowlist build files in external/python/absl-py" 2022-11-29 20:03:20 +00:00
Yu Liu
56ccb1aecd Support abi check in bazel.
Bug: 253498204
Test: Manual and unit test.
Change-Id: Id23c4f772f67c4ba05704eaad77322133474b42b
2022-11-29 11:25:10 -08:00
Igor Foox
85e3a9f7d4 Merge "Add tzdata do the Bazel mixed build prod mode allowlist." am: 6463871fd9 am: 3e98a65694
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2298640

Change-Id: I68d33a57813850227d7433e746ad06ea1ebea5ae
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-29 19:14:19 +00:00
Igor Foox
6463871fd9 Merge "Add tzdata do the Bazel mixed build prod mode allowlist." 2022-11-29 18:09:23 +00:00
Kiyoung Kim
f160f7ffa8 Add more cases to vendor-installed module
Current InstallInVendor only checks vendor property, but there are more
properties to check if the module will be installed in the vendor. This
change adds two more cases (soc_specific and proprietary) to the
function.

Bug: 233294155
Test: N/A
Change-Id: Ic3cb4c52f5097cdcc6231c0e85a62ce3ad6094b3
2022-11-29 10:58:08 +09:00
Treehugger Robot
32a3dbc860 Merge "Improve mixed builds error messages" am: efc1bc7f2f am: c0eb594bcc
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2313738

Change-Id: I82f93ffefd012c5238e5beb20b5e7ecb50c3d4a1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-28 23:05:15 +00:00
Treehugger Robot
efc1bc7f2f Merge "Improve mixed builds error messages" 2022-11-28 22:06:21 +00:00
Cole Faust
93dc19d39d 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: I51c28e23260bed7ca7d4968fd823f52f0d26a0ab
2022-11-28 12:00:00 -08:00
utzcoz
5c528597e9 Remove unused rules for platform-robolectric-4.4-prebuilt am: 4283bf300b am: 3d282865c4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2314978

Change-Id: I73c436aa94fa70e60d6bcd048bb594ebcbceb9b5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-28 17:23:29 +00:00
utzcoz
4283bf300b Remove unused rules for platform-robolectric-4.4-prebuilt
platform-robolectric-4.4-prebuilt was removed by
https://android-review.googlesource.com/c/platform/prebuilts/misc/+/2298317,
and soong's special rules for platform-robolectric-4.4-prebuilt is not
needed anymore.

Test: m

Signed-off-by: utzcoz <utzcoz@gmail.com>
Change-Id: I3304aa1061d8b945b03cfe1a91f466ceb6ca1260
2022-11-28 07:53:20 +00:00
Igor Foox
ff387e55fc Add tzdata do the Bazel mixed build prod mode allowlist.
Bugs:  b/258504104
Test: Ran a local build and checked build metrics and ninja file,
presubmits.

Change-Id: Ifdefdaebc13188e036b0b9cd55fbdcdfbdc8e11f
2022-11-27 21:48:40 -05:00
Treehugger Robot
08c6c4c354 Merge "Allow stubs implementation to be omitted" am: 378124baf1 am: 6ba2a5b746
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2301917

Change-Id: I586a02cd61b25390152dfa804ffe1d649f0e527c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-24 12:11:52 +00:00
Treehugger Robot
378124baf1 Merge "Allow stubs implementation to be omitted" 2022-11-24 11:12:18 +00:00
Usta (Tsering) Shrestha
fdfda6f69d Merge "volatile-status.txt to be translated to an order-only dep in build.ninja" am: 3caa38827c am: 91621346e3
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2313559

Change-Id: If455b6edd91ae38be5a4ce816be88bd9c293ed54
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-23 16:27:54 +00:00
Usta (Tsering) Shrestha
3caa38827c Merge "volatile-status.txt to be translated to an order-only dep in build.ninja" 2022-11-23 15:31:16 +00:00
Cole Faust
f4591fe5c4 Prevent duplicated license_kinds am: 2ced8c8a57 am: 655af89517
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2313938

Change-Id: Ica42441b87d5d977797c6aadeb248ce6a619b4a8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-23 08:57:31 +00:00