Commit graph

876 commits

Author SHA1 Message Date
Spandan Das
ff8fb5c6cc Merge "Write the list of ndk libraries to cc_toolchain/ndk_libs.bzl" into main 2023-09-08 17:11:06 +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
Liz Kammer
33dddf5a7e Do not convert resource dirs without resources
Previously we would convert to java_resources when there were no
resources and get an error.

Test: b build //external/libphonenumber/... --config=android
Change-Id: I86f30b993a3ffdb20000f6a4c5261e2c4c74263c
2023-09-08 09:44:00 -04:00
Liz Kammer
65942c8467 Do not convert java libraries with core_platform
Test: go bp2build tests
Change-Id: I2769c0d589c304caeb24a8ecba38a4a5ee6c63e5
2023-09-08 09:43:57 -04: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
3f0aa4d618 Merge "bp2build: block src == name for prebuilt_* modules" into main 2023-09-07 19:41:04 +00:00
Treehugger Robot
ce0b67c101 Merge "Remove multi-tree unit test" into main 2023-09-07 17:47:26 +00:00
Liz Kammer
d5d12d028b bp2build: block src == name for prebuilt_* modules
src == name causes circular dependency errors, instead mark these as
unconverted and don't create modules for them.

Test: m bp2build and verify boringssl_self_test.zygote64.rc unconverted
Change-Id: I5d5fdd7e14830cd685816064cd0377998d07293c
2023-09-07 12:26:22 -04:00
Spandan Das
f7bae9ab3e Fix bp2build's stub/impl selection logic for platform variants
For a dependency edge A --> B (stublib), Soong will link A's platform
variant against impl of B's platform variant if either of these are true
1. A and B have same apex_available
2. B has bootstrap: true
3. B is only available to platform

(3) was missing from bp2build. This CL adds that.

To implement this, we check the `apex_available` property of B.

Test: updated bp2build tests
Test: Built the internal module b/299191635 that was failing due to this
Bug: 299191635
Change-Id: Iafb173a3ab20d69b89f7949ce40c6f4096396f24
2023-09-06 22:15:13 +00:00
Spandan Das
8483f730c9 Remove multi-tree unit test
This was likely missed in aosp/2630914 because this file was never added
in testSrcs of soong-bp2build

Test: go test ./bp2build
Bug: 284029211
Change-Id: I715f6ca17ccc2fbee1b6dcb43fd5a78d1b7380b7
2023-09-06 21:28:25 +00:00
Cole Faust
999881376b Merge "Delete ApiBp2build soong_build mode" into main 2023-09-06 18:04:25 +00:00
Spandan Das
6f45900389 Merge "Add target_compatible_with for compile_multilib" into main 2023-09-06 03:29:26 +00:00
Treehugger Robot
67d495fd04 Merge "Set device_platform build setting" into main 2023-09-06 02:44:38 +00:00
Spandan Das
e1cb14b240 Add target_compatible_with for compile_multilib
For explicit values of compile_multilib (e.g. 32 or 64), add an
incompatibilty constraint for the arches that do not have the correct
bitness.

Test: go test ./bp2build
Bug: 299135307
Change-Id: I4cd997de6804a5c6d89086d740f773936db1cab9
2023-09-06 00:31:00 +00:00
Chris Parsons
73f411b72c Delete ApiBp2build soong_build mode
This feature is obsolete.

This makes a large number of codepaths "dead code" (such as
module-specific implementations of ApiBp2build functionality). These
will be deleted in a followup CL.

Bug: 284029211
Test: Presubmits
Change-Id: Ib53b99f1fe8c24380d219caf44e9bb3b96724fa0
2023-09-05 17:09:51 -07: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
267dd3bea7 Merge "Support include/exclude paths for memtag_heap." into main 2023-09-05 17:42:15 +00:00
Liz Kammer
3ec36ada2c Merge "Add rust bp2build tests to soong tests" into main 2023-09-05 17:29:16 +00:00
Spandan Das
ab29f57ce6 Fix target_compatible_with non-determinism for proto.include_dirs
A single proto providing directory can be used by multiple soong modules. Some of these
can be
1. Host specific
2. Device specific
3. Both host and device

Since the generated proto_library can have 1:many mapping, it should
have an empty target_compatible_with. Compatiblity will be enforced at
the top-level {cc|java|python}_proto_library.

(This is a followup to aosp/2727054 which did not handle this correctly)

