Commit graph

4402 commits

Author SHA1 Message Date
Treehugger Robot
a0bab18a47 Merge "Clean up minSdkVersionAllowlist" 2022-05-03 09:00:15 +00:00
Treehugger Robot
a6fcf9fd92 Merge "Remove unused uses_sdks property for apexes" 2022-05-03 03:24:59 +00:00
Jooyung Han
c743039b48 Clean up minSdkVersionAllowlist
These modules have min_sdk_version set. No need to keep them in
allowlist.

Bug: 158059172
Test: m
Change-Id: Id9d3c62f4da941f26212ce69637469d82758c935
2022-05-02 12:38:26 +09:00
Christopher Parsons
f485a95d3a Merge "Preserve depset structure from bazel aquery" 2022-04-29 14:49:31 +00:00
Victor Chang
99666e2720 Merge "Revert "Fix erroneous "Field requires API level 33 (current min is 32)" warnings"" 2022-04-29 10:34:41 +00:00
Nataniel Borges
5d80d895b6 Revert "Fix erroneous "Field requires API level 33 (current min is 32)" warnings"
This reverts commit 8b7f627f30.

Reason for revert: b/230821289

Change-Id: I3032103b174c78586b38b64d2748ec5a42fa9522
2022-04-29 09:49:16 +00:00
Treehugger Robot
979a64f810 Merge "Clean up min_sdk_version allowlist" 2022-04-29 02:22:24 +00:00
Vinh Tran
3ac6daf47c bp2build converts java_version property to javacopts attribute
This CL also converts `external/rappor` (which already set `java_version` to `1.7`) to be bazelable to testify the changes.

Results from `b build //external/rappor && cat bazel-bin/external/rappor/librappor.jar-0.params`: https://paste.googleplex.com/5518725462622208.

Test: go test ./bp2build/...
Bug: 227618664
Change-Id: I8d370d4639f70fba51e6de6ceb7bcb5ace9ccd91
2022-04-28 18:52:48 -04:00
Treehugger Robot
184a6b87e5 Merge "Prototype changes for multitree" 2022-04-28 22:20:47 +00:00
Chris Parsons
1a7aca075b Preserve depset structure from bazel aquery
Each depset now corresponds to a phony rule which depends on other
depsets or on full paths; thus, bazel's depset structure is preserved in
the form of phony rules of name bazel_depset_{id}.

Previously, flattening and recopying large lists of file path strings
was quite inefficient. This was particularly evident as we enumerated
hundreds of clang headers for each cc compile action.

This reduces soong_build analysis time by about 30% for mixed builds.
It also reduces ninja file size by ~750MB.

Fixes: 229405615
Test: Unit tests, manually verified metrics, mixed_droid CI

Change-Id: I78df152ac1488ae0c6807afdde4b4ad5e6d26287
2022-04-28 12:44:28 -04:00
Inseob Kim
5eb7ee9fad Prototype changes for multitree
This change contains a prototype implementation for multitree. Several
interfaces and modules are added.

1. Imported/Exported
Modules implementing Exportable interface can export artifacts to other
components. "imported_filegroup" modules can import generated artifacts from other exported modules.

2. Multitree metadata
It contains information about imported/exported modules in each
component, and can be generated via "m update-meta".

3. cc library stub
It's based on prototype stub libraries. It uses imported/exported
mechanism to expose a C API, with a map.txt file and header files.

Bug: 230448564
Test: m
Change-Id: Id7ff7618e2c630c5617a564d8b23b60a1cc9c8e8
2022-04-28 08:20:10 +00:00
Cole Faust
8b7f627f30 Fix erroneous "Field requires API level 33 (current min is 32)" warnings
Bug: 215567981
Bug: 204776549
Test: m out/soong/.intermediates/frameworks/base/framework-minus-apex/android_common/lint/lint-report.xml, then check that that file doesn't have any of these warnings
Change-Id: I39aa2228474630c93250bf5833ac6bd9bbadcc7f
2022-04-27 12:20:08 -07:00
Treehugger Robot
60fe34a79d Merge "Share CreateModule between hooks & mutators" 2022-04-27 16:00:35 +00:00
Treehugger Robot
266cf08ac6 Merge "Add buildinfo_prop module" 2022-04-27 13:00:36 +00:00
Jingwen Chen
c172816439 bp2build: Denylist new module that has a dependency on unconverted go binaries.
Test: CI
Change-Id: I2763d3371f32850732303110fc13a5b44a4f14fe
2022-04-27 09:56:33 +00:00
Inseob Kim
4f1f3d97ca Add buildinfo_prop module
buildinfo_prop module is a replacement for build/make/tools/buildinfo.sh
so other images like microdroid can refer to build.prop.

For now, buildinfo_prop only supports a few build.prop properties, and
it's only used in microdroid.

Bug: 189164487
Test: build
Change-Id: I120654ca23a68de414df8da2051c6677afbab441
2022-04-27 14:10:52 +09:00
Liz Kammer
f31c90050c Share CreateModule between hooks & mutators
These contained duplicate code, but evolved separately in the effort to
identify module type of those created with CreateModule. This refactors
to share a common implementation between the two.

