Commit graph

4259 commits

Author SHA1 Message Date
Colin Cross
a00cb70910 Merge "Add SortedStringValues and SortedUniqueStringValues" 2022-02-18 03:39:10 +00:00
Colin Cross
9eb853bcf2 Add SortedStringValues and SortedUniqueStringValues
Add SortedStringValues and SortedUniqueStringValues that return the
values of a string-valued map.  Also make the SortedStringKeys
function use a similar implementation with MapRange, which avoids
iterating over the keys twice, once in MapKeys to build the list
of key reflect.Values and once over the reflect.Values to convert
them to strings.

Test: util_test.go
Change-Id: I4fc990a5036421e8926094ee158fafe606d0f10b
2022-02-17 15:52:07 -08:00
Yu Liu
9d7d9810e2 Merge "Enable cc_binary in mixed build." 2022-02-17 21:54:04 +00:00
Yu Liu
7f3605fee1 Enable cc_binary in mixed build.
Bug: 216114082
Test: Run mixed build on adbd apex and verify the pavkaged adbd binary;
add unit test.
Change-Id: Id11549a7952a7ce5ac02988b88b747bbfe8339ff

Change-Id: If01efe076c223886278f466b65628602bff3a964
2022-02-17 11:15:59 -08:00
Anton Hansson
97d0bae750 Add base sdk extension version to the config
So that it can be used by prebuilt_apis in follow-up CLs.

Bug: 220086085
Test: m nothing && inspect soong.variables
Change-Id: If987b8aef9802c52a751ea5351cab2a3df6f2e00
2022-02-17 11:17:21 +00:00
Treehugger Robot
37575bcc6d Merge "Add sepolicy prebuilt API dirs to soong config" am: 1d7209b820
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1984570

Change-Id: Ifc0ae37046368f91913231ccaca4b864638c42fe
2022-02-17 01:46:44 +00:00
Treehugger Robot
1d7209b820 Merge "Add sepolicy prebuilt API dirs to soong config" 2022-02-17 01:26:04 +00:00
Treehugger Robot
7eed46b65b Merge "Keep build/bazel/ci/dist/BUILD for bp2build." am: 632d0a03ed
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1976970

Change-Id: Ie155c4cb566de460825730b99a12a6b39f65f6fa
2022-02-16 16:30:33 +00:00
Treehugger Robot
632d0a03ed Merge "Keep build/bazel/ci/dist/BUILD for bp2build." 2022-02-16 16:14:26 +00:00
Jingwen Chen
41bd3efc00 Add error_prone_checkerframework_dataflow_nullaway. to bp2build denylist. am: eb2a3fd367
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1988326

Change-Id: I8d13f62cbc4cb2915895032d7b2f08f58af8c807
2022-02-16 15:49:23 +00:00
Jingwen Chen
eb2a3fd367 Add error_prone_checkerframework_dataflow_nullaway. to bp2build denylist.
Bug: 219908977
Change-Id: Ia6a0879d9af7aabadb5cd5722ddfdf72f579e621
Test: CI
2022-02-16 13:03:29 +00:00
Liz Kammer
2c2afe26ea Fix typos in arch_list and do variant validation
Test: m nothing
Change-Id: Icfbc9f886a1e16abe02bf6c61671b8187a699942
2022-02-15 17:26:35 -05:00
Sam Delmerico
c768102bce convert java proto libraries with bp2build
Allow java_libraries that depend on protobufs to be converted with
bp2build.

Bug: 215230097
Test: build/bazel/ci/bp2build.sh
Change-Id: I3ce52389e7e4e82755605ee277c1e527a6aebc6b
2022-02-15 21:04:59 +00:00
Liz Kammer
4902daf52f Merge "Correct bp2build canonical_from_root logic" am: 5ee913f527
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1985613

Change-Id: I374352d470b8d0e351de3b47d5a48f87d4ac40ab
2022-02-15 20:57:04 +00:00
Liz Kammer
5ee913f527 Merge "Correct bp2build canonical_from_root logic" 2022-02-15 20:43:57 +00:00
Liz Kammer
7756c8f20e Correct bp2build canonical_from_root logic
The logic was inverted from what it should have been,
canonical_from_root --> no strip_import_prefix attribute.

Test: build/bazel/ci/bp2build.sh
Test: build/bazel/ci/mixed_droid.sh
Change-Id: Ic6685d8f0b88279d4444bab3b5e03a544d225f77
2022-02-15 09:54:57 -05:00
Xin Li
91c585812c Merge "Merge sc-v2-dev-plus-aosp-without-vendor@8084891" into stage-aosp-master 2022-02-14 17:30:12 +00:00
Inseob Kim
1a0afcc05b Add sepolicy prebuilt API dirs to soong config
Bug: 33691272
Test: build
Change-Id: Ia7e750ea9d172d81d2ce0bc330e4f7f149c6fdb8
2022-02-14 23:10:51 +09:00
Colin Cross
7b2e5cd134 Merge changes Ibd19d9a5,Icfc42ad7,Ieafdcceb
* changes:
  Fix musl clang triple
  Add musl_<arch> and glibc_<arch> properties
  Add libc_musl as a dependency of RuleBuilderCommand.BuiltTool
2022-02-11 23:09:27 +00:00
Treehugger Robot
fc70d4d2be Merge "Support multiple library names per target." 2022-02-11 22:17:17 +00:00
Bob Badour
4101c71e63 Support multiple library names per target.
The prior interface to make supported only a single package name per
target; although, a target might have multiple licenses each with its
own package name.

Bug: 151177513
Bug: 210912771

Test: m all dist
Test: flash; About Phone -> Legal Information -> Third-party licenses