Test: Added a unit test

Change-Id: I09b3def70e3d043fd8ba0d1eb4ffff1910f097d1
2023-09-01 21:30:29 +00:00
Liz Kammer
267f1f71b5 Add rust bp2build tests to soong tests
Test: m nothing
Change-Id: I19a11cc2055725bfa5dfea5dd5215c18ffec3a21
2023-09-01 12:08:19 -04: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
Romain Jobredeaux
765beb237a Merge "Bp2build support for app R8-related fields" into main 2023-08-31 18:54:49 +00:00
Romain Jobredeaux
9973ace1c7 Bp2build support for app R8-related fields
Bug: 293304784
Test: CI
Change-Id: I0aefa57f968cb41e50d7c1d29b2d8a1480655355
2023-08-31 01:35:44 -04:00
Treehugger Robot
8d7f2e41d1 Merge "Fix false pos in bp2build-prog due to prebulits" into main 2023-08-30 18:27:32 +00:00
Yu Liu
698c8f63e0 Merge "Support memtag sanitizer." into main 2023-08-30 17:22:59 +00:00
Liz Kammer
02914408de Add do not convert for sdk_version unset
When sdk_version is unset, the build with fail with Bazel because
private APIs are do not build with Bazel at this time.

This instead prevents migrating the relevant target to Bazel in bp2build

Test: go tests
Change-Id: I31dabcf143de7933706d1b734ef21467a01b65e9
2023-08-29 20:06:48 -04:00
Yu Liu
7ece4aae36 Support memtag sanitizer.
Bug: 295173102
Test: local unit tests
Change-Id: Ib8cd82cd3989d9c120255e149473d8ec00f100f5
2023-08-28 17:14:58 -07:00
Spandan Das
f26ee15e01 Bugfixes for proto_library (proto.include_dirs)
The fixes are
- Dedupe the dir list. Since we partition the proto srcs per pacakge and
  then iterate the map, a single include directory was being listed
  multiple times
- Drop target_compatible_with from these proto_library targets. The
  compatibility will be enforced at the top-level <lang>_proto_library.

Test: Added a unit test

Change-Id: Ia18c0f8c495585010fd4e372092afe80c5d8290c
2023-08-28 18:39:59 +00:00
Treehugger Robot
7eb6ffc796 Merge changes from topic "java-proto-include-dir" into main
* changes:
  Handle proto.include_dirs for java
  Translate python_libray.pkg_path to proto.import_prefix
2023-08-28 17:18:29 +00:00
Alix Espino
5dbb696c53 Merge "support for multiple filegroups and resource_dirs" into main 2023-08-28 17:10:13 +00:00
Vinh Tran
0c4b9ec5e0 Implement bp2build converter for rust_protobuf_host
Test: go test
Bug: 295925256
Change-Id: I43b7359da8fc19f4338e2583448b7617194df5e6
2023-08-25 18:00:33 -04:00
Vinh Tran
093a57edb2 Implement bp2build converter for rust_binary
Test: go test
Bug: 295910295
Change-Id: Ieb18d9071f28e53a0463614594cee0fd755b7b3c
2023-08-25 17:58:53 -04:00
Vinh Tran
9b84678faf Convert libprotobuf to Bazel
Since this is a one-off just for building libprotobuf that will be removed when we handle cargo output more generically (b/297364081), I didn't write a unit test for this CL.

Test: b build //external/rust/crates/protobuf:libprotobuf
Bug: 295925256
Change-Id: I00cf44d54be27a09c184a96c13b250a2e54e2d10
2023-08-25 17:53:37 -04:00
Vinh Tran
b4bb20f583 Implement bp2build converter for rust_proc_macro
Test: WIP
Bug: 297356482
Change-Id: I17d1a0a95d4a67ccbc9b2d74e49bcacd6ff4d26b
2023-08-25 17:50:48 -04:00
Liz Kammer
32c634bca9 Fix false pos in bp2build-prog due to prebulits
The prebuilt_ prefix was removed before writing converted modules, which
causes false positives when a prebuilt and from source module exist with
the same name but only one has been converted

Test: b run //build/bazel/scripts/bp2build_progress:bp2build_progress \
    -- report -m core-lambda-stubs-for-system-modules