Test: m json-module-graph and verify Type fields
Test: CI
Change-Id: Ifdb9a006d9b1bef7411f9ce3a4384797693b4bfc
2022-04-26 09:08:55 -04:00
Jooyung Han
036ef1f8f6 Clean up min_sdk_version allowlist
Hard-coded min_sdk_version is not necessary for kotlinx-* modules
because they are already marked by updater script.

Bug: 158059172
Test: m nothing
Change-Id: I42cf26c9390244f93059af68027cca4f8518a828
2022-04-26 16:21:28 +09:00
Christopher Parsons
be9b9deef9 Merge "Improve bazel action status mnemonics" 2022-04-25 20:57:17 +00:00
Treehugger Robot
b2d87ef0bd Merge "Bump minimum minSdkVersion to 19." 2022-04-22 03:16:05 +00:00
Liz Kammer
7eed538208 Remove unused uses_sdks property for apexes
Test: m nothing & compare build.ninja before/after
Change-Id: I3f1199af338e1d2e48ec29cf9f59b6b36236c4cc
2022-04-21 11:13:45 -04:00
Alex Márquez Pérez Muñíz Díaz Púras Thaureaux
bff2e88a85 DoNotConvert tzdata nor tz_version
In using prebuilt_file for prebuilt_{etc,usr_share}, Bazel now sees such
targets translated and doesn't permit a target name to alias e.g. its
`src`. Thus we temporarily disable the conversion of the `tz_version` and
`tzdata` whilst their in-tree sources are updated. Their conversions
will be reenabled afterward.

Bug: 215723302
Test: bp2build.sh
Test: mixed_{libc,droid}.sh
Change-Id: Ie19813ccb0fb93c90b54bfd19c909ed15b826385
2022-04-21 14:37:12 +00:00
Dan Albert
862a7c5b5e Bump minimum minSdkVersion to 19.
We need to land an update to the NDK prebuilts and the NDK no longer
supports APIs 16-18.

Bug: https://issuetracker.google.com/228670422
Test: treehugger
Change-Id: I996b0eb65a7d1ae4cc0687b7ed8f533fbbba295d
2022-04-20 22:54:42 +00:00
Treehugger Robot
0c9d27c463 Merge "Install .rc files for ramdisk variants" 2022-04-20 18:07:18 +00:00
Yike Zhang
29f5068a1c Merge "Export Java library dependency information" 2022-04-18 04:58:47 +00:00
Yike
f628202aab Export Java library dependency information
Write `static_libs` and `libs` of Java library and Android app modules to module_bp_java_deps.json. This enables downstream tools to correctly set up the runtime environment. Note that while static libraries don't need to be on the Java classpath these modules could have non-static library dependencies that do need to be present.

Test: m out/soong/module_bp_java_deps.json
Bug: 227538646
Change-Id: I7c4aecb2fb03c890f0d2aaae80e619f6176809ef
2022-04-18 10:23:28 +08:00
Treehugger Robot
d5aa2e0da3 Merge "Remove linux_glibc musl hack" 2022-04-15 00:04:41 +00:00
Treehugger Robot
7e7abd116d Merge "Export listshare and checkshare to Soong and Make" 2022-04-14 22:09:15 +00:00
Sam Delmerico
cc51843e52 add unit test for bp2build allowlist
Test: go test ./android
Change-Id: I0ea1d97444cbedfd285f1fc4bd7ff246ce699dc9
2022-04-14 13:31:09 +00:00
Sam Delmerico
24c5603815 refactor bp2build module allowlists into struct
To make testing easier, refactor existing module-global variables into a
struct that can be mocked.

Test: build/bazel/bp2build.go
Change-Id: I9d177677644ea743641a745b1839a3a8b29f902a
2022-04-14 13:31:05 +00:00
Kelvin Zhang
4697725e81 Install .rc files for ramdisk variants
Previously, we removed .rc files from ramdisk variants because init
isn't reading them. But after generic_ramdisk is introduced, we might
re-use ramdisk variant of snapuserd in recovery, and recovery will need
those .rc fiels. So install .rc files again.

Test: th
Bug: 219841787
Bug: 228893064
Change-Id: I9e6e761f4f2b3a03693567c077c3225669398b86
2022-04-13 19:19:25 -07:00
Bob Badour
470fd6d946 Export listshare and checkshare to Soong and Make
Bug: 151177513
Bug: 213388645
Bug: 210912771

Test: m droid dist reportmissinglicenses
Change-Id: I1a2f2f69df22ec28e3fc016b61341717c6f2b1d2
2022-04-13 11:05:12 -07:00
Jiyong Park
d4a0063d3e Remove apex10000_private variants
When a library is included in two APEXes whose platform_apis settings
are different, two apex variants of the library is created: apex1000 and
apex1000_private.

This change was introduced with ag/15061306, especially by the commit
[1].

However, that part should be reverted because it actually creates
unnecessary variants. It's unnecessary because the two variants of the
library are compiled (excluding the linking) exactly the same. If a
private symbol of its dependency was actually used when compiling the
apex1000_private variant, then the other apex1000 variant wouldn't have
been built because that private symbol must have caused a linkage error.

[1] https://googleplex-android-review.git.corp.google.com/c/platform/build/soong/+/15061306/2..4/android/apex.go#b527).

Bug: 228785792
Test: m
Change-Id: Id58d3e98a51de5e628ca72ef86e9cd11b0ee8971
2022-04-12 12:23:20 +09:00
Chris Parsons
155d768e5f Improve bazel action status mnemonics
Example output line:

```
CppCompile: [bazel-out/android_arm-fastbuild-ST-dd3fdd7bf572/bin/bionic/libc/_objs/libc_bionic_asm/
0/strcpy.o]
```

Instead of just `CppCompile`.

Fixes: 220234318
Test: `m libc` in mixed builds
Change-Id: I3e079006b1f1bb9e8db5b4f022ea993d7693aeb5
2022-04-11 19:17:52 +00:00
Albert Martin
26ef058655 Merge "Flag to globally override apexes' min_sdk_version" 2022-04-11 12:29:09 +00:00
Albert Martin
eefabcf321 Flag to globally override apexes' min_sdk_version
Override all mainline updateable apexes' min_sdk_version
to same version to get single shared native libs on DCLA.

Test: Run "vendor/google/build/go/mainline_go_modules_arm.sh" and inspect built apexes
Bug: 212609891
Change-Id: Ide7d3f2bc772ac6240f1c917b87285d051d6f605
Merged-In: Ide7d3f2bc772ac6240f1c917b87285d051d6f605
2022-04-08 17:51:07 +00:00
Treehugger Robot
a2a7b57924 Merge changes from topic "export-vars"
* changes:
  export Java variables to Bazel
  refactor Bazel variable export
2022-04-08 17:31:23 +00:00
Sam Delmerico
932c01cf9e export Java variables to Bazel
Test: build/bazel/bp2build.sh
Change-Id: Ia06f9265c9f96e6add6edbd0cee925fe37b430d3
2022-04-08 14:15:43 +00:00
Liz Kammer
d5aa079291 Clean up allowlist contents.
Test: mixed_droid.sh
Test: bp2build.sh
Change-Id: I6d00a55400e7843899c71be3de9e52403ba26f55
2022-04-06 15:26:15 -04:00
Sam Delmerico
7f88956c16 refactor Bazel variable export
Most of the variable export code for cc modules can be re-used for
exporting variables for java modules. Refactor this code into a more
composable structure for reuse.

Test: build/bazel/bp2build.sh
Test: manual comparison of
  out/soong/soong_injection/cc_toolchain/constants.bzl
  with previous output
Change-Id: Ie5a6fee08cc888b7dc69c3e324e5c3f8aa269a8f
2022-04-06 14:48:32 +00:00
Jiyong Park
661edbb331 Merge "Don't allow using framework and SDK at the same time." 2022-04-05 23:46:43 +00:00
Liz Kammer
7821a5e180 Merge "Denylist modules that depend on a rust binary" 2022-04-05 23:11:23 +00:00
Colin Cross
209844ce1c Merge "Enable restat for sbox rules" 2022-04-05 22:49:10 +00:00
Liz Kammer
6879cc0983 Denylist modules that depend on a rust binary
Test: b build //system/...
Test: CI
Change-Id: Ib01124ca22e1ed83e9b71a18607d60fb1a4fc8e2
2022-04-05 18:00:22 -04:00
Jiyong Park
3c306f3d1d Don't allow using framework and SDK at the same time.
Using SDK (current, system_current, module_current, or <api_version>)
while at the same time depending on "framework" doesn't make sense
because framework anyway provides all APIs including hidden ones. This
is not only uncessary but also error prone because the availability of a
private method in a class depends on whether the class is part of the
SDK or not.

Add a neverallow rule for prohibiting that. Note that "core_*" SDKs are
allowed because there's no overlap between "framework" and the core-Java
SDKs.

Bug: 227528906
Test: m nothing on git_master
Change-Id: I0605075aef20c75db084beeedcbf49a642573e69
2022-04-05 15:39:05 +09:00
Spandan Das
2430a04b2e Merge changes Icb91de93,I5a2edaf4
* changes:
  Change permitted_packages check to be per-jar rather than per-apex
  Revert "Relax apex package restriction for T+ jars"
2022-04-05 04:06:55 +00:00
Colin Cross
e52c2ac7fb Enable restat for sbox rules
Add support to sbox for only writing output files if they are changed
to support enabling restat.  Move the clearing of the output directory
into sbox, and when write if changed is enabled delete obsolete output
files without deleting output files that will be replaced.

Enable restat for local metalava rules.  Restat for metalava rules
run remotely is still blocked on b/183630617.

Bug: 222095735
Test: TestRuleBuilder_Build
Test: m SystemUI
Change-Id: If8fc47e711f4a6f43947ab69f17cccc8ba6ae61a
2022-04-04 16:42:46 -07:00
Spandan Das
f14e254a28 Change permitted_packages check to be per-jar rather than per-apex
(cherry-pick of ag/17524387 into aosp)

Summary:
- updates the Q and R maps, the new keys are the bcp jars and not the
apexes. neverallow build rules ensure that these bcp jars have a
restricted set of permitted_packages
- remove BootclasspathJar from the neverallow rule. This is no longer
necessary since the keys in the maps are the bootjars themselves, and
not apexes

Bug: 205289292
Test: In build/soong, go test ./apex
Change-Id: Icb91de934181a8b6f085e03a0ce8c5e08504ff94
Merged-In: Icb91de934181a8b6f085e03a0ce8c5e08504ff94
(cherry picked from commit 440ff96728)
2022-04-04 17:42:00 +00:00
Anton Hansson
e1b1836939 Revert "Relax apex package restriction for T+ jars"
This reverts commit 1fdd6ca88a.

