Commit graph

44 commits

Author SHA1 Message Date
Cole Faust
11edf557b6 Add bazel-built modules as deps on the system image
These bazel-built modules will be installed into the system image
as part of the bazel rule, rather than going through the make staging
directory.

Bug: 297269187
Test: m bazel_sandwich
Change-Id: I96c6e58f8e0898b2ad92cb7069745ca2059a39f8
2023-10-18 15:21:14 -07:00
Yu Liu
eebb259356 Handle the case where the release value set is a list.
Bug: 304814040
Test: CI, unit test,
b build build/make/tools/aconfig:aconfig.test.cpp
b test build/make/tools/aconfig:AconfigJavaHostTest

Change-Id: I9ca939348a063c39e9528f24e788f9757458d30c
2023-10-13 16:45:51 -07:00
Cole Faust
6ed1e0fd59 Merge "AVB and selinux support in partitions" into main 2023-09-28 16:38:28 +00:00
Treehugger Robot
f51ed265e4 Merge "Make platform_mappings file deterministic" into main 2023-09-28 00:37:51 +00:00
Cole Faust
b5055394a9 AVB and selinux support in partitions
Bug: 297269187
Test: m bazel_sandwich (updated partition_inspector to show selinux contexts, but still haven't figured out how to show avb information)
Change-Id: I6911c2fc75495f9722887925d8609c9a171901c6
2023-09-27 14:14:14 -07:00
Cole Faust
e136ddac77 Make platform_mappings file deterministic
Fixes: 301473943
Test: presubmits
Change-Id: I24a1fef87c1fb59b5aeb8ac9c05306cddee32399
2023-09-27 14:14:01 -07:00
Romain Jobredeaux
9c06ef353b bp2build support for framework-res
Change-Id: I5b32a702e02b5f1ec08d5608d766a8a0c08d845c
Bug: 276928228
Bug: 297356405
2023-09-26 15:06:50 -04:00
Cole Faust
cb193ec471 Emit a system image target for the current product
This system image can be built with bazel instead of make.

Bug: 297269187
Test: m bazel_sandwich
Change-Id: I5fd61a28f664d8310435c3b7e5dbdd89a7ec6159
2023-09-22 14:42:33 -07:00
Cole Faust
747ecf4b1e Merge "Decouple the target build variant from the platform" into main 2023-09-21 21:18:47 +00:00
Romain Jobredeaux
2c11851598 Merge "Use raw {min,target}_sdk_version properties in android_app converter" into main 2023-09-21 20:58:16 +00:00
Cole Faust
f3cf34e096 Decouple the target build variant from the platform
Bug: 301334589
Test: Presubmits
Change-Id: Id8ac0874a2d132d9965e339fd8dc705a7434bffb
2023-09-20 17:08:30 -07: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
Romain Jobredeaux
3132f843f1 Use raw {min,target}_sdk_version properties in android_app converter
The logic of EffectiveVersionString is product-variable dependent and
is being implemented bazel-side in order to produce product agnostic
BUILD files. A required additional product variable is added to the
export list, and the "updatable" property of android_app is also bp2build-converted.
Handling of max sdk version was not correct (it does not affect
manifest values in Soong), so removing it for now.

Bug: 274474008
Bug: 274474002
Test: CI
Change-Id: I7a10bfabf914c8e86064b7ce61926701f87517e3
2023-09-18 10:02:35 -04:00
Yu Liu
e6153b54bc Merge "Support aconfig_declarations, aconfig_values and aconfig_value_set" into main 2023-09-15 16:46:01 +00:00
Cole Faust
6054cdf3b1 Generate android_certificate_directory
Previously, partners were required to add an
android_certificate_directory filegroup in their certificate
directories, and allowlist that BUILD file. Now, we generate the
filegroup automatically.

We're using a different name, generated_android_certificate_directory,
to avoid conflicts with already-checked-in filegroups.

Bug: 285777389
Test: b test //build/bazel/rules/apex/...
Change-Id: Ib1bde487acd79d58368faf0aad02ded0bcdaceb4
2023-09-12 15:23:36 -07: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
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
Spandan Das
3645a62f53 Write the list of ndk libraries to cc_toolchain/ndk_libs.bzl
Soong adds "--no-ndk" to cc stubs for apexes if the library is not an
NDK library. In order to port this logic, emit the list to a .bzl file.

We cannot use the exportedVars.Export* soong_injection api for this
since we need to visit all modules to get this list.

Test: m nothing
Bug: 299501496
Change-Id: If8487db85e08b32b9b40aef3371d9f3f7d5a77e0
2023-09-07 22:37:29 +00:00
Treehugger Robot
67d495fd04 Merge "Set device_platform build setting" into main 2023-09-06 02:44:38 +00:00
Cole Faust
48ce137e11 Set device_platform build setting
Fixes: 290716626
Test: b test //platform_testing/tests/example/native:hello_world_test
Change-Id: If397710e986ac1fa8b49aeb25b7342acd1eef482
2023-09-05 16:07:49 -07:00
Yu Liu
b6a15dacfc Support include/exclude paths for memtag_heap.
Bug: 295173102
Test: Unit tests and CI
Change-Id: I14faa645afc8e5b0454aafd4c259a2ea588e9ec9
2023-08-31 14:14:01 -07:00
Juan Yescas
0106560e34 soong: Add product variable DevicePageSizeAgnostic
The product variable DevicePageSizeAgnostic will determine
whether AOSP is kernel page size agnostic or not.

Test: source build/envsetup.sh
      lunch aosp_cf_arm64_phone_pgagnostic
      m
      cat out/soong/build.aosp_cf_arm64_phone_pgagnostic.ninja | grep __BIONIC_NO_PAGE_SIZE_MACRO
Bug: 289419664
Change-Id: I33a1a4f1967d7e78432b7b8d90357d16b2002dcc
2023-08-09 16:46:07 -07:00
Cole Faust
946d02cb80 Remove final usages of product_vars_providing_rule
Bug: 269577299
Test: Presubmits
Change-Id: Iad1df30ba2ff0256e56919411d98c1bd9f7fa5a7
2023-08-04 14:58:05 -07:00
Treehugger Robot
7d76e8cc9d Merge "Fix kernel build tools" into main 2023-08-04 17:15:10 +00:00
Cole Faust
d1acaa4169 Add a linux_86 config option
Test: b test --config=linux_x86 //build/bazel/rules/apex/...
Change-Id: I4b98935f8664b93162b28229134cf4b56603002b
2023-08-03 17:04:03 -07:00
Cole Faust
95c5cf88bd Fix kernel build tools
That build doesn't set platform_sdk_version.

Bug: 269577299
Test: ./prebuilts/kernel-build-tools/build-prebuilts.sh on the kernel-build-tools branch
Change-Id: I68eb33bfb80770cef9c3a9c5e01f1ed746a2d069
2023-08-03 13:49:27 -07:00
Cole Faust
87c0c33a65 Make bp2build-generated selects() based on product config build settings
...instead of based on constraint settings.

Bug: 269577299
Test: m nothing and ./build/bazel/ci/bp2build.sh
Change-Id: Ib9caec79c92b8fd304e46be841de5612bd1637e3
2023-08-03 10:12:09 -07:00
Cole Faust
bc65a3fea8 Revert^2 "Initial implementation of the bazel sandwich"
c13fad8181

Change-Id: I478562c8fd89e62983feb5b52b62aad851d40f00
2023-08-01 10:27:57 -07:00
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
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
Romain Jobredeaux
cc1b67631c Add DeviceAbi to product variable to build setting export
Change-Id: Ibcb9e77a28bf0c4c0915f7013a7408f65429ae15
2023-07-21 10:05:28 -04:00
Cole Faust
88c8efb18c Add CFI product config variables to platform_mappings
Bug: 269577299
Fixes: 283130542
Test: b test --config=android //build/bazel/rules/cc/...
Change-Id: I2fc4094167c48b1f3b22bee6b7ada309278f7250
2023-07-20 09:45:36 -07:00
Cole Faust
f8231dd0ea Platform mapping-based product config
This allows us to set product variables as build settings instead
of loading them from a target's provider, which further allows us
to read product config variables in transitions.

Bug: 287539062
Bug: 269577299
Test: Presubmits
Change-Id: I8497703f706162572ceb3486240e1eb02a37f5f6
2023-07-17 16:27:08 -07:00
Cole Faust
319abae1c7 Remove --noexperimental_platform_in_output_dir
This is a followup to aosp/2606989.

This flag is not necessary now that we're using one platform name
for all of mixed builds.

Also rename current_product to mixed_builds_product so that it's clear
that that this platform should only be used for mixed builds.

In addition, make the bazelrc files point to the named products again
instead of the mixed build product so that b builds will still have
qualified outputs, but mixed builds won't.

Test: Presubmit and kernel build tools abtd run
Change-Id: I7f764cf42cd1323f4b495d1320931f59a076ac63
2023-06-08 17:58:35 -07:00
Matthias Männich
08ccec7c11 Revert "Remove --noexperimental_platform_in_output_dir"
This reverts commit 24af24e0f2.

Reason for revert: Breaks kernel build tools build https://ci.android.com/builds/branches/aosp_kernel-build-tools/grid?head=10282004&tail=10282004

Change-Id: I486d7f305d44cfecc51a0e039cc41c0afa6495f3
2023-06-08 08:19:14 +00:00
Cole Faust
24af24e0f2 Remove --noexperimental_platform_in_output_dir
This is a followup to aosp/2606989.

This flag is not necessary now that we're using one platform name
for all of mixed builds.

Also rename current_product to mixed_builds_product so that it's clear
that that this platform should only be used for mixed builds.

In addition, make the bazelrc files point to the named products again
instead of the mixed build product so that b builds will still have
qualified outputs, but mixed builds won't.

Test: Presubmit
Change-Id: I5acbd18869589f67efb0ad3ebfda2c4d5a6a3850
2023-06-07 11:08:44 -07:00
Jingwen Chen
583ab219ea Create a "current_product" named platform.
This enables output paths of product agnostic targets (e.g. mainline
apex) to be identical when switching between target products, since the
product name is no longer embedded in:

1) the output path prefix in bazel-out
2) the PlatformOptions contribution to the configuration hash as part of a transition

