Commit graph

741 commits

Author SHA1 Message Date
Treehugger Robot
b8f50fde26 Merge "Move bazel environment variable list to bzl files" 2023-06-15 18:25:40 +00:00
Cole Faust
8a161be19b Move bazel environment variable list to bzl files
So that it's easier to maintain by being closer to the actual long-term
usage.

Bug: 279095899
Test: m nothing
Change-Id: I0b7cfa2eeb48595dd3081b458bbd1156ec2184a3
2023-06-14 15:45:12 -07:00
Trevor Radcliffe
cbaa0d6eb9 Merge "Bp2build Sanitizer Blocklist" 2023-06-14 18:05:30 +00:00
Vinh Tran
21bfa5816d Revert "Revert "Revert "Add aidl.deps prop to include aidl implicit deps explicitly in Android.bp"""
This reverts commit e3e7711ac6.

Reason for revert: CI fixed

Change-Id: Ib038241eae5ec6af78ac24105c891db55a4d0544
2023-06-14 12:24:17 +00:00
Trevor Radcliffe
ded095ce45 Bp2build Sanitizer Blocklist
Bug: 286894426
Test: Unit tests
Change-Id: I382e028410a185a5017dba1fc47c83ad5b2432cf
2023-06-13 20:46:27 +00:00
Sam Delmerico
5840afc469 add documentation to Bp2buildTestCase
Change-Id: I8a635ce2ac4d6ad9e84fb447e1cb06d53f380641
2023-06-13 13:32:41 +00:00
Vinh Tran
5244c1a19f Merge "Revert "Add aidl.deps prop to include aidl implicit deps explicitly in Android.bp"" 2023-06-12 15:18:16 +00:00
Yu Liu
86c7300bf3 Merge "bp2build data property -> data attr in gensrcs" 2023-06-10 03:54:11 +00:00
Liz Kammer
8bd92429e5 bp2build data property -> data attr in gensrcs
Test: go test bp2build tests
Change-Id: I2192cf9846a5783385397337d40cca85a1ef73e7
2023-06-09 15:37:45 -04: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
Vinh Tran
8106bd0b00 Revert "Add aidl.deps prop to include aidl implicit deps explicitly in Android.bp"
This reverts commit 2562585878.

Reason for revert: We now have aidl_library to remove this workaround to support specifying aidl headers

Change-Id: Idf03ebbea764f8c5b3c4fc1623f8f02aa321c8c1
2023-06-08 23:29:18 +00:00
Treehugger Robot
f253d23e95 Merge changes from topic "cc_stem"
* changes:
  Remove modules from denylist
  Update runpath for jni libs
  bp2build support for stem
2023-06-08 22:38:34 +00:00
Treehugger Robot
ca69a6fc21 Merge "Revert "Remove --noexperimental_platform_in_output_dir"" 2023-06-08 12:10:14 +00: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
Treehugger Robot
731c4525ca Merge "Remove --noexperimental_platform_in_output_dir" 2023-06-08 06:08:14 +00:00
Treehugger Robot
226354ab1d Merge "add apex_available_name variant_version to bp2build unit tests" 2023-06-07 19:40:55 +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
Sam Delmerico
e860d1429e add apex_available_name variant_version to bp2build unit tests
Bug: 285138555
Test: go test ./bp2build
Change-Id: Ide31e7f651b11857afc4570a891fb94460d8ea54
2023-06-06 15:47:30 -04:00
Jihoon Kang
346a117921 Create bp2build converter for platform_compat_config module type
This change adds bp2build converter for platform_compat_config module
type and its corresponding test case.

Bug: 269202028
Test: bp2build unit tests
Change-Id: I17d560c8f0e725efe69e151685d003c3dcb11f2f
2023-06-06 19:35:36 +00:00
Treehugger Robot
aefd27fce6 Merge "Correct genrule path references" 2023-06-06 14:59:16 +00:00
Spandan Das
5dba0ec98c Update runpath for jni libs
To support stem, cc libraries will be generated in
<pacakge_name>/<label.name>. Update RUNPATH of java binaries so that it
can find its jni deps

Test: bp2build
Test: TH
Bug: 240563612
Change-Id: Ia2f70f0424a8526ee35856225c1a8cd1067a8570
2023-06-06 00:07:40 +00:00
Spandan Das
39ccf93c65 bp2build support for stem
By default, the artifacts generated by cc_binary and cc_library in Soong
track the module name. But Soong supports overidding this using the stem
property. e.g.
```
cc_library {
  name: "foo.1.2",
  stem: "foo",
}
```
will generate foo.so