Reason for revert: b/205289292 tracks the real fix for this

Test: presubmit
Change-Id: I5a2edaf4f930dafa26659f85d9425e9041c72275
Merged-In: I5a2edaf4f930dafa26659f85d9425e9041c72275
2022-04-04 17:27:43 +00:00
Treehugger Robot
7a45d37e62 Merge "convert java_import jars with arch variants" 2022-04-04 16:06:55 +00:00
Bob Badour
de6a087d2d Revert "Revert "Build notice files from license metadata.""
This reverts commit 77807b3c27.

Reason for revert: fix and roll forward again

Change-Id: I80c796ca81ecf29df9522babe54d684a0d11b9e6
2022-04-01 18:00:00 +00:00
Wei Sheng Shih
77807b3c27 Revert "Build notice files from license metadata."
This reverts commit 43c2dcaef6.

Reason for revert: suspect build break

Bug: 227682036

Test: TARGET_BUILD_VARIANT=userdebug UNBUNDLED_BUILD_SDKS_FROM_SOURCE=true vendor/google/build/mainline_modules_bundles.sh -j97


Change-Id: Ibfb8b4fefc264f52f32ba661c269a9cd625d800a
2022-04-01 14:10:53 +00:00
Sam Delmerico
489831660c convert java_import jars with arch variants
Bug: 220168131
Test: go test ./bp2build -run TestJavaImport
Test: b build '...'
Change-Id: Ib485e6905e7be9d199af5295b23131c226fd6e96
2022-03-31 21:00:24 +00:00
Bob Badour
43c2dcaef6 Build notice files from license metadata.
Switch from generate-notice-files.py and mergenotice.py to htmlnotice.

Bug: 151177513
Bug: 213388645
Bug: 210912771

Test: m droid dist reportmissinglicenses
Change-Id: I6cac049d24f35ec358c6f341a04f4ba6161703bf
2022-03-31 17:29:01 +00:00
Sam Delmerico
3c25ab1ac3 Merge changes I8e4c3f37,I89a32bde
* changes:
  add plugins to javaLibraryAttributes
  convert java_import_host with bp2build; enable jetifier
2022-03-30 21:08:12 +00:00
Treehugger Robot
d93afba1e6 Merge changes from topic "no-srcs-no-deps"
* changes:
  enable conversion of all java_import modules
  emulate java_library static_deps with Bazel exports
2022-03-30 21:06:46 +00:00
Sam Delmerico
5f83b491b4 convert java_import_host with bp2build; enable jetifier
Also, add java_imports that were blocked by jetifier binary.
b/221082840 was blocking the build of jetifier which these java_imports
depended on. That bug is now resolved, so we can unblock these targets.

Bug: 220168131
Test: b build //packages/apps/Car/libs/car-ui-lib/car-ui-androidx/...
Test: build/bazel/ci/bp2build.sh
Change-Id: I89a32bde30c133a44aeb7826afa11d4140433f5d
2022-03-30 19:19:13 +00:00
Sam Delmerico
a9b047a9da enable conversion of all java_import modules
Bug: 220168131
Test: b build '...'
Change-Id: Ib1eaf47b81ac19cb6e930e5f9f3fc2aebe02b0c1
2022-03-30 19:19:09 +00:00
Sam Delmerico
c016143602 emulate java_library static_deps with Bazel exports
In Soong, java_library can specify static_deps which are dependencies
that get aggregated into the final jar (akin to static linking). This is
useful because it allows dependencies higher up in the chain to compile
against the APIs exported by transitive dependencies. Bazel does not
support this functionality directly, but it can be emulated via the
exports attribute which makes any targets listed in the attribute public
to targets further up the chain.

Bug: 217236083
Bug: 219908977
Test: b build //external/error_prone:error_prone_core
Test: b build //external/bouncycastle:bouncycastle-host
Test: b build --platforms=//build/bazel/platforms:linux_x86
  //prebuilts/sdk/tools/jetifier/jetifier-standalone:jetifier
Change-Id: I2867e3f816de720a6f4bd9ff7a847d1b0c2da2d6
2022-03-30 18:58:38 +00:00
Paul Duffin
26f19919ea analyze_bcpf: Add --fix option
Add a --fix option that will cause the script to automatically fix the
issues that it finds. It uses the bpmodify tool to add values to the
bootclasspath_fragment's hidden_api properties.

This adds analyze_bcpf to bp2buildModuleDoNotConvertList as
analyze_bcpf depends on bpmodify which is a blueprint_go_binary which
is not yet supported by bazel.

Bug: 202154151
Test: m analyze_bcpf && analyze_bcpf --bcpf art-bootclasspath-fragment
      m analyze_bcpf && analyze_bcpf --bcpf art-bootclasspath-fragment --fix
      atest --host analyze_bcpf_test

Change-Id: I5ee52419b4829474f6dbeb47f86ab2aeb22b1382
2022-03-30 16:00:08 +01:00
Colin Cross
e91ea2a94a Remove linux_glibc musl hack
Stop using linux_glibc properties when musl is enabled.

Bug: 223257095
Test: m USE_HOST_MUSL host-native -k
Change-Id: I63cd485ef64c617bd81f3e598395da21bd71ccbb
2022-03-29 22:42:11 -07:00
Ram Muthiah
ac38c0bb93 Merge changes from topic "refactor-packagingbase"
* changes:
  Move GatherPackagingSpecs out of CopyDepsToZip
  Keep 'partition' in PackagingSpec