Test: treehugger
Change-Id: I3fd0f7134209aa7eede3ed98412a1c5482689b57
2023-05-30 15:40:18 +00:00
Romain Jobredeaux
1a3382c0c2 Delete platform mapping specific bp2build code
Bug: 249685973
Test: Presubmits
Change-Id: Ib76a7659dfe57731100550c2cff4de960be2f1d7
2023-04-13 18:48:00 -04:00
Cole Faust
117bb747a4 Move the testing platforms out of soong_injection
See the other cl in this topic for more information.

Bug: 269577299
Test: b test --config=android //build/bazel/rules/apex:all
Change-Id: I1f20bc5f85398cd79dc5b7fe9d0bd4d93d442383
2023-03-29 14:46:20 -07:00
Cole Faust
ebc01a3225 Add testing android products
These must be added in the soong_injection code as opposed to just
defined loosely in checked-in bzl files because the product_vars
select statement must be updated to support the new platforms.

Bug: 269577299
Test: b test --config=android //build/bazel/...
Change-Id: I7bba9af214896dd3b5938bae70b7c0cea4f75e41
2023-03-28 11:27:30 -07:00
Cole Faust
bd249821b9 Rename utils.bzl to android_product.bzl
Bug: 269577299
Test: b build --config=android `bmod com.android.adbd`
Change-Id: I93743a058a4f700e015cdd1c51544467a29d4fe6
2023-03-24 16:03:43 -07:00
Cole Faust
c167d0f1d6 Add --config alias for musl host platform
Test: b build --config=linux_musl_x86_64 //build/bazel/examples/python/protobuf/...
Change-Id: Id665660ee7fe123d74ad78d42eb26d4a65e64a60
2023-01-23 10:17:21 -08: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