Commit graph

1020 commits

Author SHA1 Message Date
Liz Kammer
e11182283f Revert "Don't use java_library for java_import neverlink"
Revert submission 2786699-import-sdk-version-none

Reason for revert: b/306220520

Reverted changes: /q/submissionid:2786699-import-sdk-version-none

Change-Id: I4fbe5fa54dc11fac898a7f15704833f01b9fa269
2023-10-18 20:38:37 +00:00
Liz Kammer
4e00b0929b Don't use java_library for java_import neverlink
Restricting use of sdk_version = "none" to only the rule types that will
correctly handled sdk_version = "none" by also handling system_module
attr

Test: CI && go tests
Change-Id: Ifa1c60ba8f5e3fcb28986cc84cdfaedcbd2d2957
2023-10-17 09:10:13 -04:00
Vinh Tran
59aa97a594 Merge "Remove restriction on android config in generated rust_library targets" into main 2023-10-16 19:08:35 +00:00
Yu Liu
f613da45db Merge "Handle the case where the release value set is a list." into main 2023-10-14 03:27:30 +00: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
Yu Liu
873ad35f87 Allowlist fake_device_config in order to build some java_aconfig_library for host.
Bug: 305255550
Test: CI
Change-Id: Ic073a5fef0acccb7fcbbacb93c9f42ea80e8e154
2023-10-13 20:50:56 +00:00
Vinh Tran
fb8c5a54ea Remove restriction on android config in generated rust_library targets
Bug: b/290790800
Test: b build //external/rust/crates/... --config=android
Change-Id: Id06dc94f8bff519c09de7a0de0f1999cf310f599
2023-10-13 11:51:18 -04:00
Liz Kammer
b5c3b018d9 Merge "Handle java_resources as deps" into main 2023-10-12 21:10:37 +00:00
Liz Kammer
c723757dd7 Merge "Change openjdk9 specific props in bp2build/Soong" into main 2023-10-12 19:47:38 +00:00
Zi Wang
7d54b3a5d8 Fix TestPrebuiltRootHostWithWildCardInSrc
Test: CI
Change-Id: Ia39ac3217fa827fec4c6e572e49c49c15e126109
2023-10-12 10:25:31 -07:00
Zi Wang
7c81b2b245 Merge "Support prebuilt_root_host in bp2build" into main 2023-10-12 17:10:21 +00:00
Liz Kammer
93b7e9545e Handle java_resources as deps
Test: CI && unit tests
Change-Id: I51f3c7d876c3cc25cb0459d933e1a510cfb5bf13
2023-10-12 09:57:06 -04:00
Liz Kammer
9f52f6ba60 Change openjdk9 specific props in bp2build/Soong
JDK17 is the default java version, adding these props conditionally
openjdk9 is no longer relevant

Test: CI
Change-Id: I5d80fd22f474cedf389d1e295620cfc17bc327a0
2023-10-12 09:57:04 -04:00
Jingwen Chen
a4c330e076 Merge "Move platform constraints to bazel_common_rules." into main 2023-10-12 02:22:26 +00:00
Alix
42d7ac96bc TestJavaHostGeneral Fix
This fixes "expected 2 bazel modules in "." but did not find any"
error that the test was getting.

Test: got test ./bp2build
Change-Id: I376c7c9974d301fc85894ecf2b0838c863a74a47
2023-10-11 22:39:27 +00:00
Zi Wang
040541496a Support prebuilt_root_host in bp2build
Also fix a bug that filename string may contain wild card

Test: Added unittest and CI

Bug: 303725325
Bug: 304590341
Change-Id: I5de9c195343328981a4154024c0fe4e14969ce79
2023-10-11 12:16:26 -07:00
Christopher Parsons
c27e8f1427 Merge "Turn on bp2build_deps by default" into main 2023-10-11 15:18:18 +00:00
Jingwen Chen
9c2e3ee54a Move platform constraints to bazel_common_rules.
This enables sharing of platform constraints between platform and kernel builds.

Bug: 304594734

Test: treehugger
Change-Id: I48091eeaf2e529c3f180ba056da3935911868b14
2023-10-11 12:07:44 +00:00
Jason Wu
25c69eec45 Update sh_test conversion to handle data_bins and test_configs properly
sh_test.data_bins are used to mark special executable dependencies which should be installed alongside the test entry point's cwd as siblings. This change makes it such that the Tradefed rule places them at the expected location. In addition, this change also incorporates the `tradefed.TestConfigAttributes` to handle the test_configs conversions.

Test: bp2build.sh
Bug: 283486885
Change-Id: Ifeb049c13ae208c785dbdc858f589be8f21109d1
2023-10-10 14:03:19 -04:00
Zi Wang
57e60bf82b Merge "Use correct module name for java_import in shouldConvertWithBp2build verification" into main 2023-10-10 05:19:10 +00:00
Chris Parsons
d43be7c704 Turn on bp2build_deps by default
This prevents bp2buld conversion of modules which have transitive deps
that are not converted.