2022-03-29 13:45:22 +00:00
Treehugger Robot
4242115d59 Merge "Add values to json module graph" 2022-03-28 20:25:43 +00:00
Jooyung Han
a883428293 Move GatherPackagingSpecs out of CopyDepsToZip
This gives a PackageModule a chance to filter/customize the contents of
resulting package.

Bug: 225121718
Test: m (no changes)
Change-Id: I45505e8234dff42201dc40d4f038e7b08eea89f0
2022-03-28 14:29:14 +09:00
Jooyung Han
99c5fe6a38 Keep 'partition' in PackagingSpec
Add a property 'partition' to PackagingSpec and fill it when
PackagingSpec is created.

This will enable PackageModule to filter PackgingSpec based on
partition. (Will be used in a follow-up change)

Bug: 225121718
Test: m (nothing changes)
Change-Id: I7657edd380e215df66bae57d8b07dd4181841fdf
2022-03-28 14:29:14 +09:00
Treehugger Robot
1c2d87ba83 Merge "Add metrics collection to soong_build" 2022-03-26 00:21:21 +00:00
Liz Kammer
898e076d6f Add values to json module graph
Increases size of json module graph but it still remains smaller than
action information.

Test: m json-module-graph
Change-Id: I215e92afb0f5d3d688e5e590517392d0cc534455
2022-03-25 18:30:49 -04:00
Chris Parsons
715b08fd82 Add metrics collection to soong_build
Metrics are added to a materialized protobuf soong_build_metrics.pb

Recorded events have scoped names and recorded runtimes.
For example, mixedbuilds includes the following events:

mixedbuilds.prepare
mixedbuilds.analyze.write_files
mixedbuild     (this is a total of all mixedbuild events)

Test: Manually verified materialized protos for mixedbuild, bp2build,
and legacy build.

Change-Id: I2e72d4502c0373bee0279bb1320b2e4dd586129c
2022-03-25 17:19:44 -04:00
Trevor Radcliffe
dadc037ef3 Merge "Allow appending artifact in dist with product name" 2022-03-25 14:34:23 +00:00
Trevor Radcliffe
90727f4576 Allow appending artifact in dist with product name
Some modules need to have their artifacts copied to dist with the
product name appended. This CL enables that functionality in a
boolean Soong property called append_artifact_with_product.

Fixes: 224561567
Test: Unit tests and build relevant target/modules
Change-Id: I4b824d4001679cebf0a9059be2d090d33a310933
2022-03-24 14:46:18 +00:00
Andrei-Valentin Onea
b47e89f2d1 Merge "Revert "Prevent unspecified values in soong_config_string_variable"" 2022-03-24 14:11:18 +00:00
Andrei-Valentin Onea
38944c70c4 Revert "Prevent unspecified values in soong_config_string_variable"
This reverts commit 542905a280.

Reason for revert: This check is breaking multiple builds, creating fixes to minimize re-land work.

Change-Id: I6431bd0864f49781910dad787e1ba9375b9931b3
2022-03-24 13:52:58 +00:00
Treehugger Robot
1da556928a Merge "Prevent unspecified values in soong_config_string_variable" 2022-03-24 00:44:47 +00:00
Sam Delmerico
f241e72b57 Merge "add module type allowlist to bp2build" 2022-03-22 16:35:49 +00:00
Treehugger Robot
9b0af33cc8 Merge "Handle arch/cpu variants in mixed builds" 2022-03-22 15:52:51 +00:00
Liz Kammer
0940b89937 Handle arch/cpu variants in mixed builds
Test: mixed_libc.sh
Change-Id: Ib5084060199b8e1a5955bd51bc3fd793bb83a1eb
2022-03-21 11:13:49 -04:00
Yu Liu
ba4638f529 Merge "Support tailoring clang --target flag based on min sdk version." 2022-03-19 15:52:15 +00:00
Yu Liu
fc603167f4 Support tailoring clang --target flag based on min sdk version.
Bug: 215748260
Test: Tested using aquery to verify the --target flag; add added unit

Change-Id: Ifb13509db7d1e110316aa44d55ec9cccaa4b83d1
2022-03-18 01:16:52 +00:00
Cole Faust
542905a280 Prevent unspecified values in soong_config_string_variable
Currently, setting a soong config string variable to a value
that's not listed just does nothing. Change it so it's an
error instead.

Bug: 220375749
Test: Presubmits
Change-Id: I14c1c76ac556ccb0cbd167c95eb3fd7625a6a52c
2022-03-17 17:01:26 -07:00
Sam Delmerico
85d831a28e add module type allowlist to bp2build
This change also requires that java_import modules be prepended with the
"prebuilt_" prefix in the `bp2buildModuleAlwaysConvertList`. This fixes
a bug where trying to disable a java_import by name without the
"prebuilt_" prefix would also disable the corresponding source module if
it exists with the same name.