This CL adds this property to bp2build

Test: bp2build unit tests
Bug: 240563612
Change-Id: I1dfed870d5bad450511b72c397d2355c01fa3b60
2023-06-06 00:07:37 +00:00
Trevor Radcliffe
27669c0c9e CFI Bp2Build
Bug: 261733820
Test: Unit Tests and manual verification
Change-Id: Ife1b33c58e3770177eab1b6168edbf7969418ad7
2023-06-05 18:08:07 +00:00
Liz Kammer
1e75324ebd Correct genrule path references
Test: b build `bmod robolectric_tzdata`
Test: go test bp2build tests
Change-Id: I98333f2b9f480019ddca11944b455d484a47cf8e
2023-06-02 19:09:35 -04:00
Zi Wang
4af4ff33f0 Merge "Add simple bp2build converter for java_test_host" 2023-06-01 22:37:28 +00:00
Zi Wang
65b36729c3 Add simple bp2build converter for java_test_host
Bug:281551424

Test: java_test_host_conversion_test.go and presubmits
Change-Id: I43ed26df0bacd63ef402de4d9733d19604005c35
2023-06-01 10:37:09 -07:00
Spandan Das
02e8a0dba1 Merge "Deprecate api bp2build of ndk_library and ndk_headers" 2023-05-31 16:01:07 +00:00
Spandan Das
230c312f83 Deprecate api bp2build of ndk_library and ndk_headers
To support export of NDK APIs in multi-tree, we added functionality to
generate Bazel targets of ndk related Soong module types. Since this use
case does not exist anymore, deprecate this to prevent bitrot

The removed code includes
- `ConvertWithApi2Build` implementation of these libraries, which
  generates the Bazel targets in the synthetic `api_bp2build` workspace
- (api) bp2build unit tests for these module types

Test: go build ./cc
Bug: 284029211
Change-Id: Id3278fa119e0ab87f31f39a3783197a81b655e43
2023-05-31 03:44:51 +00: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
Alix Espino
e5641c51b9 Merge "bp2build java_resources that only contain a filegroup" 2023-05-26 13:59:42 +00:00
Alix
b29a3cd2aa bp2build java_resources that only contain a filegroup
supports filegroup that specifies path property

Bug: 280860624
Test: built libauto_value_plugin
Change-Id: I9ed0b13e055beb92ba8090f6b5e88b9873c9ce61
2023-05-24 18:21:15 +00:00
liulvping
4d11d10ce2 build: Fix bp2build panic issue
panic in top down mutator "bp2build_conversion_bp2build"
for module "foo".
reflect: call of reflect.Value.NumField on interface Value

Test: go test ./bp2build
Change-Id: I9ee460ca38a37c6a6c1a0787159fa5f38b852b55
2023-05-24 06:38:58 +00:00
Trevor Radcliffe
f06dd91420 CFI Versionscript changes in bp2build
Bug: 261733820
Test: Unit Tests
Change-Id: I0bf2f42944738c0fefb10e59e859d2af44402792
2023-05-19 14:51:41 +00:00
Treehugger Robot
3daa129afa Merge changes from topic "adbd_host"
* changes:
  Allowlist python dependency of adb targets
  bp2build support for host_ldlibs
2023-05-17 05:23:21 +00:00
Spandan Das
fb04c41299 bp2build support for host_ldlibs
host_ldlibs are used during linking. Set these in `linkopts` for now.

Note that this CL does not do the `CheckBadHostLdLibs` validation of
Soong. There are some different ways to do this, and these are being
discussed in b/216626461. It is likely that we will need to create a new
property `host_ldlibs` to do the validation. But for now, re-use
`linkopts`.

Bug: 216626461
Test: bp2build unit tests
Change-Id: Id4c77e4460fb1fb003fa58ea27bab5b50ea8cefe
2023-05-16 22:44:37 +00:00
Vinh Tran
e684294fb2 Pass includes attrs to cc_aidl_library
https://source.android.com/docs/core/architecture/aidl/aidl-backends#custom-parcelables

Some aidl files have custom parcelables with references to cpp headers. Hence, we need to pass the include dirs from cc libs to cc_aidl_library so that custom cpp headers are findable by the generated cpp/h files.