Change-Id: I1db5fcfd4c066afd162adb4eb4177960c7a503bd
2022-02-11 10:36:22 -08:00
Xin Li
daf686db06 Merge sc-v2-dev-plus-aosp-without-vendor@8084891
Bug: 214455710
Merged-In: I4fecfba711c0d3d7a22f4fdf7684924a9457b464
Change-Id: I0587f395e4eef309d76e70764e6b5eaafec0e401
2022-02-11 06:56:21 +00:00
Martin Stjernholm
1ebef5b78c Move functionality to test install rules into testing.go.
In preparation for test in the cc package.

Test: m nothing
Bug: 211770050
Change-Id: I3f6190e102c607a0b6246d78d7bde7fcffa21650
2022-02-10 23:36:06 +00:00
Colin Cross
1aa45b083e Add musl_<arch> and glibc_<arch> properties
Add musl_<arch> and glibc_<arch> properties similar to bionic_<arch>.

Bug: 215802826
Test: m checkbuild
Change-Id: Icfc42ad7b54ee1052f84a46b7c0acffb0a27b236
2022-02-10 11:36:31 -08:00
Colin Cross
9b698b68c9 Add libc_musl as a dependency of RuleBuilderCommand.BuiltTool
Assume calls to RuleBuilderCommand.BuiltTool may refer to a tool
that was built against musl libc, and add it as a dependency
so that it is copied into the sandbox.  This emulates the
behavior of compiling against glibc, which is available from the
host sysroot when running in the sandbox.

Bug: 190084016
Test: m USE_HOST_MUSL=true sdk-repo-build-tools
Change-Id: Ieafdcceb818f9c31595487aab3ffbafba1412b3a
2022-02-10 11:36:31 -08:00
Treehugger Robot
948c340160 Merge "enable auto_service_plugin bazel build" 2022-02-09 17:48:49 +00:00
Jingwen Chen
941f0ab807 Keep build/bazel/ci/dist/BUILD for bp2build.
Test: CI
Change-Id: I008672cbf746185c40e7832b70aed6dc564c111c
2022-02-09 13:25:30 +00:00
Liz Kammer
72beb34609 Add package for printing starlark formatted data
Bug: 216168792
Test: build/bazel/ci/bp2build.sh
Change-Id: I3a06b19396f7ffe1c638042cda7e731dd840f1d6
2022-02-08 17:32:28 -05:00
Jingwen Chen
db07f002b8 Merge "Omit musl related cc_genrules from bp2build." 2022-02-08 07:43:51 +00:00
Treehugger Robot
c7bf27ba7a Merge "Export htmlnotice, xmlnotice, and textnotice." 2022-02-08 05:52:14 +00:00
Jingwen Chen
f6b4cd4bcd Omit musl related cc_genrules from bp2build.
These trigger a few failure modes (duplicate genrule srcs, failure in
matching config conditions, depending on unconverted soong_zip host
tool).

Test: CI
Bug: 218405924
Change-Id: I15c119803a057e94ef6a941df3b58103d42eb4e4
2022-02-08 04:47:48 +00:00
Treehugger Robot
217a70e713 Merge "Close opened paths" 2022-02-08 00:33:04 +00:00
Liz Kammer
0fe123dcdf Close opened paths
Test: m nothing
Change-Id: I7fcc8e2fdbca1cd231ff1e72b02156f12078072b
2022-02-07 10:17:35 -05:00
Liz Kammer
2d29982265 Merge "Disable targets broken on host due to missing deps" 2022-02-07 15:16:10 +00:00
Sam Delmerico
4c7069f111 enable auto_service_plugin bazel build
Bug: 215229742
Test: b build --platforms=//build/bazel/platforms:linux_x86
 //external/auto/service:auto_service_plugin
Change-Id: If4ec6e063c603d4be45039d09aa2ec9b60370297
2022-02-04 22:09:03 +00:00
Bob Badour
6076882950 Export htmlnotice, xmlnotice, and textnotice.
Bug: 151177513
Bug: 210912771

Test: m all dist
Test: flash; About Phone -> Legal Information -> Third-party licenses

Change-Id: I9b9e3a67230dae6236ee5c5d6dc6edbc23c5a91d
2022-02-04 11:39:26 -08:00
Sam Delmerico
75664acd70 Merge "add target_compatible_with stanza for host targets" 2022-02-04 19:15:04 +00:00
Liz Kammer
a20b7a72ab Disable targets broken on host due to missing deps
Test: bp2build.sh
Change-Id: I8617c97954deaa985a1ff67cf4ca4d97207f6913
2022-02-04 13:08:03 -05:00
Sam Delmerico
75539d62ae add target_compatible_with stanza for host targets
Soong modules that are specific for the host platform (e.g.
java_library_host, cc_binary_host, java_genrule_host, etc.) should
not be built on the target platform (Android), so we add a
target_compatible_with attribute to skip this type of module on an
Android target build.

Bug: 215229742
Test: go test ./bp2build
Change-Id: Ifb76ef4e0dc4cb3adb6a64b5c375ce36f7973e48
2022-02-03 19:25:12 +00:00
Liz Kammer
35ca77edb6 Allowlist additional com.android.runtime blockers
To unblock mixed builds, uses a common mechanism to determine cc module
type across bp2build and mixed builds.

Test: mixed_droid.sh
Change-Id: I1f69ad0858cda549b7c95dbadd596e46df0f23b2
2022-02-03 11:17:05 -05:00
Martin Stjernholm
827ba622e4 Show all descriptions when failing to find one.
Test: m nothing
Change-Id: Idfac00a94e8e3e90112028f5c2f6949f50d45f31
2022-02-03 00:21:02 +00:00
Sam Delmerico
ca1701f518 Merge changes I09902215,I4f86780c
* changes:
  convert java_plugin with bp2build
  convert java static dependencies