Test: build/bazel/ci/bp2build.sh
Change-Id: If75236891810e5112d70441653be4644d8fe5ecf
2022-03-17 23:43:07 +00:00
Jingwen Chen
f2504b64eb Allowlist //external/e2fsprogs/...
Test: CI
Bug: 204244290
Change-Id: Ie18b555fb165cd3b869a3d7fb2c4ad73aef4bad5
2022-03-17 16:52:13 +00:00
Jingwen Chen
53c29e2467 Build e2fsdroid with Bazel.
Test: CI
Bug: 204244290
Change-Id: If5f01da62cff2913fefc98aed7fe7b986e6e7a33
2022-03-17 15:33:38 +00:00
Colin Cross
143b8d4eb1 Merge "Export the license metadata files for dexpreopted bootjars to Make" 2022-03-17 01:48:47 +00:00
Colin Cross
e7fe0962f4 Export the license metadata files for dexpreopted bootjars to Make
Track the license metadata file of the module used to dexpreopt
bootjars and pass it to Make.

Bug: 224612665
Test: m alllicensemetadata reportmissinglicenses
Change-Id: I8466c3d8edf7dc44976c2a343bd38799c6617db2
2022-03-15 19:56:45 -07:00
Hsin-Yi Chen
66a357df9e Merge "Check ABI regardless of arch variants" 2022-03-16 02:09:40 +00:00
Treehugger Robot
7db79508c7 Merge "bp2build supports arch variant srcs for java_library" 2022-03-14 17:06:01 +00:00
Treehugger Robot
1785c88a4f Merge "add type to modules created by LoadHookContext" 2022-03-10 23:37:08 +00:00
Sam Delmerico
286bf26c2c add type to modules created by LoadHookContext
Modules created by a LoadHookContext do not currently set a module type
when creating new modules, but it would make analysis of the
module-graph.json much easier if this module type information was available.

Bug: 174879786
Test: m json-module-graph && check that module which previously had a
    blank module type now have the field populated
Change-Id: I3be5d259694a1540d21deb8a665ec7bea3464054
2022-03-10 20:59:45 +00:00
Hsin-Yi Chen
ee68c43d4b Check ABI regardless of arch variants
The ABI reference dump directory names contained TARGET_ARCH_VARIANT
or TARGET_2ND_ARCH_VARIANT. The builds with non-generic arch variant
could not find the reference dumps for their arches. This commit renames
the directories to <TARGET_ARCH> and <TARGET_2ND_ARCH>_<TARGET_ARCH> to
ensure that all arch variants are checked.

Bug: 213127415
Test: lunch aosp_cf_x86_64_phone-userdebug && make

Change-Id: I7617f3ffc0e1bc423eea8c39e0f2b745276b4244
2022-03-09 18:16:36 +08:00
Colin Cross
5ffb223ebb Merge "Add host_linux target properties" 2022-03-09 02:05:38 +00:00
Jingwen Chen
3889da5fea Merge "Allowlist //external/auto/android-annotation-stubs for bp2build." 2022-03-08 10:55:49 +00:00
Jingwen Chen
398a32d9b0 Allowlist //external/auto/android-annotation-stubs for bp2build.
Fixes breakage for bp2build-incremental.

Test: b build //external/...
Change-Id: Id493c119b6ba0f383c9d1e8bade8b8a0acf3efe6
2022-03-08 08:03:28 +00:00
Xin Li
c7c0b9e4ec Merge "Merge Android 12L" 2022-03-08 06:52:32 +00:00
Colin Cross
91729bd2ba Merge "Add musl_x86 and glibc_x86 style properties to bazel configurations" 2022-03-08 06:50:53 +00:00
Treehugger Robot
c8a6487153 Merge "Memory mapped coverage (take 2)" 2022-03-08 06:37:02 +00:00
Colin Cross
a98d36de64 Add host_linux target properties
Add host_linux to the target properties, which will apply to linux_glibc,
linux_bionic or linux_musl.  This will eventually undo the hack that
makes the linux_glibc properties apply to linux_musl.

Bug: 223257095
Test: TestArchProperties
Change-Id: Iccf51ed13c363ce1da04333a277fa49c33d45b9a
2022-03-07 14:56:33 -08:00
Colin Cross
2d295a2de2 Add musl_x86 and glibc_x86 style properties to bazel configurations
Bug: 223257095
Test: build/bazel/ci/mixed_libc.sh
Change-Id: Ia2427f54cdaafc657e29a7ae7a7575bec2b71338
2022-03-07 14:56:32 -08:00
Sam Delmerico
e91d0303f2 bp2build supports arch variant srcs for java_library
Bug: 209577426
Test: build/bazel/ci/bp2build.sh
Change-Id: I6799bda904d286616e580f2395601ce4f764180f
2022-03-07 16:15:56 +00:00
Treehugger Robot
d70fe75d4c Merge "Build avbtool with Bazel." am: 10eada743a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2006755

Change-Id: Ia258fe5e6aa5ce51616f86676b2668df897e6e30
2022-03-07 09:45:24 +00:00
Jingwen Chen
7edadabd6c Build avbtool with Bazel.
Test: CI
Change-Id: Ic506fea3ba1fb61692f59d8e6f708115c1a327ab
2022-03-07 04:40:35 +00:00
Wei Li
7ccc228753 Merge "Keep Bazel build file in build/bazel/vendor/google and prebuilts/bundletool." am: 083d4e072c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2005835