Test: go test
Bug: 278704136
Change-Id: I4ede1d23fbc04bdbfb69823d955c6df6b0a7b4ee
2023-05-16 16:08:15 -04:00
Trevor Radcliffe
735013943a Merge "Change bp2build to reflect arm_isa refactor" 2023-05-16 19:41:08 +00:00
Vinh Tran
5e7011bc14 Merge "Use aidl_library in cc libraries" 2023-05-16 14:44:54 +00:00
Spandan Das
29c8ad3821 Merge "bp2build converter for cc libraries containing yacc" 2023-05-16 02:48:53 +00:00
Vinh Tran
367d89da78 Use aidl_library in cc libraries
Introduce aidl.libs prop on cc libraries to pass in aidl_library. The goal is to eventually disallow aidl.include_dirs (a pattern for passing aidl headers dir for aidl compilation) and enforce aidl headers to be explicitly specified in Android.bp.

Bug: 278704136
Test: go test
Change-Id: Ia78bc11dfa12f47d2d1bb90dc65372ddb17f7e14
2023-05-15 17:09:22 -04:00
Trevor Radcliffe
5f0c2ac535 Change bp2build to reflect arm_isa refactor
We now rely on a `with_features` clause to effectively disable
thumb when `arm_isa_arm` is enabled. Thus, we no longer need to
add `-arm_isa_thumb` in bp2build.

Bug: 261733820
Test: Unit tests
Change-Id: I9da85834855b297a75097ce3a11e101f55bd53f4
2023-05-15 18:00:59 +00:00
Vinh Tran
e8b63fddf9 Merge "Implement bp2build converter for aidl_library" 2023-05-11 20:08:16 +00:00
Vinh Tran
3d16990b29 Implement bp2build converter for aidl_library
Test: go test
Bug: 278704136
Change-Id: Ia9c3772257af58e1de9041ba465130740b555fe4
2023-05-11 11:39:43 -04:00
Spandan Das
df4c2134ea bp2build converter for cc libraries containing yacc
For cc_libraries containing .y/.yy srcs, we will generate an additional
cc_yacc_static_library target. This target will produce an .a file that
will be statically linked to the parent target.

Test: go test ./bp2build
Bug: 281546029
Change-Id: I094ba56f0a95869e5bc1e1d38b83c777192b7ddd
2023-05-11 01:11:56 +00:00
Spandan Das
494fca1328 Merge changes from topic "stub-impl-per-api-domain"
* changes:
  Special case platform variant of bootstrap libs
  Select stub/impl per apex variant
  For test apexes, base_apex_name is the api domain
  Broaden the granularity of config_setting from apex_name to api_domain
  Print default val if all vals in axis match default val
2023-05-11 00:13:44 +00:00
Cole Faust
069812158f Merge "Bp2build support for soong config variables + os" 2023-05-10 21:28:02 +00:00
Treehugger Robot
26446238d6 Merge "Don't translate "required" to unsupported "data" in android_app." 2023-05-10 18:14:52 +00:00
Wei Li
2c9e8d6128 Change bp2build converter of module "package".
1) Use attribute name "default_package_metadata" instead of
   "default_applicable_licenses" in packages to better describe its use.
2) Add a filegroup "default_metadata_file" in packages to search for
   METADATA file in each package.
3) Include "default_metadata_file" in each package's
   "default_package_metadata" attribute.

Bug: 275472038
Test: CIs
Change-Id: I645c013c39e3190fd96c4a549d39a331aced16bd
2023-05-09 17:37:04 -07:00
Romain Jobredeaux
56d41d0725 Don't translate "required" to unsupported "data" in android_app.
Bug: 228514588
Test: Presubmits
Change-Id: Ib964073d24f03cc3cdd389ba28b44ed96b61d841
2023-05-09 16:37:23 -04:00
Cole Faust
150f9a5a63 Bp2build support for soong config variables + os
For converting the art plugins to pure soong, it would be useful to
have a property that's qualified on both a soong config variable and
the OS. Soong had very little-known support for this by saying your
soong config variable changes the "target.android.cflags" property,
and we didn't supporting bp2building that. Add the bp2build support.

This cl also refactors product variable and soong variable bp2building
so that they're separate from each other, which I think makes the code
easier to understand.

Test: go test
Change-Id: Ic74dc75da8103fa2523da95c3560c9ce3c5e5672
2023-05-08 17:50:06 -07:00