Commit graph

4887 commits

Author SHA1 Message Date
Vinh Tran
2dbc7451bf Allowlist com.android.media.swcodec
Bug: 2238278
Test: CI
Change-Id: I802542429615217fd8405d47839d262579d9db01
2022-09-29 11:08:12 -04:00
Paul Duffin
a3be747e5d Merge "java_sdk_library_import: Copy all prebuilt properties to child modules" 2022-09-29 10:28:41 +00:00
Treehugger Robot
fba6f7797c Merge "Add bp2build converter for bpf" 2022-09-29 03:04:46 +00:00
Zi Wang
b3cb38c3c8 Add bp2build converter for bpf
Bug: 240163393
Test: m bp2build
Test: bp2build/bpf_conversion_test.go
Change-Id: Ie3bbc64511146b099a766d7e8b56e93cef58ef68
2022-09-28 14:18:45 -07:00
Chris Parsons
86dc2c268a Support main repository prefixing in cquery
This makes mixed builds resilient to a recent backward-incompatbile
Bazel feature which explicitly adds the main repository (`@`) prefix to
all labels which are stringified by `str(target.label)` in Starlark.

This implementation is compatible with both current Bazel and
Bazel@HEAD.

After a new Bazel release to AOSP, we can clean up this code a little to
only support Bazel with this feature active (and that we need not hedge
on either Bazel behavior).

Bug: 248106697
Test: `m --bazel-mode nothing` with both current Bazel and a new Bazel
Change-Id: Id53c8505bb9080d5073c844de7f1ee57ceceae46
2022-09-28 19:02:51 +00:00
Treehugger Robot
d15df3269c Merge "Allowlist more deps of minadbd." 2022-09-28 18:20:03 +00:00
Yu Liu
cb7516349c Merge "Enable mediaswcodec." 2022-09-28 15:42:46 +00:00
Paul Duffin
bf4de041de java_sdk_library_import: Copy all prebuilt properties to child modules
Previously, only the prefer property was copied from the
java_sdk_library_import module to its child modules which meant that if
the use_source_config_var property was used to control the prefer
property that the child modules would never be used. That can cause
build breakages when building against prebuilts as some parts of the
build will use prebuilt files from java_sdk_library_import and some
will use source files from the corresponding java_sdk_library.

This change copies the use_source_config_var property too.

It also adds tests to verify that dependencies on child modules of a
java_sdk_library use the prebuilt child modules of the corresponding
java_sdk_library_import. That revealed a bug with the handling of stub
sources where the prefer property was set after creating the module
which has also been fixed.

Bug: 249192297
Test: m nothing
      # Cherry pick into branch broken by previous behavior and make
      # sure that it fixes it.
Change-Id: I5719c257f8457bcb2238bc7965215512a20f1095
2022-09-28 13:58:52 +01:00
Jingwen Chen
a051942118 Allowlist more deps of minadbd.
..except minadbd itself, which depends on 'adbd_system_api_recovery', a
phony module type that doesn't have a bp2build converter.

Test: bp2build.sh
Bug: 243025934
Change-Id: I48db09f8028a04089ed6fa6afac00007c3de4b31
2022-09-28 08:28:48 +00:00
Yu Liu
8c98153fc3 Enable mediaswcodec.
Bug: 233947030
Test: Manual
Change-Id: I4588167fadc609b0cf28a2918e0a24771a295b3b
2022-09-27 12:47:26 -07:00
Usta Shrestha
56b84e7786 typo in comment
Bug: N/A
Test: N/A
Change-Id: Ibfcaf4deba2181d48a6428d05f715fac447d74c6
2022-09-27 14:59:10 -04:00
Sasha Smundak
05b0ba6d1c Convert Soong licenses attribute to Bazel's applicable_licenses attribute
Add it to the `CommonAttributes` struct and handle it in fillCommonBp2BuildModuleAttrs

Bug: 190817312
Test: treehugger
Change-Id: I7b21056e680384d4046372ee844512029721026e
2022-09-27 11:38:11 -07:00
Treehugger Robot
8c45f98c3e Merge "File paths to allow "./" prefix" 2022-09-26 21:02:34 +00:00
Usta Shrestha
d558031e0c File paths to allow "./" prefix
bazel_path conversion would treat "./" as a package boundary
  which would be incorrect

Bug: b/243072036
Test: unit test build_conversion_test.go and `m libc`
Change-Id: I0fc44d2fd7a4270442c8755219a11fd585244c5c
2022-09-26 14:44:15 -04:00
Paul Duffin
bfdca96828 Add sdk:"keep" tag support
Fields tagged with `sdk:"keep"` will keep the value even if it would
normally be cleared because it was common across a number of structs.
This will allow a module type to specify the same value across all
structs populated directly from variants and have it be copied into all
common property structs without clearing it from the variant specific
structs.

Bug: 248258460
Test: m nothing
Change-Id: I147d946b11fd8766a7d875d9206e8f5034f585d6
2022-09-26 18:28:56 +01:00
Paul Duffin
02e25c85eb Rename sdk field tag "keep" to "ignore"
"ignore" is a better description of the effect that this tag has on the
optimization that is done as part of the sdk snapshot generation.
"keep" implies that something special is done with the field during the
optimization process but actually the optimization process completely
ignores the property, just as it does with unexported fields.

Bug: 248258460
Test: m nothing
Change-Id: Idfdfd87f927d641d4d301cbbde72b463c89155bf
2022-09-26 18:23:25 +01:00
Alix Espino
394a12b315 Merge "Implement bp2build for prebuilt_etc_xml" 2022-09-26 17:18:56 +00:00
Vinh Tran
32a98a5d55 Convert genDir to RULEDIR in gensrcs's cmd
Test: CI
Change-Id: I5ecc19dc73559bb518871080737b28a649edc162
2022-09-23 14:18:20 -04:00
Yu Liu
7574afb67f Merge "Allowlist libcode2_hidl@1.0/1.1/1.2" 2022-09-23 16:05:44 +00:00
Jingwen Chen
a5ecb37d64 Remove apexer.required workaround for aapt2.
Add a filter for cyclic references in required module names in bp2build.