This does not change most allowlist semantics -- that change is still to
come. As a result, this effectively removes conversion of a few modules
which were previously converted under old semantics, however, these
modules are not currently used in any meaningful bazel builds, and will
be fixed at a later time.

Test: bp2build.sh
Test: m nothing
Test: manually spotchecked allowlisted modules in metrics to ensure the
diffs were minor
Test: manually verified bp2build performance regresses by about 0.4s

Change-Id: Id5c44fa5394917b28a3e707a81555b9e467d6621
2023-10-10 03:20:16 +00:00
Treehugger Robot
6525ee82d7 Merge "Revert "Do not convert non-unit tests."" into main 2023-10-10 02:22:14 +00:00
Zi Wang
734266b633 Use correct module name for java_import in shouldConvertWithBp2build verification
This change makes sure that prebuilt module has correct module name
prefix("prebuilt_") inside method shouldConvertWithBp2build, to avoid
the bp2build conflict issue when a normal module and a prebuilt module
with the same name are both allowlisted.

Test: CI, added unit tests and the steps to reproduce in b/303376793

Bug: 303376793
Bug: 303868211
Change-Id: I4f1126182ec1f52ae6a08046a77204939230edef
2023-10-09 16:51:35 -07:00
Jingwen Chen
6e119745b8 Revert "Do not convert non-unit tests."
This reverts commit 80b54d2502.

Reason for revert: caused hello_world_test to not be converted, but it's a test that builds/passes

Bug: 300117121

Change-Id: I805cfb336b7f58a5a1e295cade16be4c471e2ed5
2023-10-09 23:21:54 +00:00
Spandan Das
17a27f0c14 Replace ndk_libs.bzl with an attr in cc_stub_suite
(This CL is a cleanup, and should be a no-op)

Currently we support three variations of cc api stubs.
1. publicapi stubs, i.e. ndk stubs (empty additional args to ndkstubgen)
2. module-libapi stubs that are also an ndk library (--systemapi --apex)
3. module-libapi stubs that are not an ndk library (--systemapi --apex
   --no-ndk)

ndk_libs.bzl was used to differentiate between (2) and (3). This creates
an additional layer of indirection - users will need to modify this
external .bzl file if they would like to add a library to an ndk.

Replace this with an explicit atttibute in cc_stub_suite macro for better UX.

Test: go test ./bp2build
Test: b test //build/bazel/rules/cc:cc_stub_library_tests (added in
sibling CL)
Bug: 299501496

Change-Id: Idd3579e8013bae7a1740534f90d2767df5bac1a5
2023-10-09 18:07:39 +00:00
Mark Dacek
e0b6329384 Merge "Revert "Revert "Modify symlink_forest to rerun when soong_build has changed.""" into main 2023-10-06 17:34:47 +00:00
Christopher Parsons
f7fe400fbc Merge "Dont write data attrs for cc lib rules" into main 2023-10-06 14:09:07 +00:00
Zi Wang
b0f3ff43e5 Merge "Add support for java_library proto plugin in bp2build" into main 2023-10-05 22:32:53 +00:00
Chris Parsons
7123cc5370 Dont write data attrs for cc lib rules
The data attributes for cc library rules is dropped by their starlark
macros, so serves no real purpose. Furthermore, this unused dependency
proves problematic for allowlist v2, as there are many cases at HEAD
where the corner-case "requires" dependency would otherwise mark a module
as unconvertible.

Fixes: 303307456
Test: New unit test
Test: Manual verification to unblock allowlist v2 `bp2build.sh` runs in
AOSP

Change-Id: I6ca6104b958d2b428fc2ca5b3fa794106571acca
2023-10-05 22:07:28 +00:00
Zi Wang
dbaf6a9dd0 Add support for java_library proto plugin in bp2build
Test: Added unit test and CI

Bug: 303064670
Change-Id: Idb96ac322aafcb6789ea2002b84a6905d5ec488f
2023-10-05 12:53:23 -07:00
Chris Parsons
d078337796 Test changes to prepare for allowlist v2
This implements a number of in-place unit test changes to prepare for
some fundamental changes to bp2build ("allowlist v2"). This will change
bp2build so that rdeps of unconverted or missing modules will not be
converted by bp2build.

Bug: 301312260
Test: Unit tests
Test: Unit tests, with a local copy of allowlist v2 on
Change-Id: I8c8c0a24ba173e213fffcb0f8d7e99845705f4a7
2023-10-05 17:51:44 +00:00
Mark Dacek
b2441c52a4 Revert "Revert "Modify symlink_forest to rerun when soong_build has changed.""
This reverts commit aa5cc2cd6a.

Reason for revert: Fixed the bug in the original draft.
There was an error in how we compared the file's MTime to the
file's contents.

Bug: 300288299
Test: presubmits
Test: build/soong/tests/run_integration_tests.sh

