Commit graph

66309 commits

Author SHA1 Message Date
Jooyung Han
c13fad8181 Revert "Initial implementation of the bazel sandwich"
Revert submission 2651299-bazel_sandwich

Reason for revert: b/293883239, checking if this breaks the build.

Reverted changes: /q/submissionid:2651299-bazel_sandwich

Change-Id: I5f1d4bb13d21e6599f5c353dcaba2375f5ec234d
2023-08-01 05:15:17 +00:00
Cole Faust
a20d947329 Initial implementation of the bazel sandwich
The "bazel sandwich" is a mechanism for bazel to depend on make/soong
outputs. The name comes from the fact that bazel is now at the top
and bottom of the build graph. This is intended to allow us to work
on converting the partition builds to bazel while not all of the
dependencies of the partition have been converted.

It works by adding the bazel_sandwich_import_file rule, which emits a
dangling symlink that starts with bazel_sandwich:, and includes
information that the aquery handler in soong reads. The aquery handler
rewrites the symlink so that it points to a file generated by
make/soong, and adds a ninja dependency from the symlink to the file
it's targeting.

This allows us to depend on make-built files from bazel, but notably
it doesn't allow us to depend on analysis-time information from make.
This shouldn't be a problem for the partitions, but limits the use of
the bazel sandwich to similar, less complicated types of builds.

go/roboleaf-bazel-sandwich

Bug: 265127181
Test: m bazel_sandwich
Change-Id: Ic41bae7be0b55f251d04a6a95f846c50ce897adc
2023-07-31 11:53:41 -07:00
Liz Kammer
c796de83c8 Merge "Handle xsd config more like other partitions" into main 2023-07-26 19:18:52 +00:00
Spandan Das
a263005e30 Merge changes from topic "support_libgtest_isolated" into main
* changes:
  Support cc_test.isolated in bp2build
  Fix difference in default `cc_test.isolated` in soong and bp2build
2023-07-26 18:35:40 +00:00
Ivan Lozano
3eca04b39b Merge "rust: Add BTI/PAC for supported targets." into main 2023-07-26 18:11:17 +00:00
Treehugger Robot
4b3001a59e Merge "Disable RBE env variable when we cannot support RBE" into main 2023-07-26 17:24:45 +00:00
Spandan Das
d1cd3518a8 Support cc_test.isolated in bp2build
This property implicitly adds `libgtest_isolated_main` to the static
libs of the test. bp2build will make this and `liblog` explicit in BUILD
files

Since the deps are made explicit in BUILD files, `isolated` becomes a
no-op for cc_test. Remove this property from cc_test.

Test: unit tests
Bug: 244432609
Change-Id: I189a7b6b62d9064f4b2abad49ac4975468046498
2023-07-26 17:06:27 +00:00
Spandan Das
f5a8655cd8 Fix difference in default cc_test.isolated in soong and bp2build
Soong defaults to false, while bp2build defaults to true. This CL fixes
bp2build's default to false to match Soong.

To prevent future differences, bp2build now uses the `isolated()`
function used by Soong. The type of the context object has been changed
to EarlyModuleContext so that the ctx object does not depend on
mutations that might not run in bp2build.

Test: TH
Bug: 244432609
Change-Id: I15346107896312961e8d12270cf2f9a2a48827e1
2023-07-26 17:06:27 +00:00
Trevor Radcliffe
ed83eba40f Merge "Revert "Revert "add media.swcodec to Bazel prod allowlist""" into main 2023-07-26 14:55:14 +00:00
Mark White
f6d7cc94c6 Merge "Revert "Set VIC as minimum SDK version for riscv64"" into main 2023-07-26 08:44:04 +00:00
Mark White
634828f3f9 Merge "Revert "Use prebuilt NDK libc++ for rv64."" into main 2023-07-26 08:44:04 +00:00
NaYoung Yun
02f4e6f559 Revert "Set VIC as minimum SDK version for riscv64"
This reverts commit a96a2677b6.

Reason for revert: build break

Reverted changes: /q/submissionid:2676418-hack-rv64-libc%252B%252B
Bug: 293214158
Bug: 293214503
Bug: 293214158
Bug: 293219471

Change-Id: I6eaa1f7c9f498159db4d50840dd91e246314153f
2023-07-26 04:15:47 +00:00
NaYoung Yun
967e16f3d8 Revert "Use prebuilt NDK libc++ for rv64."
Revert submission 2676418-hack-rv64-libc++

Reason for revert: build break

Reverted changes: /q/submissionid:2676418-hack-rv64-libc%252B%252B

Change-Id: Idd7a5fd3b1687e2a31aa3c036d5d851fb5bbe283
Bug: 293214158
Bug: 293214503
Bug: 293214158
Bug: 293219471
2023-07-26 03:36:47 +00:00
Treehugger Robot
8fbc42cfd7 Merge "Create build settings for all product config variables" into main 2023-07-26 02:41:46 +00:00
Treehugger Robot
5dbed51365 Merge changes from topic "hack-rv64-libc++" into main
* changes:
  Use prebuilt NDK libc++ for rv64.
  Set VIC as minimum SDK version for riscv64