2022-02-02 14:27:32 +00:00
Sam Delmerico
fde9fb5c9c convert java static dependencies
This commit enables conversions of java_library_static and adds the
static_deps Soong attribute to Bazel deps for all Java libraries.
Currently, Soong handles static dependencies for Java differently, and
Bp2build may need to address that later (see b/217236083).

Bug: 215229742
Test: go test ./bp2build
Change-Id: I4f86780c634dca0a2cfb9294084b14e139cc2375
2022-02-01 22:59:04 +00:00
Treehugger Robot
97cffec54e Merge changes from topic "sdk_repo_license"
* changes:
  Generate sdk_repo notice files from license metadata
  Annotate more java dependencies for licensing
  Track transitive packaged license deps of containers
2022-01-31 23:34:59 +00:00
Usta Shrestha
36a0a138ab Merge "cosmetic: 1)typos 2)parameters named for clarity" 2022-01-31 20:19:47 +00:00
Romain Jobredeaux
ea64e62dab Merge "Basic bp2build converter for java_import." 2022-01-29 20:05:08 +00:00
Romain Jobredeaux
428a366703 Basic bp2build converter for java_import.
This only supports the `jars` property/attribute.

Test: b build external/error_prone:error_prone_core_jars
Bug: 215229744
Change-Id: If0d9c8c4e9c1c560d35a501c20bef9361ef45e15
2022-01-29 09:44:37 -05:00
Usta Shrestha
c725f47f5d cosmetic: 1)typos 2)parameters named for clarity
Test: n/a
Bug: n/a
Change-Id: I49faa1d8dec4b729409a45e87212b271ecf9e9d1
2022-01-29 06:34:53 +00:00
Usta Shrestha
defcf8d227 Merge "name parameters for clarity" 2022-01-29 06:33:55 +00:00
Colin Cross
aa1cab0a62 Generate sdk_repo notice files from license metadata
Use the new license metadata files to generate the notice files
for sdk_repo modules.

Bug: 207445310
Test: m sdk_repo_build_tools
Change-Id: I8079061fbdf7417c94eebbb1b31486d3f506f931
2022-01-28 15:56:07 -08:00
Colin Cross
ce56425a6b Annotate more java dependencies for licensing
Annotate more dependencies as runtime linked or toolchain.

Bug: 207445310
Test: m checkbuild
Change-Id: Ia5dc3321a1e476b16058eee94d6dc494fe1e933e
2022-01-28 15:42:06 -08:00
Colin Cross
aff21fbf3c Track transitive packaged license deps of containers
Containers generally package the transitive installable
dependencies of their direct dependencies, track them as license
deps.

Bug: 207445310
Test: m checkbuild
Change-Id: Ic8640152cee0e0cfec5e85a1649a8adfd29d517a
2022-01-28 15:42:01 -08:00
Sam Delmerico
2882dcb74b Merge "product variables are consumed via soong injection" 2022-01-27 14:31:08 +00:00
Sam Delmerico
5c32bbf910 product variables are consumed via soong injection
Currently the list of product variables and whether they are arch-variant is
hard-coded. Instead, we can generate this data from the Soong Product_variables
struct and use soong_injection to consume it in Bazel.

Bug: 209801976
Test: m bp2build && build/bazel/ci/mixed_libc.sh
Change-Id: I8a91030950407a10832765f15eb010899d73da26
2022-01-26 19:26:09 +00:00
Liz Kammer
91ee673ccd Merge "Reverse order of tag and android module checks" 2022-01-26 18:53:40 +00:00
Liz Kammer
5514698bc8 Reverse order of tag and android module checks
Currently, this checks validates a module then checks the tag for all
modules. However, we don't need to validate modules where the tag does
not apply.

Test: m nothing and compare ninja/mk files
Change-Id: I6298c9dc8aa37ffac74202bea59f4090fff90e4e
2022-01-24 16:17:30 -05:00
Sorin Basca
18ecf61090 Revert^2: "Setting Java 11 as the default version"
Reverted Change: I2f9866deff41406aede24758f6eda5e5808c7f29

Reason for revert: Post-submission failure have been fixed.

Test: presubmit
Bug: 195387473
Change-Id: If5db1614ef455e2f1eae1d36cf514e13e7aab993
2022-01-24 13:31:05 +00:00
Romain Jobredeaux
f49ca9e40d Merge "Revert "Revert "Add static_libs support to android_app bp2build converter.""" 2022-01-21 20:51:06 +00:00
Sam Delmerico
cd1b80f067 bp2build converts java_genrule and java_genrule_host
Bp2build currently supports building genrules for cc modules, but does
not support building java_genrule* modules. This commit adds this
functionality.

Bug: 213480907
Test: go test ./bp2build
Change-Id: I473196c5bcf5582ba0c8faa65b5005f81ac973a4
2022-01-21 17:50:40 +00:00
Sorin Basca
e7421c15dd Merge "Revert "Setting Java 11 as the default version"" 2022-01-20 15:38:50 +00:00
Sorin Basca
8d3e0bb25e Revert "Setting Java 11 as the default version"
Revert submission 1944928-default-java11

Reason for revert: Post-submit failures
Reverted Changes:
Ia9a0aa2a4:Setting Java 11 as the default version
Ibf5d10521:Setting Java 11 as the default version

Fixes: 215504708
Fixes: 215502091
Fixes: 215502091
Change-Id: I2f9866deff41406aede24758f6eda5e5808c7f29
2022-01-20 15:37:11 +00:00
Sorin Basca
2c32bbfd73 Merge "Setting Java 11 as the default version" 2022-01-20 09:00:32 +00:00
Romain Jobredeaux
355851b520 Revert "Revert "Add static_libs support to android_app bp2build converter.""
This reverts commit b33e0b8b5b.

