Commit graph

4348 commits

Author SHA1 Message Date
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
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