2023-07-26 01:09:19 +00:00
Treehugger Robot
06c246c1af Merge "Revert "Enable R8 full mode by default for apps"""" into main 2023-07-26 00:42:06 +00:00
Treehugger Robot
245482e039 Merge "Move android_library resource handling to Bazel's ResourceProcessorBusyBox" into main 2023-07-26 00:34:57 +00:00
Dan Albert
5757c0cf9a Use prebuilt NDK libc++ for rv64.
Bug: None
Test: None
Change-Id: Iebd8bce9a72a2206dfb3c6311ec9139f018df6a8
2023-07-25 22:12:47 +00:00
Prashanth Swaminathan
a96a2677b6 Set VIC as minimum SDK version for riscv64
Bug: 291150284
Test: Local build of Cuttlefish RISCV targets.
Change-Id: I3879fc9480cac4962d0ecbbf4ab116b331987e82
2023-07-25 22:12:45 +00:00
Jared Duke
a2ab93666d Revert "Enable R8 full mode by default for apps"""
This reverts commit 5d3ec54b6b.

Reason for revert: Breaks a SdkSandboxManagerTest

Change-Id: I30c03d70a2b683f663b00866035ebf56339a4b0b
2023-07-25 21:37:17 +00:00
Colin Cross
4eae06dcc9 Move android_library resource handling to Bazel's ResourceProcessorBusyBox
The R.Java files generated by aapt2 link --no-static-lib-packages
cause scaling problems by combining all resources into every package
listed in a dependencies' AndroidManifest.xml file.  For SystemUI-core
this results in 74 R.java files, each with 76k lines, and takes 20
seconds to compile in javac.

Both AGP and Bazel have workarounds for this that avoid using the
R.java files generated by aapt2, instead generating more efficient
R.class files directly based on the R.txt file.

Bazel uses the ResourceProcessorBusyBox tool that is already present
in our tree to process the resources.  Reuse the same tool in Soong
to create the R.jar.

The more efficient R.class files require modifiying source files
that use incorrect packages to refer to resources.

Bug: 284023594
Test: TestAndroidResourceProcessor
Change-Id: I026073b40dabcfdb10e5d7a52e9348205b0e9a66
Merged-In: I026073b40dabcfdb10e5d7a52e9348205b0e9a66
2023-07-25 21:30:21 +00:00
Treehugger Robot
5ad5c918a3 Merge "Revert "Revert "Enable R8 full mode by default for apps""" into main 2023-07-25 20:22:01 +00:00
Cole Faust
f055db60d4 Create build settings for all product config variables
Bug: 269577299
Test: Presubmits
Change-Id: Id8b7d65d657fa20ad8591e58d5173445b0e4f4df
2023-07-25 11:47:20 -07:00
Treehugger Robot
35448be862 Merge "Make libtest_* deps explicit in BUILD files" into main 2023-07-25 18:46:39 +00:00
Elliott Hughes
575451d111 Merge "Remove a bunch of stuff from the libc allowlist." into main 2023-07-25 18:45:08 +00:00
Ivan Lozano
2797e876f1 rust: Add BTI/PAC for supported targets.
This mirrors the support provided for cc modules.

Bug: 181027427
Test: m rust
Change-Id: I1354b37ec8c47132f143400adba6d42cf2081df5
2023-07-25 14:25:43 -04:00
Juan Yescas
f7bd2592a1 Merge "16k: soong: Add flag Device_page_size_agnostic" into main 2023-07-25 14:24:40 +00:00
Jingwen Chen
6ee23ad2f7 cc_test mixed builds: suffix bazel label with __tf_internal.
To support `b test //path/to:my_test` command line, the actual
executable in the cc_test macro now has the __tf_internal suffix in its
name, so that the top level test suite target can be named without any suffixes.

See other CLs in this topic for more info.

Test: presubmits
Fixes: 292159775
Change-Id: I2d0bfc4276717ae881f6f3eb6aefa88bb47f25da
2023-07-25 08:02:11 +00:00
Yu Liu
41a58a97ae Allowlist the newly added libcodec2_hal_common.
Bug: 292568369
Test: CI
Change-Id: I5847b1c7530573cd7166bd0130d2b47c63cb9d90
2023-07-24 23:31:48 +00:00
Juan Yescas
3848b27c1e 16k: soong: Add flag Device_page_size_agnostic
The flag Device_page_size_agnostic will determine whether
AOSP is kernel page size agnostic or not.

Test: source build/envsetup.sh
      lunch aosp_raven_64-userdebug
      m -j$(nproc)
      cat out/soong/build.aosp_raven_64.ninja | grep TARGET_PAGE_SIZE_AGNOSTIC