Test: CI
Bug: 247985196
Bug: 225291837
Fixes: 234748998
Change-Id: Id1cfd0b2e5f217cdb01218ec3bbe11d5070cc9df
2022-09-23 06:41:35 +00:00
Jingwen Chen
f50817d511 Add zip2zip alias and allowlist unblocked rdeps.
Test: presubmit
Change-Id: Ia4eb3e6af5cf43dc5c1d924cbf7dcf812f4b8703
2022-09-23 02:29:02 +00:00
Jingwen Chen
4a7bf608b2 Add a soong_zip alias to prebuilts and allowlist all blocked rdeps.
This is an improvement over directly referencing the prebuilt because
bp2build can now emit BUILD files that contain a dep to
//build/soong/zip/cmd:soong_zip even though we're not converting the
soong_zip module.

It helps to make progress despite not having go rules support to
convert/build soong_zip. This unblocks many modules, like genrules and
gensrcs that use soong_zip in tools. soong_zip doesn't change often, so
it's not risky to depend on the prebuilt instead of source version.

Bug: 194644518
Bug: 248222296

Test: bp2build CI
Change-Id: Idef0c27ec0fb43a9097d750ec72fba00644c9f2a
2022-09-23 02:28:36 +00:00
Treehugger Robot
eaf5eda15b Merge "Fix package boundary in glob expansion with checked in BUILD files." 2022-09-23 01:25:36 +00:00
Jingwen Chen
0eeaeb8ef7 Fix package boundary in glob expansion with checked in BUILD files.
For directories without an Android.bp file, if they contain a merged
checked in BUILD file, it becomes a package boundary in the symlink
forest. However, the current glob expansion is only aware of Android.bp
files, but not merged BUILD files, so it generates glob expansions
incorrectly for files that cross the package boundary.

This CL fixes that by making the package boundary function aware of the
keepExistingBuildFile allowlist. See the new test cases for example.

Also stop using the same global bp2buildConfig for every test case to
allow each test to define their own bp2build allowlists.

Bug: 185358476
Test: new unit tests

Change-Id: Ifcd1283480a09a642ef4343e5bbc599583524577
2022-09-22 23:22:49 +00:00
Spandan Das
b79d1aee38 Merge changes from topic "api_export"
* changes:
  Allowlist conversion of api providing module types
  Multi-tree API bp2build converter for ndk_library
2022-09-22 20:49:16 +00:00
Alix
5918d649a4 Implement bp2build for prebuilt_etc_xml
Bug: 237039154
Test: xml_conversion_test.go & bp2build
Change-Id: I1f2c57b9532138f73041d8fc08feea3f66b2ebbc
2022-09-22 20:17:19 +00:00
Yu Liu
bf7c03ef66 Allowlist libcode2_hidl@1.0/1.1/1.2
Bug: 232544295
Test: Manual
Change-Id: Iaeae1d348a0756e63e0c16ebd0759528543c057f
2022-09-22 12:12:26 -07:00
Vinh Tran
fd446d6dba Allowlist com.android.neuralnetworks
Bug: 246958825
Bug: 232486397
Test: b build //packages/modules/NeuralNetworks/apex:com.android.neuralnetworks
Change-Id: I0f818911cc99505e95239e0aa782e3ed3b5b1da7
2022-09-22 14:45:42 +00:00
Vinh Tran
f19b658803 bp2build to convert $(genDir) to $(RULEDIR) in genrule's cmd
`statslog.cpp` with cmd `"$(location stats-log-api-gen) --cpp $(genDir)/statslog.cpp"` produces `out/.intermediates/frameworks/proto_logging/stats/stats_log_api_gen/statslog.cpp/gen/statslog.cpp`. Hence, $(genDir) is equivalent to `<package-dir>/<module-name>/gen`.

Currently, bp2buld converts `$(genDir)` to `$(GENDIR)`. In Bazel, `$(GENDIR)` is only the base of the generated code (e.g. `bazel-bin`).

```
genrule(
    name = "statslog.cpp",
    cmd = "$(location :stats-log-api-gen) --cpp $(GENDIR)/statslog.cpp",
    outs = ["statslog.cpp"],
    tools = [":stats-log-api-gen"],
)
```
produces `bazel-bin/statslog.cpp` but expects to have `bazel-bin/frameworks/proto_logging/stats/stats_log_api_gen/statslog.cpp`.

By converting to `$(RULEDIR)` which is `bazel-bin/frameworks/proto_logging/stats/stats_log_api_gen`.

There had not been any genrule module allowlisted with genDir
yet. So this should not cause any issue with modules converted before
this CL.

Bug: 247536535
Test: go tests
Test: presubmit builds and tests
Change-Id: I65c6aafadab6b180b7ef700427e041547ae7e98a
2022-09-22 08:57:14 -04:00
Spandan Das
d58630f5fc Allowlist conversion of api providing module types
The allowlisted modules will be used to gather the contributions to the
publicapi surfce

Test: TH
Change-Id: I49df3a734c7ab21f21020a8cf8ddfaf7b6fa9717
2022-09-21 19:58:18 +00:00
Spandan Das
81593891ee Create api_domain module type and its bp2build converter
This module does not have any build actions in Soong yet. It will be
converted to a Bazel target using bp2build, and API export will be run
on the generated Bazel target

Test: go test ./bp2build
Test: TH
Change-Id: I76df32bd9f23b60e746b2700af07668a2ed74844
2022-09-21 19:49:46 +00:00
Spandan Das
1278c2cb24 Multi-tree API bp2build converter for ndk_library
This is a partial bp2build conversion that only emits the
cc_api_contribution target of ndk_library. We also need to convert this
to cc_stub_suite eventually to enable building vendor/product API
domains with Bazel

Also create an enum for the three known Multi-tree API surfaces (will
likely be expanded in the future)

Test: go test ./bp2build
Test: b cquery //bionic/libc:libc.ndk.contribution --output=starlark
--starlark:expr="providers(target)"