Change-Id: Id00099780fb6af9fffcf745b509116a66bac8756
2023-08-25 17:42:42 -04:00
Vinh Tran
bcb5f57eed Implement bp2build converter for rust_library
Test: go test
Bug: 297294749
Change-Id: I5400fe2c0fe2097b7a5810c736fbd1de4f35c6f7
2023-08-25 17:42:13 -04:00
Alix
289e9c607b support for multiple filegroups and resource_dirs
Test: tests in bp2build and b build //external/emma:emma

Change-Id: I57e60389aec926c55d01818a6a3b1ec33e9c53b8
2023-08-25 16:12:15 +00:00
Spandan Das
234bb3bd8d Merge changes from topic "proto-include-dir-py" into main
* changes:
  Handle proto.include_dirs in bp2build for py
  Add proto.local_include_dirs support in bp2build
  Add manual tag to proto_library at the root package
2023-08-24 20:57:47 +00:00
Spandan Das
cb847638af Translate python_libray.pkg_path to proto.import_prefix
If a python_library uses a pkg_path foo/bar, then the proto srcs in
that libray need to import the dep .proto as foo/bar/proto.proto.

This behavior is restricted to python modules. To implement this is in
bp2build, this CL creates a new interface with a single method
`PkgPath`. Only python module structs implement this interface, and
this method is only available during bp2build

Test: Added a bp2build unit test
Test: TH

Change-Id: If8d207c0b321f75337a053795826b283a5eaaf46
2023-08-24 19:21:10 +00:00
Spandan Das
4e5a194b90 Add proto.local_include_dirs support in bp2build
This is a followup to aosp/2711093 which added support for
proto.include_dirs. local_include_dirs is simlar, except that is
relative to the module directory.

Test: go test ./bp2build
Bug: 285140726
Change-Id: I32ddc7371048672d6935f827c8aee9d767305e2c
2023-08-24 19:00:12 +00:00
Spandan Das
e0f2ed56a0 Add manual tag to proto_library at the root package
This is a fix similar to aosp/2707793. This adds manual tags to the
top-level proto_library created in the root package, plus any
dynamically created proto_library targets for proto.include_dirs. These
proto_library targets might not specify their deps correctly and might
be unbuildable.

(We need to keep these targets because they provide a ProtoInfo for
cc/java/py source gen)

Test: go test ./bp2build
Change-Id: Ic00f05186327fcfcc8d33a0a2c0891ed619b7acb
2023-08-24 19:00:11 +00:00
Jason Wu
66de6c445f Merge "bp2build converter for sh_test followup" into main 2023-08-24 15:19:28 +00:00
Vinh Tran
80f6b2147f Export RustDefaultVersion to Bazel
The config constant is consumed by rust toolchain implemented in aosp/2709668.

Bug: 295918553
Test: go test
Change-Id: I0a28a802ad28f6ee24dfb1b5bdab72094534ae04
2023-08-23 22:55:40 -04:00
Jooyung Han
138ee09e28 Merge changes from topic "deprecate-zip-apex" into main
* changes:
  apex: Remove host support
  apex: Remove apexPackagingMutator
  apex: Remove 'zip' apex support
2023-08-23 23:48:43 +00:00
Jooyung Han
8d4a1f03b0 apex: Remove host support
Since we no longer support "zip" APEX, we don't need "host" support.

For example, we don't need go/python binary support.

Bug: 279835185
Test: m
Change-Id: I6e8d2b205e42662f31866dc9ac7507524effd144
2023-08-23 14:01:21 +09:00
Jason Wu
6d8d44af24 bp2build converter for sh_test followup
Test: m nothing
Bug: 283486885
Change-Id: Ib8229e75dfcd9fd251fb1a83485cf5f88bdc3afb
2023-08-22 23:07:33 -04:00
Yu Liu
d136a6aa01 Support dynamic config file for cc_test.
Bug: 280028705
Test: local build
Change-Id: Ife445f6a7642bf08651ed7a9501a60950f05f9c4
2023-08-22 17:33:20 +00:00
Treehugger Robot
4147e5c1d1 Merge "Handle proto.include_dirs in bp2build for CC" into main 2023-08-21 20:43:02 +00:00
Yike Zhang
fd7870f231 Merge "Give cc_test rule information to determine the test types" into main 2023-08-18 17:28:05 +00:00
Treehugger Robot
c21f48def3 Merge "Fix replacements of namespace module srcs in genrule" into main 2023-08-18 02:10:13 +00:00