Change-Id: I9e53432c0842c0b9fc13fe20d30ce9af37640c7f
2023-10-05 17:11:50 +00:00
Spandan Das
ee557e4c69 Merge "Create bp2build converter for versioned_ndk_headers" into main 2023-10-05 02:00:55 +00:00
Christopher Parsons
29c559b785 Merge "create, but dont register, bp2build_deps mutator" into main 2023-10-04 21:38:49 +00:00
Treehugger Robot
e88fe1fb92 Merge "Expand regex for likely aidl filegroups" into main 2023-10-04 21:11:18 +00:00
Mark Dacek
4ac292ffd8 Merge "Revert "Modify symlink_forest to rerun when soong_build has changed."" into main 2023-10-03 18:39:46 +00:00
Yu Liu
7a90fcfa45 Merge "Convert java_aconfig_library to bazel." into main 2023-10-03 17:29:26 +00:00
Chris Parsons
5f1b3c7ad8 create, but dont register, bp2build_deps mutator
This is the bulk of the "allowlist v2" feature. It will disable bp2build
generation for modules which have transitive dependencies without a
bazel build definition.

This CL includes this mutator, but doesn't register it as a bp2build
mutator (outside of a few unit tests). This allows us to easily iterate
on completion of this feature and ensure there are no launch blockers
before we finalize the change in AOSP.

Bug: 285631638
Test: Unit tests
Change-Id: Ifb0a079c409ca19b02cafa3fab2efa0d3deebc50
2023-10-03 00:16:30 +00:00
Mark Dacek
aa5cc2cd6a Revert "Modify symlink_forest to rerun when soong_build has changed."
This reverts commit 23a4120c57.

Reason for revert: broke soong_integration

Change-Id: I4d51841756675b3745244d23e13aefda0916614b
2023-10-02 23:40:33 +00:00
Yu Liu
f2b94010c8 Convert java_aconfig_library to bazel.
Bug: 297357579
Test: Unit test and AconfigJavaHostTest
Change-Id: Icf944cc0b2a7382107923d49b2d2ff0eb4113638
2023-10-02 15:04:19 -07:00
Spandan Das
a7da3f0e0b Create bp2build converter for versioned_ndk_headers
This module type is used by a single soong module - `common_libc` in
bionic/libc

Implementation details
- Convert this module type to ndk_headers rule. Bazel's ndk_headers rule
  will have a boolean attribute `run_versioner` to determine if
  verioner should be run on the headers
- Add this module type to the alwaysConvert bp2build list
- Add the converted target for `common_libc` to the deps of
  `ndk_sysroot`. This ensures that unbundled apps link against the
  versioned NDK headers of libc

Test: go test ./bp2build
Test: b build //bionic/libc:common_libc --config=android
Test: for f in $(find bazel-bin/bionic/libc/common_libc.versioned -type f); do cmp $f ${f/bazel-bin\/bionic\/libc\/common_libc.versioned/out\/soong\/ndk\/sysroot\/usr\/include}; done # no diff

Bug: 301169067

Change-Id: I55be202f0589db9bdc743c8be41c9c5afd74c352
2023-10-02 17:35:55 +00:00
Christopher Parsons
aa3e435857 Merge "Treat src=name filegroups as handcrafted targets" into main 2023-10-02 17:35:44 +00:00
Mark Dacek
e20b7589b4 Merge "Modify symlink_forest to rerun when soong_build has changed." into main 2023-10-02 15:36:43 +00:00
MarkDacek
23a4120c57 Modify symlink_forest to rerun when soong_build has changed.
Also remove existing symlink_forest_version functionality.

This remedies issues pertaining to b/300122962 - symlinks not
clearing after a revert

Timing wise - this doesn't present a performance regression
on a clean build. When soong_build changes, it's considerably longer
but no different from the time when symlink_forest_version is changed.

Bug: 300288299
Test: build/soong/tests/symlink_forest_rerun_test.sh
Change-Id: I0e95aac315dfea7ea3b8bb9a3eb0c6408300bd3b
2023-09-29 22:53:07 +00:00
Liz Kammer
79ff08f12c Expand regex for likely aidl filegroups
Test: go test soong tests
Change-Id: Iab7abea8e2d11583cb4a8ecd4b27368f61dd40e0
2023-09-29 12:38:42 -04:00
Chris Parsons
2ef472be7a Treat src=name filegroups as handcrafted targets
This is groundwork for allowlist v2, as such targets are still
effectively referencable via their file syntax; thus, rdep targets of
these filegroups should still be treated as convertible.

Fixes: 302025822
Test: Unit test update
Change-Id: I93445ff75e7c0570530725d086e47c1532833c06
2023-09-28 23:07:00 +00:00
Christopher Parsons
dec9ce6693 Merge "support aidl bp2build changes" into main 2023-09-28 20:19:43 +00:00
Christopher Parsons
e3f7a0d4d6 Merge "Update bp2build tests to use stubbed defs" into main 2023-09-28 17:23:50 +00:00
Cole Faust
6ed1e0fd59 Merge "AVB and selinux support in partitions" into main 2023-09-28 16:38:28 +00:00
Zi Wang
2201343fce Merge "Always drop deps from android_library with no srcs" into main 2023-09-28 16:16:51 +00:00