Bug: 289419664
Change-Id: I0604db64a3b44db63f93773be003cdd44e0a867b
2023-07-24 13:57:18 -07:00
Chris Wailes
9081d142cb Merge "rustc-1.71.0 Build 10534657" into main 2023-07-24 19:21:11 +00:00
Treehugger Robot
8db771d201 Merge "Allowlist hal_unit_tests and deps" into main 2023-07-24 17:53:27 +00:00
Kousik Kumar
6d1e348cc3 Disable RBE env variable when we cannot support RBE
Enabling the RBE variable can cause issues around pool parallelism when
we set the env variable, but don' run the build with RBE due to auth issues.
So, I am explicitly unsetting the variables in those cases.

Bug: b/292224253
Tested: https://b.corp.google.com/issues/292224253#comment26
Change-Id: I19718b4ee6c058ba1b11d3df260421bbf8c9567e
2023-07-24 17:06:42 +00:00
Liz Kammer
5f5dbaad65 Handle xsd config more like other partitions
This is prep work to add additional special handling for genrule
generated headers as there will be similar partitioning for those
headers.

Test: go test soong tests
Change-Id: Ib63e7e4f7554b2b7b7bc78b2825b20c05403216a
2023-07-24 13:01:22 -04:00
Ivan Lozano
f23db44fc8 Merge "rust: Enable Product support for dylibs." into main 2023-07-24 14:59:45 +00:00
Romain Jobredeaux
8505190672 Merge "Allowlist ModuleMetadata" into main 2023-07-24 14:48:28 +00:00
Treehugger Robot
ed89d33fb1 Merge changes I69f80d12,I40d48644 into main
* changes:
  Merge META-INF/services/* files in merge_zips -jar
  Strip META-INF/services from implementation jars when using as header jars
2023-07-24 14:27:25 +00:00
Cole Faust
1c535124d5 Merge "Revert "Add workaround for a file with an mtime in the future"" into main 2023-07-22 04:01:59 +00:00
Spandan Das
651203de35 Make libtest_* deps explicit in BUILD files
This is currently implicitly added by the cc_test macro. This can cause
duplicate issues if users write a BUILD file as
```
cc_test (
  name = "mytest",
  deps = ["libgtest"],
)
```
Making this dep explicit in BUILD files prevents this issue.

The property `gtest` will not be removed as part of this CL. cc_test
macro will use this property to add some gtest specific copts

Test: unit tests
Bug: 249374572
Change-Id: Ife931e26367fd4aab302bedc709cf907e2c01245
2023-07-21 23:04:32 +00:00
Dan Albert
460fb2d6d5 Merge "Remove libandroid_support support." into main 2023-07-21 21:06:41 +00:00
Treehugger Robot
cc8c8e5f8d Merge "Allowlist additional deps of inputflinger" into main 2023-07-21 21:03:39 +00:00
Zi Wang
8348ce92f5 Merge "java_test macro needs srcs and deps to create .jar for tradefed_test_suite" into main 2023-07-21 20:48:13 +00:00
Treehugger Robot
8b8846ae1c Merge "Add aconfig flags and a generic generated library plugin module for cc" into main 2023-07-21 19:09:28 +00:00
Romain Jobredeaux
66b27cb853 Merge "Add DeviceAbi to product variable to build setting export" into main 2023-07-21 18:40:17 +00:00
Cole Faust
d95158ef1a Merge "Denylist genrules that fail to build with sandboxing" into main 2023-07-21 18:20:06 +00:00
Ivan Lozano
5b55c2f366 rust: Enable Product support for dylibs.
There is no longer a reason to restrict dylibs on product, make them
available.

Bug: 204303985
Test: m
Change-Id: I315d22307f64d02633940f30ae600c63f16f0e7a
2023-07-21 14:02:21 -04:00
Spandan Das
0766b4fe52 Allowlist hal_unit_tests and deps
`hal_unit_tests` is a host cc test.

Bug: 291654541
Test: b test //system/chre:hal_unit_tests
Change-Id: I1e5cbdc42a06186dc522cf53b3b2a3695147e5de
2023-07-21 17:25:31 +00:00
Joe Onorato
37f900ca7f Add aconfig flags and a generic generated library plugin module for cc
The generated module lets us keep the aconfig code in its own pacakge
and not infect all of the cc package with aconfig. It's also closer
to what bazel is going to do

Bug: 283479529
Test: m aconfig_hello_world_cc && adb push $TOP/out/target/product/panther/system/bin/aconfig_hello_world_cc /system/bin && adb shell aconfig_hello_world_cc
Change-Id: I2fb9e419939c7ca77b111da9c376af077e2348a9
2023-07-21 09:04:42 -07:00
Treehugger Robot
e4d58523b6 Merge "Ignore some new files added to partition images in sbom_test.sh." into main 2023-07-21 14:34:44 +00:00
Treehugger Robot
8bad43ad53 Merge "Track transitive usage of aconfig flags and add LOCAL_ACONFIG_FILES to Android-<product>.mk" into main 2023-07-21 14:34:44 +00:00