Change-Id: Idb24871ba20aae132b61eb31ef35c917cacae9e1
2022-09-21 19:49:46 +00:00
Alix Espino
62b75f4e4a Merge "Revert^2 "deletion of clang_cflags & clang_asflags from Soong"" 2022-09-21 19:28:11 +00:00
Treehugger Robot
4669ea4d19 Merge "Allowlist deps of minadbd." 2022-09-21 15:28:38 +00:00
Vinh Tran
70e079c6ad Merge "Reallowlist libneuralnetwork's deps in bp2build" 2022-09-21 15:24:14 +00:00
Jingwen Chen
adc07fa995 Allowlist deps of minadbd.
Remaining blockers are:

* android.hardware.health@1.0_interface: blocking 15 modules
* android.hardware.health@2.0_interface: blocking 12 modules
* android.hardware.health_interface: blocking 8 modules
* android.hardware.health@2.1_interface: blocking 8 modules
* android.hardware.health@1.0: blocking 8 modules
* android.hardware.health@2.0: blocking 7 modules
* android.hardware.health@2.1: blocking 5 modules
* android.hardware.health-translate-ndk: blocking 4 modules
* libhealthshim: blocking 3 modules
* libhealthhalutils: blocking 3 modules
* librecovery_utils: blocking 2 modules
* libminadbd_services: blocking 1 modules

Test: bp2build.sh
Bug: 243025934
Change-Id: Ic39666ee2d9f573726d6ed7ef9c45ac4975baa3a
2022-09-21 13:13:48 +00:00
Paul Duffin
4930389405 Merge "Exclude unsupported libraries from sdk snapshot" 2022-09-21 12:43:47 +00:00
Vinh Tran
583a07d159 Reallowlist libneuralnetwork's deps in bp2build
Reverting a revert aosp/2221842 and disabling converted filegroups that are srcs of unconverted gensrcs because of b/247782695.

Bug: 232486397
Test: CI
Change-Id: Ifc5ee7ed6f96ef8081a779e374ad7ac5ecbb947a
2022-09-20 21:31:49 +00:00
Treehugger Robot
e53c7ea256 Merge "Revert "Allowlist libneuralnetworks's dependencies"" 2022-09-19 23:24:11 +00:00
Vinh Tran
414946c466 Revert "Allowlist libneuralnetworks's dependencies"
Revert submission 2216878-libneuralnetworks

Reason for revert: failing mixed_droid.sh
Reverted Changes:
I77c8d4736:Allowlist libneuralnetworks's dependencies
I5f98038ec:Remove conversion of backend.rust to Bazel

Change-Id: Ib7147b4afdbdd69d635eb1bb8ed2e725396fdae7
2022-09-19 20:20:52 +00:00
Liz Kammer
bda5850a71 Merge changes from topic "libbuildversion-directly"
* changes:
  Allowlist aapt2 deps.
  Add libbuildversion in converion instead of macro
2022-09-19 18:33:49 +00:00
Vinh Tran
59c33ac85a Merge "Allowlist libneuralnetworks's dependencies" 2022-09-19 17:59:21 +00:00
Liz Kammer
09d831ec86 Allowlist aapt2 deps.
Test: bp2build.sh
Change-Id: Ie54a4f3b9e362ce1c5b6ee884318d970b0b10f1c
2022-09-19 11:57:12 -04:00
Vinh Tran
c3fd556fd7 Allowlist libneuralnetworks's dependencies
Except for statslog_neuralnetworks.cpp and statslog_neuralnetworks.h which are blocked by b/247536535.

Bug: 232486397
Test: CI
Change-Id: I77c8d47364fe33d0869d23f1c1c9eacd73ef7cc6
2022-09-19 11:21:39 -04:00
Jingwen Chen
a37ef6833b Merge "bp2build: Convert cc_test.test_options.tags to cc_test.tags" 2022-09-19 08:28:33 +00:00
Sasha Smundak
31327e9a2d Convert packages/apps/SafetyRegulatoryInfo
Bug: 241593926
Test: treehugger,  m --bazel-mode-dev com.android.adbd
Change-Id: I4517bc7814e54d6697b6ff7b0cd9c8b7085d71d9
2022-09-18 17:10:54 -07:00
Alexander Smundak
efc64e3a03 Merge changes from topic "notice"
* changes:
  Implement bp2build for the `package` module
  Implement bp2build for the `license_kind` module
  Implement bp2build for the `license` module
  Handle nameless modules during bp2build conversion.
2022-09-16 23:22:07 +00:00
Colin Cross
7a2b1a1c56 Merge "Make all Nameless modules have unique names" 2022-09-16 21:23:36 +00:00
Yu Liu
b8af17bdd6 Merge "Fix a bug where deps were missing for converted proto_library" 2022-09-16 16:26:21 +00:00
Treehugger Robot
2eade656df Merge "Remove obsolete com.android.bluetooth apex" 2022-09-16 05:28:06 +00:00
Yu Liu
2a85fb195d Fix a bug where deps were missing for converted proto_library
This is just a partial fix.