Change-Id: I729b52e39b1bd14205700530c6d2feb48dc2d7dd
2022-03-05 04:55:22 +00:00
Wei Li
083d4e072c Merge "Keep Bazel build file in build/bazel/vendor/google and prebuilts/bundletool." 2022-03-05 04:31:55 +00:00
Pirama Arumuga Nainar
b37ae58a3d Memory mapped coverage (take 2)
Add a build variable, CLANG_COVERAGE_CONTINUOUS_MODE, instead of
selecting based on paths.

Test: CLANG_COVERAGE_CONTINUOUS_MODE=true m and verify continuous mode works

Change-Id: I731172fc1f00e1cabff8efcf8b99f9a48210b446
2022-03-04 14:07:53 -08:00
Treehugger Robot
6e826bab74 Merge "prevent module being enabled if in existing BUILD file" am: fe86b81aab
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1999892

Change-Id: I0cca195fe44e4360006183a6d5c2203d5ea6bdde
2022-03-04 21:04:10 +00:00
Treehugger Robot
fe86b81aab Merge "prevent module being enabled if in existing BUILD file" 2022-03-04 20:37:21 +00:00
Sam Delmerico
9e3f98b8cf Merge "convert android_app certificate property, bp2build" am: d508a638c3
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1980606

Change-Id: I38f798fa387b10288abb4250e9f941776e98088c
2022-03-04 17:56:28 +00:00
Sam Delmerico
d508a638c3 Merge "convert android_app certificate property, bp2build" 2022-03-04 17:30:31 +00:00
Treehugger Robot
265f41c1dc Merge "Export binaries for shippedlibs and bom." am: 7010c53c50
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2003174

Change-Id: I5bd08c769c24638c068aed8f99e4d6d355fbfa74
2022-03-04 02:50:26 +00:00
Treehugger Robot
7010c53c50 Merge "Export binaries for shippedlibs and bom." 2022-03-04 02:23:38 +00:00
Liz Kammer
a1b33112b1 Merge "Export variant/features via soong_injection" am: 6e4cd27bec
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2000396

Change-Id: I6da248db7bca983d0ce5b121412f904e48f67a21
2022-03-03 18:36:17 +00:00
Liz Kammer
6e4cd27bec Merge "Export variant/features via soong_injection" 2022-03-03 18:11:25 +00:00
Treehugger Robot
9688f00e3a Merge "ensure out/bazel_metrics exists before writing to cquery-buildroot_bazel_profile.gz" am: 7ed6612fa6
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2004236

Change-Id: I9401f672367864c89afdee750fa910f9ba217409
2022-03-02 22:42:16 +00:00
Sam Delmerico
94d26c2bc0 prevent module being enabled if in existing BUILD file
If a module is enabled via the module-level allow list,
bp2buildModuleAlwaysConvertList, then we should error if that same
module is hidden by an existing BUILD file.

Bug: 220875679
Test: add a module in a directory covered by an existing BUILD file
Change-Id: I5426bd9edac593690c0989b68a421ac1c3216010
2022-03-02 22:15:14 +00:00
Treehugger Robot
7ed6612fa6 Merge "ensure out/bazel_metrics exists before writing to cquery-buildroot_bazel_profile.gz" 2022-03-02 22:14:16 +00:00
Usta Shrestha
902fd17a99 ensure out/bazel_metrics exists before writing to cquery-buildroot_bazel_profile.gz
Bug: 222133546
Test: `rm -rf out` then `USE_BAZEL_ANALYSIS m libnativehelper` and ensure 'out/bazel_metrics' exists
Change-Id: I6803aba830e1c40f3618bfc41109728d721fd2af
2022-03-02 15:27:49 -05:00
Liz Kammer
cda3d14ad8 Merge "Improve clarity of arch decoding." am: b3fe72fc78
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2002771

Change-Id: Ibeb07556427c29a0d4a1a9b099b8c6b83783304a
2022-03-02 16:04:45 +00:00
Liz Kammer
b3fe72fc78 Merge "Improve clarity of arch decoding." 2022-03-02 15:44:26 +00:00
Wei Li
171410478a Keep Bazel build file in build/bazel/vendor/google and prebuilts/bundletool.
Test: b test //build/bazel/tests/apex:build.bazel.examples.apex.minimal_mainline-module
Bug: 217838178

Change-Id: If94a2086db2a4afabe600b691f65b388ea19dcfe
2022-03-02 02:09:46 -08:00
Liz Kammer
94ff96ed4b Merge "Disallow libc_musl_sysroot_libc++_headers" am: 6bd0d4e864
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2003473

Change-Id: I79b9cc64f14440ca63e26862c9b878741d555d2b
2022-03-01 19:28:27 +00:00
Liz Kammer
6bd0d4e864 Merge "Disallow libc_musl_sysroot_libc++_headers" 2022-03-01 19:10:16 +00:00
Liz Kammer
4f3b9f3d8d Merge "Restrict genrules to disallow directories as input" am: a98902955a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1965346

Change-Id: Iac0395f0fbb4736d7b7fabb662625866cb419498
2022-03-01 15:47:55 +00:00
Liz Kammer
a98902955a Merge "Restrict genrules to disallow directories as input" 2022-03-01 15:19:34 +00:00
Liz Kammer
878a7f1632 Disallow libc_musl_sysroot_libc++_headers
This depends on go modules and is musl specific, not a current focus.
Allows CI to be green again.

