Commit graph

3971 commits

Author SHA1 Message Date
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
Treehugger Robot
8f5399889b Merge "Start unblocking com.android.runtime deps" 2022-01-13 19:57:01 +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
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
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
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
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
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
865d5e6c9d Merge "Revert^3 "Add seapp_contexts to allowlist of makefile goal"" 2022-01-10 11:15:28 +00:00
Treehugger Robot
25656c401b Merge "Use Module.GetProperties() instead of ModuleBase.generalProperties" 2022-01-10 08:49:17 +00:00
Treehugger Robot
bac9e97c50 Merge "Add sepolicy compat versions to soong config" 2022-01-10 02:09:23 +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
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
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
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
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
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
68542bfcb5 Merge "Add comments and clarify errors in neverallow" 2021-12-21 19:28:36 +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
5166a1c707 Merge "Fix typo in bp2build denylist." 2021-12-21 15:44:27 +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
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