Reason for revert: CI failure deemed to be a fluke

Change-Id: Ia804d531092921e4ad090740420c4a4e02e6ff00
2022-01-19 21:13:51 +00:00
Jingwen Chen
539d41b686 Merge "Support multilib in apex." 2022-01-19 11:11:05 +00:00
Yu Liu
4ae55d17f6 Support multilib in apex.
Bug: b/208325023
Test: Added unit tests, also tested with adbd apex build manually.
Change-Id: I47e04cd4eb5d05227f0a84683dcb66dff00e3514
2022-01-18 10:38:05 -08:00
Sorin Basca
171c2103b8 Setting Java 11 as the default version
Test: m
Change-Id: Ia9a0aa2a4aa02d7b67ad8e1cb6083d33c3d75e70
2022-01-18 09:05:34 +00:00
Jingwen Chen
0ee88a6b65 Implement stubs.symbol_file and stubs.versions for cc_library_shared bp2build.
This CL turns the stubs.symbol_file and stubs.versions properties into
stubs_symbol_file and stubs_version attributes on the cc_shared_library
target. See associated build/bazel change on how these attributes are
used to generate stub libraries.

Bug: 207812332

Test: New tests
Test: CI
Change-Id: Ie23eafb9903a131d92ff4e251215e998cea0a763
2022-01-17 13:03:12 +00:00
Usta
6b1ffa423d name parameters for clarity
Change-Id: If1879de10586b89aa572d04d5ad4e6157f2f4f30
2022-01-15 01:42:19 -05:00
Treehugger Robot
276f51d23f Merge "Start unblocking com.android.runtime deps" am: 8f5399889b am: f3564950a1 am: 713266a4e6
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1925162

Change-Id: I3ef37d713a3d5f2988f7b717d6511c7201b5c4d1
2022-01-13 20:48:58 +00:00
Treehugger Robot
8f5399889b Merge "Start unblocking com.android.runtime deps" 2022-01-13 19:57:01 +00:00
Romain Jobredeaux
c19a2c16bd Merge "Revert "Add static_libs support to android_app bp2build converter."" am: 8a9a97b4a0 am: 474eddd20b am: 9b36f4b981
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1948756

Change-Id: Ic81994d5f78334f08bef258f017ff2a2e9b5a353
2022-01-13 17:44:21 +00:00
Romain Jobredeaux
8a9a97b4a0 Merge "Revert "Add static_libs support to android_app bp2build converter."" 2022-01-13 17:03:26 +00:00
Romain Jobredeaux
9dbe366934 Merge "Add static_libs support to android_app bp2build converter." am: 24431448b2 am: 6eae04a33f am: 519e09f11d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1917405

Change-Id: Ib9c373d70eb13087ea0e68230b7f882080e5ceb6
2022-01-13 15:43:27 +00:00
Romain Jobredeaux
b33e0b8b5b Revert "Add static_libs support to android_app bp2build converter."
This reverts commit de722acd96.

Reason for revert: broke bp2build CI

Change-Id: I535e8746e846c20f1a47c2a1eb0362276af49206
2022-01-13 15:16:12 +00:00
Romain Jobredeaux
24431448b2 Merge "Add static_libs support to android_app bp2build converter." 2022-01-13 15:00:44 +00:00
Martin Stjernholm
e6ccbe1336 Merge "Fix genrule tool dependencies when a prebuilt tool is preferred." am: 3a1a4b070e am: 6656d4671a am: e163811966
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1946708

Change-Id: I467115735957d366735cd684c52ccd7d27c489cf
2022-01-13 08:24:36 +00:00
Martin Stjernholm
3a1a4b070e Merge "Fix genrule tool dependencies when a prebuilt tool is preferred." 2022-01-13 07:43:15 +00:00
Martin Stjernholm
dbd814d44e Fix genrule tool dependencies when a prebuilt tool is preferred.
Since the genrule tool dep mutator runs after the prebuilt mutators,
this adds a helper function android.PrebuiltGetPreferred to resolve the
source or prebuilt as appropriate.

Test: m SOONG_CONFIG_art_module_source_build=false droid
  in internal
Bug: 214292395
Change-Id: I1a208fd048b998f9f19ad1f45d8389decda2cb9e
2022-01-12 23:35:57 +00:00
Sam Delmerico
099abc955e Merge "Support enabled flag in product variable config" am: 443703ab32 am: 0b75591af3 am: f76b955589
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1944064

Change-Id: I52161d9e48f3456f967816b471adeff34d0e8ec7
2022-01-12 21:18:00 +00:00
Sam Delmerico
443703ab32 Merge "Support enabled flag in product variable config" 2022-01-12 20:34:14 +00:00
Sam Delmerico
0e33c9d772 Support enabled flag in product variable config
Some Android.bp modules have `enabled: false` but only use a product
variable such as `source_build` to enable the module.  Currently b2build
does not handle this case at all. This commit adds the functionality
to support this use case.

Also, remove `__enabled` suffix in ProductVariable SelectKey.

Bug: 210546943
Test: go test ./bp2build
Topic: use_enabled_flag_product_variable_config
Change-Id: I459c17a84c172df010666391066bf4d11d19253e
2022-01-12 16:26:44 +00:00
Liz Kammer
4d7be9bab5 Merge "Add SetProperties to json-module-graph" am: adf1b2a2cd am: b6fdee8f0a am: bbd97028b8
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1937639

Change-Id: Ida7e56de037ef33121705423ae3c77251b1b4e98
2022-01-12 14:05:45 +00:00
Liz Kammer
4e491af625 Merge "Revert "Revert "bp2build: convert host & prebuilt header libraries""" am: e844132b85 am: 86151370ef am: d490d54259
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1944329