Test: bp2build.sh
Change-Id: I35520636b38eed3f829e176c4ba91517fd61364a
2022-03-01 09:08:23 -05:00
Bob Badour
3d9a7d8c6e Export binaries for shippedlibs and bom.
Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m nothing reportallnoticelibrarynames

Change-Id: Ie8e7b7f2b7b120fd25b523ce95641c903f8e97ca
2022-02-28 20:13:35 -08:00
Liz Kammer
e8303bd0ae Export variant/features via soong_injection
Test: build/bazel/ci/bp2build.sh
Change-Id: If70043dc9d020d5f4a243ba4b192b99c9c7e8563
2022-02-28 14:17:15 -05:00
Liz Kammer
b7f3366cbb Improve clarity of arch decoding.
Test: CI
Change-Id: I31789f962259e917e99ac6f778644729199f42ed
2022-02-28 14:17:15 -05:00
Sam Delmerico
74bb39d1ca Merge "add a module-level allowlist to bp2build" am: b0b94f6182
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1995210

Change-Id: I748ac9e97f1aeb2b67dbf3a74de9cc92d1ae9cf7
2022-02-25 15:40:46 +00:00
Sam Delmerico
fa1831c200 add a module-level allowlist to bp2build
We currently enabled modules in bp2build on a package level, and we
disable individual modules based on a denylist. To enable a specific
module individually, we must change the corresponding Android.bp file to
include a bp2build_available property. Instead, have a centralized list
of specifically enabled modules.

Bug: 220875679
Test: m bp2build
Change-Id: I908f2f2366b72affb04234fbe92ba03bf5a37338
2022-02-24 14:46:41 +00:00
Liz Kammer
619be4626b Restrict genrules to disallow directories as input
While Bazel genrules will allow genrules to accept a directory as input,
the results can be unexpected to a user as changes to the contents of
the directory may not trigger a rebuild as expected. Restricting this
in Soong ensures that converted targets will behave as expected.

Test: CI
Change-Id: I8616f58d1df267005e6c0ca3f4730d06de52c0d9
2022-02-23 21:29:22 +00:00
Treehugger Robot
e8815d5ebb Merge "Fix typos in arch_list and do variant validation" am: cda344f120
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1982666

Change-Id: Icfd76442021fbd278a386fb44dff5f21b2cec0b5
2022-02-23 17:55:48 +00:00
Treehugger Robot
cda344f120 Merge "Fix typos in arch_list and do variant validation" 2022-02-23 17:34:51 +00:00
Sam Delmerico
4dc3df7be7 Merge "convert java proto libraries with bp2build" am: bc83b504ff
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1975287

Change-Id: I8706280d13486f6e3b3f230e37af2d3052655ad0
2022-02-23 16:59:35 +00:00
Sam Delmerico
bc83b504ff Merge "convert java proto libraries with bp2build" 2022-02-23 16:13:15 +00:00
Treehugger Robot
119decff9b Merge "Move functionality to test install rules into testing.go." am: 489be090e7
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1980966

Change-Id: I0911fa11b0ddac5235deb2effdf69650fb82a4ae
2022-02-22 21:14:18 +00:00
Treehugger Robot
489be090e7 Merge "Move functionality to test install rules into testing.go." 2022-02-22 20:41:23 +00:00
Treehugger Robot
16e222bc2a Merge "typos fixed" am: 92a21ddb41
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1991433

Change-Id: Iddd5f8ee11f39262dfca8bf7ae6dceb083808170
2022-02-22 14:42:14 +00:00
Treehugger Robot
92a21ddb41 Merge "typos fixed" 2022-02-22 14:17:13 +00:00
Anton Hansson
df4ea086a4 Merge changes from topics "extdir", "threadvars" am: d2149e6a81
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1988355

Change-Id: I8b8360f24b65a8dbc6d8ad144271508772b46403
2022-02-22 14:10:16 +00:00
Anton Hansson
d2149e6a81 Merge changes from topics "extdir", "threadvars"
* changes:
  Add support for sdk extensions in prebuilt_apis
  Refactor prebuilt_apis.go
  Add base sdk extension version to the config
2022-02-22 13:46:47 +00:00
Usta Shrestha
0b52d83b60 typos fixed
Bug: N/A
Test: m nothing
Change-Id: Ia3abc4b9db2b811bf589447e32a7f29f341f2307
2022-02-18 22:19:12 -05:00
Colin Cross
6be81464b8 Merge "Add SortedStringValues and SortedUniqueStringValues" am: a00cb70910
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1990670

Change-Id: I68c03e568b8f821e4d2e8d0a851c4f064edb7634
2022-02-18 21:15:05 +00:00
Sam Delmerico
9dfb139b6d convert android_app certificate property, bp2build
The android_app certificate property can be converted to the
@android_rules debug_signing_keys attribute in Bazel after converting
the .pk8/.pem key pairs to a JKS keystore in Starlark.

Test: b build -s //frameworks/base/tests/appwidgets/AppWidgetHostTest
  and verify includes SignApk action with generated keystore
Bug: 194133023
Change-Id: I2c4276f94a7856fc68a7674e89742f887dca31b4
2022-02-18 20:17:01 +00:00
Yu Liu
ea1aae2889 Merge "Enable cc_binary in mixed build." am: 9d7d9810e2
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1983488

Change-Id: I88bc7baa0db521b52be1a581c6d230d43287766a
2022-02-18 09:44:39 +00:00
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