Bug: 246997908
Test: Manual build //frameworks/proto_logging/stats:libstats_proto_host_proto
Change-Id: I9e4e62bce22cb68bcd7f917c57f3d1438fcec716
2022-09-15 22:18:48 -07:00
Jingwen Chen
fbff97a84d bp2build: Convert cc_test.test_options.tags to cc_test.tags
zeek@ has been tagging unit tests that cannot run on RBE with
"no-remote". While we don't yet have RBE support with standalone `b
test` yet, we can make sure to propagate the tags now.

Bug: 236973602

Test: new unit test
Change-Id: I6d0648f184626bb01c657068804f99ffb82907a3
2022-09-16 02:32:03 +00:00
Yu Liu
609c3e074f Merge "Support proto modules with external references." 2022-09-15 16:00:32 +00:00
Treehugger Robot
f0e1a25217 Merge "Integrate gen_notice with Make for dist." 2022-09-15 14:50:12 +00:00
Yu Liu
274c5875e5 Merge "Improve error message when a module is double enabled." 2022-09-15 04:53:08 +00:00
Treehugger Robot
534b797cd7 Merge "Allowlist //frameworks/av/media/module/minijail/..." 2022-09-15 00:31:09 +00:00
Yu Liu
10853f90ef Improve error message when a module is double enabled.
Bug: None
Test: Manual
Change-Id: Ie96dd76d628e8ac3f0da06b949e9bfb9a3259dce
2022-09-14 16:15:43 -07:00
Bob Badour
4660a9824c Integrate gen_notice with Make for dist.
Most exempt module types have no output. Support exempt module types
with output by requiring they must be 0p and have no license metadata.

Disallow `licenses: []` property on gen_notice.

Test: m cts dist

Change-Id: Ic992bd6420fa6898495866eac43495002ef4b6c8
Merged-in: Ic992bd6420fa6898495866eac43495002ef4b6c8
2022-09-14 14:21:44 -07:00
William Escande
f03a3b00fe Remove obsolete com.android.bluetooth apex
Also remove the soong hack that allowed us to build during the
transition

Bug: 243054261
Test: build + TH
Merged-In: I60bac1ec687f03a38f38240969a1c38a8e5bf92c
Change-Id: I60bac1ec687f03a38f38240969a1c38a8e5bf92c
2022-09-14 21:09:50 +00:00
Sasha Smundak
8bea267caf Implement bp2build for the package module
* We are interested mostly in the conversion the `default_applicable_licenses`
  attribute, as `default_visibility` cannot be handled until every module's
  `visibility` is handled.
* Several referenced license modules had to be manually enabled for
  conversion, and likewise a few trivial Android.bp containing only
  package and license modules.
* As Bazel allows only a single `package` rule, the package rules in a
  manually converted BUILD.bazel files were removed (in
  external/protobuf and prebuilts/clang/host/linux-x86 trees).
* The converted package rule is emitted before the `load` statements per
  Bazel documentation.

Bug: 190817312
Test: treehugger
Change-Id: If8bf6fee1580177de3bb402923615bcd48923ed2
2022-09-14 13:49:27 -07:00
Sasha Smundak
a93c62b375 Implement bp2build for the license_kind module
Bug: 190817312
Test: treehugger
Change-Id: Id5bc9c1b7c5386d26ce0ebc33f63bc2665de7d54
2022-09-14 13:49:27 -07:00
Sasha Smundak
9d2f1743d2 Implement bp2build for the license module
Also, add ExpectedRuleTarget type to simplify bp2build testing

Bug: 190817312
Test: treehugger
Change-Id: Id3a642680d3518d36360ba957919a6fc96222672
2022-09-14 13:49:18 -07:00
Yu Liu
2aa806b52d Support proto modules with external references.
Bug: 236055697
Test: Manual testing and adding new unit tests.
Change-Id: I984c0ecb93f0023727a39a3af3921820337bf8c7
2022-09-14 13:02:53 -07:00
Alix Espino
ef47e54bec Revert^2 "deletion of clang_cflags & clang_asflags from Soong"
e9a6865bc7

Change-Id: I20be0561628ee9da5c1431975f364459b6184330
2022-09-14 19:10:51 +00:00
Vinh Tran
056ebde9b5 Merge "Allowlist libSurfaceFlingerProp which depends on cc_sysprop_library_static" 2022-09-14 17:45:13 +00:00
Treehugger Robot
a8b8c67b0a Merge "Allowlist NeuralNetworks' BlobCache_test and nnCache_test." 2022-09-14 17:24:32 +00:00
Sasha Smundak
fb58949414 Handle nameless modules during bp2build conversion.
So far it is `package` module.

Test: treehugger
Change-Id: Ibf3af0b0bf0a532e2ea1d478275a5ac3784ef170
2022-09-14 09:32:17 -07:00
Paul Duffin
1938dba8b6 Exclude unsupported libraries from sdk snapshot
When an sdk snapshot is targeted at release X then it cannot include
bootclasspath fragment libraries which are not present in that build as
otherwise it causes build failures. It should also not include any
unsupported libraries, i.e. libraries that cannot work on that release.

This change causes sdk snapshot to exclude libraries that have a
    min_sdk_version > target build release

It also ensures that hidden API flags do not include any information
from excluded libraries.

Bug: 240406019
Test: BUILD_NUMBER=fixed packages/modules/common/build/mainline_modules_sdks.sh
      # Ran the previous command with and without this change to make
      # sure that this change excludes framework-connectivity-t library from the
      # tethering sdk snapshot for S, including from the hidden API flag files.
Change-Id: I57969b85a12e9e5a3fc76c055b260cec5d5f7d7f
2022-09-14 16:47:18 +01:00
Jingwen Chen
8ebc6204f4 Allowlist //frameworks/av/media/module/minijail/...
This builds libavservices_minijail and libavservices_minijail_unittest.

Bug: 239041723

Test: $ T="libavservices_minijail_unittest"; P="frameworks/avmedia/module/minijail"; b build //$P:$T --config=android; adb push bazel-bin/$P/. /data/tmp/$P/ && adb shell /data/tmp/$P/$T
Change-Id: Ief23a4aaf2e384503588074d411c5ef0b7e02c69
2022-09-14 11:48:21 +00:00
Jingwen Chen
6bffe55fcf Allowlist NeuralNetworks' BlobCache_test and nnCache_test.
Bug: 239041723

Test: b/239041723#comment10
Test: bp2build.sh
Change-Id: Ide4ec90a71ea169fc4126db83736d88fcc79e446
2022-09-14 11:34:34 +00:00
Vinh Tran
3853423e06 Allowlist neuralnetworks_utils_hal_aidl
hardware/interfaces/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Utils.h in neuralnetworks_utils_hal_aidl uses `IDevice::version` which requires the setting of `--version` flag in aild tool, which is added in aosp/2216684

Fix: 246645564
Test: b build //hardware/interfaces/neuralnetworks/aidl/utils:neuralnetworks_utils_hal_aidl
Change-Id: Ia246c4c47c8b4d52f3b37cccd4640ad862ab258c
2022-09-14 00:52:10 +00:00
Vinh Tran
c169c5446f Allowlist libSurfaceFlingerProp which depends on cc_sysprop_library_static
Test: CI
Change-Id: I8674dbe23b7d433841085dd9c813f5abec5f5ba0
2022-09-13 13:15:22 -04:00
Vinh Tran
99fd650fdb Allowlist unblocked cc modules
Bugs: 232480794 232541556
Test: CI
Change-Id: Idb0e9248c0ffc6ac51579c09eccaf08817927e48
2022-09-13 13:15:12 -04:00
Romain Jobredeaux
a2595a93fe Merge "Allowlist Kotlin-related libraries." 2022-09-13 13:28:39 +00:00
Treehugger Robot
eb30142616 Merge "Revert "deletion of clang_cflags & clang_asflags from Soong"" 2022-09-12 21:06:12 +00:00
Alix Espino
e9a6865bc7 Revert "deletion of clang_cflags & clang_asflags from Soong"
Revert submission 2154033-delete clang_cflags clang_asflags

Reason for revert: Broke build on git_tm-dev-plus-aosp and downstream branches

Reverted Changes:
I5c499a37e:Default BuildBrokenClangCFlags &  BuildBrokenClang...
Ic1d90b72d:deletion of clang_cflags & clang_asflags from Soon...

Change-Id: Ic55dd85a824cf1a543249e0b00072b8c08a475b8
2022-09-12 18:51:23 +00:00
Alix Espino
68eeffbc40 Merge "deletion of clang_cflags & clang_asflags from Soong" 2022-09-12 15:11:20 +00:00
Alix Espino
c0cca3f4e1 Merge changes I82d3a384,I3b03f0a3
* changes:
  product_variables srcs in prebuilt_etc
  refactoring build_conversion.go to remove panic
2022-09-12 13:31:46 +00:00
Jingwen Chen
3c0c2db93a Merge "Allowlist more modules under the adb package." 2022-09-12 04:52:20 +00:00
Sam Delmerico
df96fdd5b6 Merge "Revert "Revert "add bazel AIDL examples to bp2build""" 2022-09-09 21:38:33 +00:00
Alix
1879c68261 deletion of clang_cflags & clang_asflags from Soong
Clang_cflags and clang_asflags are depecrated.
Set up BUILD_BROKEN flags so partners can bypass errors
from using them

Bug: 226636335
Test: m nothing & treehugger
Change-Id: Ic1d90b72decc4c6c1f7e6dda95a2c56ab2c26d86
2022-09-09 21:03:34 +00:00
Alix
bbfd538326 product_variables srcs in prebuilt_etc
bp2build conversion handles product_variable srcs

bug: 228353067
Test: prebuilt_etc_conversion_test.go
Change-Id: I82d3a384ee14d4e981d502dd9eb824c87d5ae2c7
2022-09-09 20:52:09 +00:00
Treehugger Robot
5aa5dc4121 Merge "Fix gen_notice init to support arch and dist." 2022-09-09 19:34:06 +00:00
Steven Moreland
7ae3a3c170 Merge "FailIfNoMatchingErrors specify using regex" 2022-09-09 17:27:23 +00:00
Vinh Tran
095a1af1a1 Merge "Convert av-types-aidl aidl_interface to Bazel" 2022-09-09 14:45:22 +00:00
Jingwen Chen
2247acae0c Allowlist more modules under the adb package.
These are all buildable.

Bug: 239041723
Bug: 243025934

Test: presubmits
Change-Id: Id3de8d9b7f2f83fca78f26708dabb4b93372fc16
2022-09-09 12:17:53 +00:00
Jingwen Chen
d4a0b1f63c Allowlist adbd_test.
Builds and passes on cuttlefish.

Test: $ lunch aosp_x86_64 && b build //packages/modules/adb:adbd_test --config=android && adb push bazel-bin/packages/modules/adb/adbd_test /data/tmp/adbd_test && adb shell /data/tmp/adbd_test

Bug: 239041723
Bug: 243025934
Change-Id: Ic73378c770b654fad5fcf99a672977eda8fe2e06
2022-09-09 10:32:43 +00:00
Romain Jobredeaux
0dfe8d3f7e Allowlist Kotlin-related libraries.
Change-Id: Iaeea811d9ae71b6e57ca79246e0a1691d65ff6f2
Bug: 186462641
Test: Newly allowlisted libs fall under CI
2022-09-08 16:21:42 -04:00
Usta (Tsering) Shrestha
a4f73d937e Merge "Use list comprehensions in Starlark" 2022-09-08 20:14:49 +00:00
Bob Badour
e38387314a Fix gen_notice init to support arch and dist.
Incorrect init function was called so Stem property was not handled
correctly and the dist properties were treated as unknown.

Test: m droid dist
Change-Id: I5eb8771afb4fda332df08cf1560df5c17d1316cc
2022-09-08 12:07:10 -07:00
Yu Liu
dd6321213e Merge "Support proto.include_dirs" 2022-09-08 18:34:34 +00:00
Usta Shrestha
79fccefc59 Use list comprehensions in Starlark
also using a generic json_encode as an approximation for `json.encode`

Test: USE_BAZEL_ANALYSIS=1 m libc
Bug: b/242587802
Change-Id: Ib83aeda3f99cc3966548b0cd47e72669422ed72d
2022-09-08 17:12:42 +00:00
Chris Parsons
543c8c4319 Add adbd to mixed build prod allowlist
Bug: 231322898
Test: m --bazel-mode droid
Change-Id: I7a91f4f04d5e1f6432c63e4a78f81d5b30ed3cc5
2022-09-08 11:40:24 -04:00
Yu Liu
2d13614b89 Support proto.include_dirs
For each package in the include_dirs property a proto_library target
should be added to the BUILD file in that package and a mapping
should be added to the bp2build code, by this way a proper dependency
relationship can be established and used by bazel.

Bug: 239944064
Test: Added unit tests and manually verified include_dirs can be
properly converted to bazel and used by bazel to build the targets.

Change-Id: I50d8ee21fabcfec0a44487f6e5f3d8a3845e79c3
2022-09-07 16:48:17 -07:00
Christopher Parsons
1f039780e0 Merge "Remove USE_BAZEL_ANALYSIS" 2022-09-07 21:54:47 +00:00
Chris Parsons
1bb58da17c Remove USE_BAZEL_ANALYSIS
Use --bazel-mode-dev instead.

Test: Treehugger
Bug: 244309479
Change-Id: I570d02651eea92375cd96efbeb8d986a9495e1ed
2022-09-07 14:58:03 -04:00
Romain Jobredeaux
3d516cdb07 Keep allowlist alphabetized
Change-Id: I6ba977e4a705a3ba516fd23dcf5ceaf354d7e892
2022-09-07 14:28:31 +00:00
Vinh Tran
b01eb60c09 Convert av-types-aidl aidl_interface to Bazel
Change-Id: I1dfb0a58a8a9f9f4a1baeba73ccbb17d30ebd947
Test: b build //frameworks/av:av-types-aidl-cpp
Bug: 235113507
2022-09-06 23:04:23 +00:00
Trevor Radcliffe
a355be226f Merge "cc bp2build for sysprop_library modules" 2022-09-06 19:27:22 +00:00
Treehugger Robot
bf5fa97bb6 Merge "Remove gen-kotlin-build-file.py from Bp2buildModuleDoNotConvertList" 2022-09-06 18:54:30 +00:00
Cole Faust
c843b99b71 Support arch features in bp2build
Bug: 189972518
Test: New soong test
Change-Id: I05d77c8f63ffe6697d8e0300226864658055e116
2022-09-02 15:20:54 -07:00
Trevor Radcliffe
ad3d123fb6 cc bp2build for sysprop_library modules
This CL implements bp2build functionality for the cc outputs of
sysprop_library modules. cc_* modules depending on sysprop sources
will be handled in a later CL.

Bug: 244439349
Test: b build //system/libsysprop/srcs/...
Test: Inspect BUILD.bazel
Test: Unit tests
Change-Id: I6fa20661b984223347480c9afe0885b5db5a2807
2022-09-02 18:27:39 +00:00
Cole Faust
e89f91df44 Remove gen-kotlin-build-file.py from Bp2buildModuleDoNotConvertList
Its issue was fixed in aosp/2202605

Bug: 198619163
Test: Presubmits
Change-Id: Ic3878ea1280f8f1ebab1b4c2423e07d795886c94
2022-09-02 10:26:50 -07:00
Treehugger Robot
f20433b15f Merge "Handle product config specific header_libs prop in cc bp2build" 2022-09-02 13:02:04 +00:00
Zi Wang
0a8a129ee8 Handle product config specific header_libs prop in cc bp2build
Product variable header_libs is able to be converted.
Since static_libs and header_libs both use implementationDeps,
also added logic to make sure they both contribute to bazel
target.

Bug: 228314770
Test: m bp2build
Test: TestCcLibraryProductVariablesHeaderLibs in cc_library_conversion_test
Change-Id: I370fc75b666b3908b6ac5ed42bca5560f957fc42
2022-09-01 14:32:51 -07:00
Treehugger Robot
6faa161557 Merge "bp2build: allowlist //system/logging/... and deps." 2022-09-01 18:29:21 +00:00
Treehugger Robot
1f03a9f953 Merge "Convert cc_test targets with bp2build." 2022-09-01 17:00:45 +00:00
Treehugger Robot
75c724cc8b Merge "Revert "DoNotConvert tzdata nor tz_version"" 2022-09-01 16:41:20 +00:00
Jingwen Chen
f061600d64 bp2build: allowlist //system/logging/... and deps.
```
$ b test --config=linux_x86_64 //system/logging/... --test_output=errors
//system/logging/logd:logd-unit-tests                           (cached) PASSED in 1.3s
```

Also builds:

- logcat
- liblogd
- auditctl
- logd
- liblogwrap
- logwrapper
- and various device tests

Test: b build //system/...
Test: b test //system/... --config=linux_x86_64
Test: bp2build.sh
Bug: 243025934
Change-Id: Id94460c1148b76af05e4ff1f4de9aa32f2626085
2022-09-01 15:00:15 +00:00
Jingwen Chen
537242c6f1 Convert cc_test targets with bp2build.
Starting with libutils_test, adb_test, libcutils_test, (and ~47 other host_supported tests).

Test: $ b build --config=android_x86_64 //system/core/libutils:libutils_test && adb push bazel-bin/system/core/libutils/. /data/tmp/libutils_test_files/ && adb shell /data/tmp/libutils_test_files/libutils_test
Test: presubmits with newly converted cc_test targets
Test: $ b test //system/... --config=linux_x86_64 --verbose_failures --test_output=errors --keep_going --build_tests_only

Fixes: 242038415

Change-Id: I10051aadb880c3aabeba6d7fb079523e6fb4ac43
2022-09-01 14:59:15 +00:00
Alex Márquez Pérez Muñíz Díaz Púras Thaureaux
1867ae73d1 Revert "DoNotConvert tzdata nor tz_version"
This reverts commit bff2e88a85.

Reason for revert:
The reason for excluding them has been resolved; the files no longer conflict with the target names.

Test: mixed_libc.sh shows conversion of tzdata & tz_version

Change-Id: Ibcecfb2a65bb51a89dbc358ebd248209f3eb45b8
2022-09-01 14:42:10 +00:00
Treehugger Robot
bf9c26c364 Merge changes I1270e8d0,I61731a5e
* changes:
  Move function PathForVndkRefAbiDump to Prevent unnecessary exports in paths.go
  Change the type of parameter prevVersion to int in sourceAbiDump
2022-09-01 06:37:20 +00:00
Cole Faust
ea602c5a41 Remove old BUILD file merging code
It's not needed anymore since aosp/2197837,
it should've been removed in that cl but I forgot.

Bug: 234167862
Test: ./build/bazel/ci/bp2build.sh
Change-Id: I3d67a6e1894ad401525070ad37d3158708898306
2022-08-31 15:12:47 -07:00
Alex Márquez Pérez Muñíz Díaz Púras Thaureaux
a56e97042c Support suffix property in bp2build
Support this in cc_{binary,library{,_shared}}

Bug: 204811222
Test: Suffix additions to cc_{binary,library{,_shared}}_conversion_test.go
Test: mixed_{libc,droid}.sh also builds newly allowlisted
Change-Id: I596694794b01b04c542cbcd7d54baeb7d914ba50
2022-08-31 18:06:21 +00:00
Sam Delmerico
8dfa46a9c2 Revert "Revert "add bazel AIDL examples to bp2build""
This reverts commit 8f3f1597e4.

Reason for revert: moved examples to system/tools/aidl/build/bp2build

Change-Id: I2329596bd7ae9d7a64b0984902aaea85783c4656
2022-08-31 13:28:55 +00:00
Mu-Le Lee
f5ed30b2aa Move function PathForVndkRefAbiDump to Prevent unnecessary exports in paths.go
This CL moves function PathForVndkRefAbiDump from android/paths.go to
cc/library.go to prevent unnecessary exports.

Test: make libz
Bug: 239915696
Change-Id: I1270e8d07edb09d93621c049acab9196757d356b
2022-08-31 06:04:27 +00:00
Treehugger Robot
d221359e6d Merge "Allowlist aidl interfaces with ndk backend enabled" 2022-08-31 01:28:45 +00:00
Cole Faust
324a92e404 Always merge build files
Previous behavior:

- Packge not listed in bp2buildKeepExistingBuildFile:
    - Use bp2build generated build file
- Package listed in bp2buildKeepExistingBuildFile:
    - Use handcrafted build file even if there were allowlisted bp2build
      modules in the same package.
- Package listed in bp2buildKeepExistingBuildFile and a soong module has
  a bp2build: { label } attribute:
    - Merge the handcrafted and bp2build generated build files

New behavior:

- Packge not listed in bp2buildKeepExistingBuildFile:
    - Use bp2build generated build file
- Package listed in bp2buildKeepExistingBuildFile:
    - Merge with bp2build generated build file.

Bug: 234167862
Test: ./build/bazel/ci/bp2build.sh
Change-Id: Ifbaf4f8f0f5158b5b2bd6d534eb2311e2e5f399b
2022-08-30 16:07:23 -07:00
Vinh Tran
c3873e84ec Allowlist aidl interfaces with ndk backend enabled
The dependency chain for these aidl interfaces with ndk binding is explicit as followed

```
android.hardware.common
android.hardware.graphics.common -> [android.hardware.common]
android.hardware.neuralnetworks -> [android.hardware.common, android.hardware.graphics.common]
```

Test: b build //hardware/interfaces/neuralnetworks/aidl:android.hardware.neuralnetworks-V1-ndk
Test: b build //hardware/interfaces/graphics/common/aidl:android.hardware.graphics.common-V2-ndk
Test: b build //hardware/interfaces/common/aidl:android.hardware.common-V2-ndk
Bug: 235113507
Change-Id: I05a3b6b7e9f592c422ac257f5769ada350953516
2022-08-30 17:11:38 -04:00
Alix Espino
f9f9ed7cf1 Merge "Deprecating clang Property" 2022-08-30 17:42:10 +00:00
Treehugger Robot
ff29846073 Merge "Revert "add bazel AIDL examples to bp2build"" 2022-08-30 17:19:13 +00:00
Treehugger Robot
bf24d20f1e Merge "Allowlist unblocked modules" 2022-08-30 15:55:43 +00:00
Christopher Parsons
3d31a12867 Merge "Add --bazel-mode and --bazel-mode-dev" 2022-08-30 14:29:30 +00:00
Guang Zhu
8f3f1597e4 Revert "add bazel AIDL examples to bp2build"
This reverts commit 02626f9365.

Reason for revert: revert together with aosp/2133802

Change-Id: I795c15d8cd69764dca8e69b285eb8c3e00935b44
2022-08-30 08:37:37 +00:00
Steven Moreland
082e20655e FailIfNoMatchingErrors specify using regex
This was used nested in some code in the AIDL tests, but I didn't
realize that they were regexes, and well, I was trying to figure out
how identical strings were not identical.

Change-Id: Icf3114c84b804fb8f280251d0b11b06b623dfa90
2022-08-30 01:11:13 +00:00
Treehugger Robot
fb9ca5c7e2 Merge "Allowlist speex and audio_utils" 2022-08-29 19:20:31 +00:00
Treehugger Robot
94bc338bf3 Merge "Allowlist libyuv" 2022-08-29 19:15:53 +00:00
Chris Parsons
ef615e5841 Add --bazel-mode and --bazel-mode-dev
This allows "bazel mixed builds prod mode", in additional to reworking
the mechanism in which mixed builds dev mode is enabled.

As a followup, CI scripts will be migrated to use the new flags, as
USE_BAZEL_ANALYSIS=1 is deprecated.

Test: Manually ran --bazel-mode with an allowlist verifying that the
module alone was enabled
Test: Manually verified --bazel-mode and --bazel-mode-dev cause a build
failure

Change-Id: If0d34360e60452f428b05828f4ec7596b7cb619a
2022-08-29 10:56:04 -04:00
Liz Kammer
1c92116e78 Allowlist unblocked modules
Test: b build //...
Change-Id: I2050f413b42e194555863759e230356c723dd07e
2022-08-29 09:55:21 -04:00
Cole Faust
fe2ab36371 Allowlist speex and audio_utils
They're dependencies of media.swcodec

Bug: 237041122
Test: ./build/bazel/ci/bp2build.sh
Change-Id: I93cb8b0be707d62edf15f0326d901d0251ccb232
2022-08-27 20:44:40 -07:00
Cole Faust
92e92e49ca Allowlist libyuv
It's a dependency of media.swcodec

Bug: 237041122
Test: ./build/bazel/ci/bp2build.sh
Change-Id: I17e512af7c0d7d9ded7311ad61cd339b380fbef0
2022-08-26 16:12:42 -07:00
Vinh Tran
9f6796ab17 Convert cc library with AIDL to cc_aidl_library
Change-Id: I1056b37cf09f4341bf2c2545c9069dbe49ea5ab3
Test: USE_BAZEL_ANALYSIS=1 m libbinder
Bug: 243010121
Fix: 243015050
2022-08-26 16:21:53 -04:00
Sam Delmerico
939653e34e Merge "add bazel AIDL examples to bp2build" 2022-08-26 20:07:58 +00:00
Sam Delmerico
3be24727ce Merge changes from topic "aidl_interface_bp2build"
* changes:
  add bp2build unit tests for aidl_interface
  AIDL source generation accounts for Bazel paths
  convert .aidl srcs for java_library
  add Partition method to LabelListAttribute
2022-08-26 20:07:58 +00:00
Alix
b5f6d9ea51 Deprecating clang Property
Clang has defaulted to true since 2018. Clang property is deprecated.
Set up a BUILD_BROKEN_CLANG_PROPERTY flag so partners can bypass \
errors from using clang.

Bug: 208980553
Test: m nothing & treehugger
Change-Id: I8fd7d3e6bdbb963279248d3482e8a590238727e3
2022-08-26 20:05:07 +00:00
Wei Li
81852ca9ac Add bp2build converter for cc library stubs and use the stub library target of a library while linking it in APEXs.
Bug: 231322789
Test: with this CL on internal master,
1) b build --verbose_failures //vendor/google/modules/AdbdGoogle:com.google.android.adbd --config=android_x86_64
2) adb install bazel-bin/vendor/google/modules/AdbdGoogle/com.google.android.adbd.apex, and adbd is activated successfully on cuttlefish device.
3) m mts && mts-tradefed run mts-adbd, and there is no failure with cuttlefish device
4) packages/modules/adb/test_device.py, and there is no failure with cuttlefish device.

Change-Id: I81b6f5336cacf35c68957ae2dac65f985b6eafb9
2022-08-25 13:28:40 -07:00
Sam Delmerico
2351eacb19 AIDL source generation accounts for Bazel paths
The AIDL source generation rule sets include flags based on the relative
path of .aidl sources. For .aidl sources provided by Bazel targets, e.g.
in a filegroup, the same directory could be added to the include path
twice. Instead we need to ensure that if a Bazel source provides the
include path, that we don't add it again from a Soong source.

Bug: 229251008
Test: USE_BAZEL_ANALYSIS=1 m api-stubs-docs-non-updatable
Change-Id: I4997039003242b43e0e52ccf41729acb4ad11324
2022-08-25 14:47:41 -04:00
Sam Delmerico
97bd127457 convert .aidl srcs for java_library
Test: go test ./bp2build
Test: b build //frameworks/base/services/tests/servicestests/aidl:servicestests-aidl
Test: enable //packages/modules/NetworkStack/common/networkstackclient
    && disable restriction on Android SDK in javaLibraryBp2Build
    && b build //packages/modules/NetworkStack/common/networkstackclient:ipmemorystore-aidl-interfaces-V10-java
Change-Id: Ifb817daf09a3983ea1c84948ed9f02a79f95784b
2022-08-25 14:47:41 -04:00
Zhenhuang Wang
5e7c4756b5 Merge "Add a new test_options.tags attribute to customize test execution" 2022-08-24 02:14:02 +00:00
Treehugger Robot
4673d18144 Merge "disable kotlin java_imports for mixed builds" 2022-08-23 21:28:07 +00:00
Sam Delmerico
0b66fb28e6 disable kotlin java_imports for mixed builds
These Kotlin JARs contain class files under the META-INF directory that
are incorrectly parsed in gen_jarjar.py causing the Jarjar tool to error.

Bug: 243098369
Bug: 217750501
Test: build/bazel/ci/mixed_droid.sh
Change-Id: I62aaf086dc91d868a8d653f7fdb2c111bdc96097
2022-08-23 15:27:56 -04:00
Christopher Parsons
5a2a4814af Merge "Refactor mixed build allowlist handling" 2022-08-23 17:21:16 +00:00
Chris Parsons
ad876010fe Refactor mixed build allowlist handling
This refactoring prepares for introduction of bazel prod mode, an
alternative mechanism for mixed builds allowlist handling.

 * Decide bazel-mode as close to soong_build main as possible
 * BazelContext itself decides whether a module is allowlisted
 * Separate bp2build and mixed build allowlist

Test: m nothing, manually verified all modules are mixed build disabled
(via metrics)
Test: USE_BAZEL_ANALYSIS=1 m nothing, manually verified that mixed build
disabled/enabled modules are identical before and after change.

Change-Id: I0f55d8b85000cb4a871a099edc6d7d868d7df509
2022-08-23 13:15:12 -04:00
Treehugger Robot
e773613367 Merge "Make FirstTarget treat HostCross separately from Host" 2022-08-23 14:14:45 +00:00
Colin Cross
c0f0eb86db Make FirstTarget treat HostCross separately from Host
Use Target.Os and Target.HostCross as the key in FirstTarget so that
it returns a separate target for host and host cross architectures.
This is useful when host and host cross are both linux_musl, but
host cross is an independenct architecture like arm64.

Also filter the targets returned by ctx.MultiTargets() to match
the HostCross value of ctx.Target() to prevent the newly created
HostCross variants from colliding with Host variants in JNI or
test data attached to Java targets using a common arch.

This relands If75790001afe9d0f9d4d8166f207847851812297 with the
addition of the ctx.MultiTargets() filtering.

Bug: 236052820
Test: TestArchMutator
Change-Id: Ia6fe1185915d174d0ad6b401c227e0e57bee5c24
2022-08-22 14:36:13 -07:00
Dan Albert
237d1710f9 Merge "Drop support for KitKat." 2022-08-22 18:53:48 +00:00
Zhenhuang Wang
409d27712f Add a new test_options.tags attribute to customize test execution
The `test_options.tags` attribute provides additional metadata to
customize test execution by downstream test runners. The tags have no
special meaning to Soong.

Bug: 240928948
Test: manually add `test_options.tags` attribute and run:
    $ refreshmod && \
      cat out/target/product/generic/module-info.json |\
      grep <tags>
Change-Id: I35267f6608e48c6184e56530ef128d93b2f97522
2022-08-22 08:16:17 +00:00
Dan Albert
6bfb6bbde4 Drop support for KitKat.
The NDK is dropping support for this.

Bug: https://github.com/android/ndk/issues/1751
Test: treehugger
Change-Id: I6c03dfc364e7612ce4f45fb58746726983cf5b74
2022-08-19 20:56:28 +00:00
Treehugger Robot
b605679440 Merge "Bluetooth available hack" 2022-08-19 20:54:17 +00:00
Vinh Tran
88b3ba2ae2 Merge "Convert filegroup with AIDL srcs to aidl_library" 2022-08-19 20:36:10 +00:00