Change-Id: I7eb514bc4e0e98d0a8f77ee708d5356b86b921a3
2022-01-12 14:05:28 +00:00
Liz Kammer
adf1b2a2cd Merge "Add SetProperties to json-module-graph" 2022-01-12 13:23:33 +00:00
Liz Kammer
e844132b85 Merge "Revert "Revert "bp2build: convert host & prebuilt header libraries""" 2022-01-12 13:23:16 +00:00
Liz Kammer
3d3b35c94e Revert "Revert "bp2build: convert host & prebuilt header libraries""
This reverts commit 105deedfc7.

Reason for revert: Revert with forward fix

Change-Id: Ib0b6f6b1cbb011b4c5f2133e1cc15ec76ff29253
2022-01-11 16:02:50 +00:00
Jingwen Chen
a7cf23531e Merge "Revert "bp2build: convert host & prebuilt header libraries"" am: ed4900f9d9 am: 4c909dcd5e am: 446f85be40
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1944703

Change-Id: I9e21377fba0a9f34c88e4555c264dc8542e57fad
2022-01-11 15:51:40 +00:00
Liz Kammer
9525e71003 Add SetProperties to json-module-graph
SetProperties contains name and type of properties set in the bp file
and any set via defaults. There may be properties that were not
specified in an Android.bp file due to:
* specified via go code (e.g. LoadHooks)
* property is _not_ a pointer -- so it is not possible to tell between
  not set in bp file and default value.

Test: soong tests
Test: m json-module-graph and verify
Change-Id: I4cb868b1d7db566e72636c6fb53bb9c7090f236a
2022-01-11 10:47:23 -05:00
Jingwen Chen
ed4900f9d9 Merge "Revert "bp2build: convert host & prebuilt header libraries"" 2022-01-11 14:58:56 +00:00
Jingwen Chen
105deedfc7 Revert "bp2build: convert host & prebuilt header libraries"
This reverts commit d8a72d7dc9.

Reason for revert: root cause for b/214013899

Change-Id: If769708408c419c2fd3d9484fbf40202b7276299
2022-01-11 12:51:27 +00:00
Inseob Kim
51c8d94d37 Merge "Revert^3 "Add seapp_contexts to allowlist of makefile goal"" am: 865d5e6c9d am: c24e740cd0 am: 865498319d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1934941

Change-Id: I6eb14ca05494ff8c972068615dfc35dc4e3a303f
2022-01-10 12:12:37 +00:00
Inseob Kim
865d5e6c9d Merge "Revert^3 "Add seapp_contexts to allowlist of makefile goal"" 2022-01-10 11:15:28 +00:00
Treehugger Robot
19d8dd9085 Merge "Use Module.GetProperties() instead of ModuleBase.generalProperties" am: 25656c401b am: 04c5dcf22a am: 4ed2e665d7
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1937381

Change-Id: If51c2c3533b29ec22445bf9a147ff36916b010a2
2022-01-10 09:43:48 +00:00
Treehugger Robot
25656c401b Merge "Use Module.GetProperties() instead of ModuleBase.generalProperties" 2022-01-10 08:49:17 +00:00
Treehugger Robot
dd196cca96 Merge "Add sepolicy compat versions to soong config" am: bac9e97c50 am: 44e4c47c47 am: aff62cef5e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1940897

Change-Id: I6586a86613be1e082c47836329c09eb3b8dabd1f
2022-01-10 03:03:24 +00:00
Treehugger Robot
bac9e97c50 Merge "Add sepolicy compat versions to soong config" 2022-01-10 02:09:23 +00:00
Treehugger Robot
7f06df8c6f Merge "Fix format" am: e508f6a50b am: c6d1139f66 am: fa67fade6f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1940896

Change-Id: Ie1a777ef06bd0ed40ff8f1fc8b34dcbc771f016d
2022-01-08 03:15:10 +00:00
Usta
851a3271ce Use Module.GetProperties() instead of ModuleBase.generalProperties
ModuleBase.generalProperties served the pupose of being a subset
of ModuleBase.customizableProperties. But now with the removal of
the latter, the former is simply a redirection to Module.GetProperties()

Bug: 206961391
Test: m nothing and diff the ninja files
Change-Id: I6dd8b7ba74eb5e7ffb61029b0f9129eec2ccfdaf
2022-01-08 03:09:52 +00:00
Treehugger Robot
e508f6a50b Merge "Fix format" 2022-01-08 02:20:02 +00:00
Treehugger Robot
663d3cb446 Merge "bp2build: convert host & prebuilt header libraries" am: 77d93ba871 am: 012bdc1ff6 am: c3ec8319e4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1927620

Change-Id: I0dca9cb7afeedf3a1ce17a1ea6e5539b776084d5
2022-01-08 02:04:23 +00:00
Treehugger Robot
77d93ba871 Merge "bp2build: convert host & prebuilt header libraries" 2022-01-08 00:55:32 +00:00
Romain Jobredeaux
de722acd96 Add static_libs support to android_app bp2build converter.
With this change we can allow list WifiDirectDemo, as its dependencies
happen to have manual BUILD file conversions.

Test: ./build/bazel/scripts/run_presubmits.sh
Change-Id: I68b4c2b129fe750913f013384c87a5332fdcc9b6
2022-01-07 16:47:14 -05:00
Inseob Kim
843f66461a Add sepolicy compat versions to soong config
Bug: 33691272
Test: build
Change-Id: If90f25540e8fd46e5c76e2a59015d46dd020c431
2022-01-07 19:44:16 +09:00
Inseob Kim
f5ed300dfc Fix format
Test: gofmt
Change-Id: Ib88fea484cb8b71ae940fe8c21b2c687eba2d019
2022-01-07 19:44:11 +09:00
Yi Kong
d9c1af6c5e Merge "Remove mention of libhidlbase_pgo" am: 319eaaa9f5 am: 60458f13b4 am: 7c964d0511
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1933094

Change-Id: I14268684e09e05930fa8783330f8f6897c9a079f
2022-01-06 18:20:18 +00:00
Yi Kong
319eaaa9f5 Merge "Remove mention of libhidlbase_pgo" 2022-01-06 17:42:59 +00:00
Liz Kammer
daa09efb5e Start unblocking com.android.runtime deps
Adds support to warn rather than error about missing deps in order to
suport modules in build/soong with deps outside of build/sooong in
bp2build integration tests.

Test: build/bazel/ci/bp2build.sh
Change-Id: I1282bccd37a3fc9f33555d34e68d7f0873d8272c
2022-01-06 10:40:43 -05:00
Usta Shrestha
81c1dd2638 Merge "Remove customizableProperties from android.ModuleBase" am: 9eab2ef9a4 am: 1df75fdde5 am: f92eb6e8d2
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1929304

Change-Id: I7e12bd9d931653643876cac1a3fa1ded21864b15
2022-01-05 23:29:34 +00:00
Usta
dca0219965 Remove customizableProperties from android.ModuleBase
- customizableProperties was being used to access all properties,
i.e. basically `GetProperties()`

- generalProperties was a subset of properties,
i.e. `initArchModule()` would only add new arch-specific properties
to `customizableProperties` (and `archProperties`) but not `generalProperties`

This PR sets generalProperties to contain all properties,
which then makes customizableProperties redundant.
And in arch.go, any iteration is done via `archProperties` instead.

Bug: 206961391
Test: m nothing and diff the ninja files
Change-Id: Ieb72b31c0a447fcbf34c92a04f002d7b9d777a86
2022-01-04 13:33:51 -05:00
Inseob Kim
a9078747bb Revert^3 "Add seapp_contexts to allowlist of makefile goal"
This reverts commit feb0756d41.

Reason for revert: redundant now

Change-Id: I6cd43f03a28d03a87d19510a554e3bbe0e69b1de
2021-12-29 08:59:19 +00:00
Yi Kong
2b8f5f588f Remove mention of libhidlbase_pgo
This library is getting removed.

Test: presubmit
Change-Id: I10bfb36c07e094881c7254219d3071da6ac687dd
2021-12-27 23:30:39 +08:00
Yi Kong
a093bdbd5b Merge "Introduce afdo" am: 37d0a5790a am: bd0d787fec am: d788f19592
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1917257

Change-Id: Ia767b7dc6d8e823bbc9104dfb2a23e2c1125d9c8
2021-12-23 05:57:13 +00:00
Yi Kong
37d0a5790a Merge "Introduce afdo" 2021-12-23 04:53:29 +00:00
Treehugger Robot
d0956e62be Merge "Added src and exclude_src to debuggable builds" 2021-12-23 03:32:47 +00:00
Liz Kammer
d8a72d7dc9 bp2build: convert host & prebuilt header libraries
Test: bp2build.sh
Change-Id: If8165eac7c17c4eef3686067257aa792121db59d
2021-12-22 16:34:27 -05:00
Christopher Parsons
5f81eb4dd6 Merge "Handle the 'enabled' property in bp2build" am: 948e851b83 am: fdb30910fc am: e40c2f5076
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1917398

Change-Id: I5a60df27f103b10f55abc35852f1ffd08c3338cb
2021-12-22 16:42:37 +00:00
Jay Aliomer
2599d1d120 Added src and exclude_src to debuggable builds
Fixes: 200976245
Test: manually tested
Change-Id: I68b6230f30aa2c15e6a80010cd639ea453b4b29e
Merged-In: I68b6230f30aa2c15e6a80010cd639ea453b4b29e
(cherry picked from commit 85a8afa9e7)
(cherry picked from commit 778582f415)
2021-12-22 18:05:34 +09:00
Chris Parsons
58852a05f3 Handle the 'enabled' property in bp2build
Also fix some bugs pertaining to configurable attribute handling of bool
attributes and label sttributes, so that they may support values across
multiple different axes at the same time.

Test: unit tests for bp2build
Test: mixed_droid

Change-Id: I411efcfddf02d55dbc0775962068a11348a8bb2c
2021-12-21 16:37:32 -05:00
Treehugger Robot
4712720e76 Merge "Add comments and clarify errors in neverallow" am: 68542bfcb5 am: fee1c91a2e am: a185769983
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1874483

Change-Id: Ie5010c7a89859779b4b97324c629c480df23d428
2021-12-21 20:25:39 +00:00
Treehugger Robot
68542bfcb5 Merge "Add comments and clarify errors in neverallow" 2021-12-21 19:28:36 +00:00
Liz Kammer
091e30666e bp2build remove "-std" from cflags am: cac7f690eb am: 547bdc5207 am: 7b901cb0fb
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1927501

Change-Id: I468f8accaaf37502c10e0392e217d56ce016c551
2021-12-21 19:19:00 +00:00
Liz Kammer
a3d7915c9e Add comments and clarify errors in neverallow
Sample of new error for violation:

error: system/bt/gd/rust/topshim/macros/Android.bp:10:1: module
"libtopshim_macros" variant "linux_glibc_x86_64": violates neverallow
requirements. Not allowed:
        module types: ["rust_benchmark" "rust_benchmark_host"
"rust_binary" "rust_binary_host" "rust_library" "rust_library_dylib"
"rust_library_rlib" "rust_ffi" "rust_ffi_shared" "rust_ffi_static"
"rust_fuzz" "rust_library_host" "rust_library_host_dylib"
"rust_library_host_rlib" "rust_ffi_host" "rust_ffi_host_shared"
"rust_ffi_host_static" "rust_proc_macro" "rust_test" "rust_test_host"]
      EXCEPT in dirs: ["device/google/cuttlefish/"
"external/adhd/" "external/crosvm/" "external/libchromeos-rs/"
"external/minijail/" "external/rust/" "external/selinux/libselinux/"
"external/uwb/" "external/vm_tools/p9/"
"frameworks/native/libs/binder/rust/" "frameworks/proto_logging/stats/"
"packages/modules/DnsResolver/" "packages/modules/Virtualization/"
"prebuilts/rust/" "system/core/libstats/pull_rust/"
"system/extras/profcollectd/" "system/extras/simpleperf/"
"system/hardware/interfaces/keystore2/" "system/librustutils/"
"system/logging/liblog/" "system/logging/rust/" "system/nfc/"
"system/security/" "system/tools/aidl/"
"tools/security/fuzzing/example_rust_fuzzer/"
"tools/security/fuzzing/orphans/" "vendor/"]

Old error:

error: system/bt/gd/rust/topshim/macros/Android.bp:10:1: module
"libtopshim_macros" variant "linux_glibc_x86_64": neverallow
-dir:device/google/cuttlefish/* -dir:external/adhd/*
-dir:external/crosvm/* -dir:external/libchromeos-rs/*
-dir:external/minijail/* -dir:external/rust/*
-dir:external/selinux/libselinux/* -dir:external/uwb/*
-dir:external/vm_tools/p9/* -dir:frameworks/native/libs/binder/rust/*
-dir:frameworks/proto_logging/stats/*
-dir:packages/modules/DnsResolver/*
-dir:packages/modules/Virtualization/* -dir:prebuilts/rust/*
-dir:system/core/libstats/pull_rust/* -dir:system/extras/profcollectd/*
-dir:system/extras/simpleperf/*
-dir:system/hardware/interfaces/keystore2/* -dir:system/librustutils/*
-dir:system/logging/liblog/* -dir:system/logging/rust/*
-dir:system/nfc/* -dir:system/security/* -dir:system/tools/aidl/*
-dir:tools/security/fuzzing/example_rust_fuzzer/*
-dir:tools/security/fuzzing/orphans/* -dir:vendor/*
type:"rust_benchmark" type:"rust_benchmark_host type:rust_binary
type:rust_binary_host type:rust_library type:rust_library_dylib
type:rust_library_rlib type:rust_ffi type:rust_ffi_shared
type:rust_ffi_static type:rust_fuzz type:rust_library_host
type:rust_library_host_dylib type:rust_library_host_rlib
type:rust_ffi_host type:rust_ffi_host_shared type:rust_ffi_host_static
type:rust_proc_macro type:rust_test type:rust_test_host

Test: go test soong tests
Change-Id: I1a7ee6bbc8258dfffa5a76f02c12fb1e54fdba1a
2021-12-21 12:00:43 -05:00
Liz Kammer
cac7f690eb bp2build remove "-std" from cflags
Soong overrides "-std" flags when provided via cppflags or conlyflags;
however, any user-provided "-std=" cflag will be overridden by Soong's
std flag handling.

For Bazel, we _always_ allow user to override via user provided flags.
To prevent conflicts, we remove the silently ignored values from
Android.bp files in the bp2build conversion.

Test: build/bazel/ci/bp2build.sh
Test: build/bazel/ci/mixed_droid.sh
Change-Id: I4c33b2ae593a7ff3ff8e3ad15ef3461354fc0c83
2021-12-21 11:49:01 -05:00
Liz Kammer
cc3dd1e941 Merge "Fix typo in bp2build denylist." am: 5166a1c707 am: 1acfbe98bb am: 3f304d2d7e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1927621

Change-Id: I1851b0606a2707f8b78b3aff5787e4134e8cfdd8
2021-12-21 16:31:48 +00:00
Liz Kammer
5166a1c707 Merge "Fix typo in bp2build denylist." 2021-12-21 15:44:27 +00:00
Sorin Basca
cae602eee3 Merge "Adding option to include sources only for Java 11 builds" am: 55f84a74c5 am: d0ade7a7f8 am: c9b9540233
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1927441

Change-Id: I0bbe60a35917f8945bf0a8f5b794293b44cd2c5b
2021-12-21 08:18:45 +00:00
Yi Kong
eb8efc902d Introduce afdo
A new configuration rule for sampling PGO. This differs from the
original pgo.go rule in the following ways:
 * Automatic propagation to static dependencies
 * Simpler configuration (just put `afdo: true` to optimsation targets)

http://go/android-afdo

Test: build
Bug: 79161490
Change-Id: Ie194824cd523bca19e10ced41d2078fc598f13b3
2021-12-21 16:09:23 +08:00
Inseob Kim
d128b2d644 Merge "Add sepolicy prebuilt directories to soong_config" am: 1778546f7a am: 0245bbe0e1 am: 938f382579
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1925909

Change-Id: Id1ec535922b9041a6892a6f1e6c237c26563efa7
2021-12-21 07:39:44 +00:00
Sorin Basca
55f84a74c5 Merge "Adding option to include sources only for Java 11 builds" 2021-12-21 07:37:46 +00:00
Inseob Kim
1778546f7a Merge "Add sepolicy prebuilt directories to soong_config" 2021-12-21 07:09:58 +00:00
Sorin Basca
9347ae3ba0 Adding option to include sources only for Java 11 builds
Bug: 207852002
Test: m
Test: EXPERIMENTAL_TARGET_JAVA_VERSION_11=true m
Change-Id: I554a79798ea7f1dd4a96b09f761090f83a009cb4
2021-12-20 21:33:14 +00:00
Jiakai Zhang
3a3250f40e Merge changes I8f4eaed1,I358a62d3 am: 880e11112d am: 02d1c10b3a am: 58fe40abc1
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1928068

Change-Id: I3b312ffc40a2499676fd8f5219017aa8f86d1911
2021-12-20 21:11:58 +00:00
Jiakai Zhang
880e11112d Merge changes I8f4eaed1,I358a62d3
* changes:
  Dexpreopt standalone system server jars from prebuilts.
  Dexpreopt standalone system server jars.
2021-12-20 19:52:37 +00:00
Jiakai Zhang
389a647320 Dexpreopt standalone system server jars.
Standalone system server jars are dynamically loaded by system server
using a `PathClassLoader` whose parent is `SYSTEMSERVERCLASSPATH`. They
are listed in `PRODUCT_STANDALONE_SYSTEM_SERVER_JARS` and
`PRODUCT_APEX_STANDALONE_SYSTEM_SERVER_JARS` in Makefile. We need to
dexpreopt them to achieve better performance.

Bug: 203198541
Test: m nothing
Test: -
  1. Add a standalone system server jar (e.g., by patching
     aosp/1906158)
  2. Build a system image.
  3. See the odex and vdex files generated in
     $ANDROID_PRODUCT_OUT/system/framework/oat/
  4. Flash the image to a device.
  5. Run `atest art_standalone_dexpreopt_tests`.
Change-Id: I358a62d34989c5c8eba12e18fe6167e0b72ff69d
2021-12-20 15:07:26 +00:00
Treehugger Robot
8ef2179a6e Merge "Remove InstallBypassMake and ToMakePath" am: f1228f570a am: a9f335cf5a am: fd865c6688
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1889722

Change-Id: I03ff465d17fb4625b8b5e7dc535c5791e87d204d
2021-12-17 07:19:06 +00:00
Treehugger Robot
f1228f570a Merge "Remove InstallBypassMake and ToMakePath" 2021-12-17 06:15:16 +00:00
Treehugger Robot
aed3014477 Merge "Remove some unblocked items from the denylist" am: 86baf3e191 am: c64fa15c3a am: aa5f57db49
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1911671

Change-Id: I17fb1dec44e797a218feaf59b9bcf99c0781b4ff
2021-12-16 23:14:38 +00:00
Liz Kammer
9460b46ea2 Fix typo in bp2build denylist.
Test: m bp2build and ensure libnativehelper_compat_libc++ not converted
Change-Id: I3dddda6c19a0105aa89f2015ae329935862ef73e
2021-12-16 16:21:23 -05:00
Liz Kammer
3e0151688a Merge "Add external/libpng" am: 911e9f8654 am: 157d11bf2b am: d108041835
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1924581

Change-Id: Iaeb24ba46d7806d7557347b989ab47eccb224961
2021-12-16 20:45:44 +00:00
Treehugger Robot
4f388fc602 Merge "Allowlist directory for com.android.adbd." am: 8c495942c2 am: 6a37e0e485 am: b40a89da08
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1922098

Change-Id: I72bca937165403198f4d75d2b3ee150362b42c39
2021-12-16 20:44:50 +00:00
Treehugger Robot
cec672ffa9 Merge "Make all defaults modules bazelable" am: 3eed7f9a8b am: 3434f3734f am: 1cff15e0b1
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1924162

Change-Id: I12a3495cecd4545275ac65c6a936ba6d40321e1b
2021-12-16 20:44:28 +00:00
Treehugger Robot
4390ce8c50 Merge "Remove unused functions" am: c42b19f0a8 am: 27c1ec557b am: b265dff352
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1924157

Change-Id: I8477d469c21c8e19a99e389735f53056c09e98aa
2021-12-16 20:44:12 +00:00
Liz Kammer
5c31358f86 Remove some unblocked items from the denylist
Test: bp2build.sh
Test: mixed_libc.sh
Change-Id: Iaef35cd2eb1ec2efb467548b1630f686f84aac2a
2021-12-16 13:34:02 -05:00
Liz Kammer
911e9f8654 Merge "Add external/libpng" 2021-12-16 14:04:49 +00:00
Treehugger Robot
8c495942c2 Merge "Allowlist directory for com.android.adbd." 2021-12-16 01:50:31 +00:00
Treehugger Robot
3eed7f9a8b Merge "Make all defaults modules bazelable" 2021-12-16 01:36:47 +00:00
Treehugger Robot
c42b19f0a8 Merge "Remove unused functions" 2021-12-16 00:58:07 +00:00
Inseob Kim
0f46e7ca88 Add sepolicy prebuilt directories to soong_config
These are used when we build vendor sepolicy against old plat sepolicy.

Bug: 33691272
Test: build
Change-Id: Ia4fea509a2e122f24d1669a0908c4b3d2bb3b32c
2021-12-16 09:50:44 +09:00
Colin Cross
c68db4b305 Remove InstallBypassMake and ToMakePath
InstallBypassMake and ToMakePath are obsolete, remove them.

Bug: 204136549
Test: m checkbuild
Change-Id: Ie5a6f7254b3d317ed6039e114ed6aec35e1ce273
2021-12-15 15:22:53 -08:00
Liz Kammer
6fb30b62e0 Merge "bp2build: Expand check if filegroup contains proto" am: b849d4a6d5 am: ccdd5a8de4 am: 774e8930d5
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1916846

Change-Id: Idac17bbc93d169b59d27837bee8f6b2f6c956947
2021-12-15 21:25:12 +00:00