Commit graph

50322 commits

Author SHA1 Message Date
Cole Faust
d9932ad053 Always build mk2rbc/rbcrun
Currently, mk2rbc/rbcrun aren't built in certain phases
of the build, which causes the Starlark product configuration
to fail when using get_build_var if a regular build hasn't
been run before.

Bug: 226677850
Test: Manually
Change-Id: If85608eef63be25fddc4d916c82247c13eb0195f
2022-03-29 14:55:17 -07:00
Colin Cross
ed12a04a3e Enable sanitizers for musl
Now that we provide runtimes built for musl, enable the sanitizers
when targeting musl.

Bug: 215802826
Test: m USE_HOST_MUSL=true host-native
Change-Id: Id17513ee305274874c31e9c99ce4faeff4a1c057
2022-03-29 13:35:17 -07:00
Colin Cross
441898c285 Switch to libunwind to remove dependency on libgcc for musl
The libgcc dependency is only used for _Unwind* symbols, remove
it now that libc_musl.so embeds libunwind.a.

Bug: 215802826
Test: m USE_HOST_MUSL=true host-native
Change-Id: I1ad4c1435fc0090c6df2d50d542d2203dfb94d7b
2022-03-29 13:35:17 -07:00
Rob Seymour
9e5cc8a674 Add pre-built attribute to host module definition for fake snapshot.
The host-snapshot provides host tools via prebuilt modules.
Having 2 prebuilts of the same module in a source tree leads to a build
time error.   Add new attribute when building the fake snapshot to
indicate that the host tool contains a prebuilt version.

When installing the host snapshot the user can opt not to include
modules that have a prebuilt version.

Bug: 225890931
Test: m HOST_FAKE_SNAPSHOT_ENABLE=true host-fake-snapshot dist
Change-Id: I044a92a280536f9c5ec93dcb277a5e5568cc4e42
2022-03-29 16:08:43 +00: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
Ivan Lozano
72cbf5888b Merge "rust: rust_proc_macro host snapshot support." 2022-03-29 13:29:24 +00:00
Jooyung Han
0fbbc2b0d4 android_system_image only packages "system" items
android_system_image filers packaging items installed outside "system"
partition.

Some packaging items install related items to different partitions but
putting them altogether to android_system_image doesn't make sense.
(android_system_image is suppposed to be "system" partition)

To be specific, this filters out "apex" partition items.  "apex"
partition is used by APEX installation to install APEX contents to paths
similar to activated paths on device so that symbol lookup works well
with APEX contents.

Bug: 225121718
Test: atest MicrodroidHostTestCases
Test: debugfs <intermediate>/microdroid.img -R 'ls system'
  shows no "com.android.runtime"
Change-Id: Ibc3d85ead2fda99e231132ce8ab9ccf1cc9317b7
2022-03-29 07:56:02 +09:00
Treehugger Robot
4242115d59 Merge "Add values to json module graph" 2022-03-28 20:25:43 +00:00
Colin Cross
edd46702e1 Merge "Use turbine instead of kapt for kotlin annotation processors" 2022-03-28 18:07:14 +00:00
Colin Cross
e311abcd44 Merge "Don't use ziptime or --temp_dir for turbine" 2022-03-28 18:00:49 +00:00
Jooyung Han
76c255f45a Merge "Revert "Add a tool to list contents of .img file"" 2022-03-28 09:48:10 +00:00
Jooyung Han
1df464a90b Revert "Add a tool to list contents of .img file"
Revert submission 2041990-microdroid-contents

Reason for revert: b/227144320 (broken build)
Reverted Changes:
Ie2f471d39:Add the golden list of microdroid contents
I7c4fca184:Add a tool to list contents of .img file

Change-Id: If2b5d6cb1325cb17ef2bdc4f13ded003ab2dd6d7
2022-03-28 09:44:33 +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
23ce5b4ca2 Merge "Add a tool to list contents of .img file" 2022-03-28 05:06:55 +00:00
Treehugger Robot
6876d5aa5f Merge "Dedupe libraries in both static and whole static" 2022-03-26 00:32:01 +00: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
Mitch Phillips
c6ea944e18 Merge "[HWASan] Enable zero-initialization." 2022-03-25 20:53:02 +00:00
Colin Cross
f61766e987 Use turbine instead of kapt for kotlin annotation processors
Follow Bazel by using turbine instead of kapt to run annotation
processors.  This still requires using kapt to generate java stubs
of kotlin soruces, then uses turbine to run annotation processors
on the java stubs and any java sources to generate sources and
resources, and passes the annotation processor generated sources
to kotlinc and javac.

Bug: 225013372
Test: m checkbuild
Test: TestKapt
Change-Id: I9c6fc496a9fba64658bb062538bc5f7b9478b07a
2022-03-25 10:28:50 -07:00
Colin Cross
411647e8f4 Don't use ziptime or --temp_dir for turbine
Turbine sets dates to 2010 and doesn't need ziptime any more, and
ignores the --temp_dir flag.

Bug: 225013372
Test: m checkbuild
Change-Id: I6122f27d873ca671050e4dc0d65641bb52e90e99
2022-03-25 10:26:47 -07:00
Spandan Das
183ed1044c Merge "Do not propagate strict_updatability linting to conscrypt and framework-media java_sdk_libraries" 2022-03-25 15:05:06 +00:00
Trevor Radcliffe
dadc037ef3 Merge "Allow appending artifact in dist with product name" 2022-03-25 14:34:23 +00:00
Ivan Lozano
872d579a22 rust: rust_proc_macro host snapshot support.
Adds support for capturing rust_proc_macros as part of the host
snapshot. Proc macros target the host and can be thought of as compiler
plugins. Because of this, they don't have vendor image variants and
can't be easily captured as part of the vendor snapshot. Instead we
capture them as part of the host snapshot.

This adds a rust_prebuilt_proc_macro module type.

Bug: 204304380
Test: m HOST_FAKE_SNAPSHOT_ENABLE=true host-fake-snapshot dist
Test: python3 development/vendor_snapshot/update.py --image=host
  --install-dir=vendor/vendor_name/ 31 --local out/dist
Test: Checked Android.bp for rust_prebuilt_proc_macro modules.
Change-Id: I4a8c4d9c41b7ca361b5b97d3f74973918c2a5fe3
2022-03-25 09:25:07 -04:00
Yi Kong
846a25912d Merge "Update to clang-r450784" 2022-03-25 05:49:48 +00:00
Yi Kong
75ce5d3320 Update to clang-r450784
Test: presubmit
Bug: 219872355
Change-Id: I3cd5f42d887b07929906e08d7d9f1a677b8a4403
2022-03-25 04:30:53 +00:00
Spandan Das
2cf278e75b Do not propagate strict_updatability linting to conscrypt
and framework-media java_sdk_libraries

Tmp fix for
https://android-build.googleplex.com/builds/quarterdeck?branch=aosp-master&target=errorprone&lkgb=8352129&lkbb=8353967&fkbb=8352538

Test: m
out/soong/.intermediates/external/conscrypt/conscrypt.module.public.api.stubs.system/android_common/lint/lint-baseline.xml
Test: (internal CI target) https://android-build.googleplex.com/builds/abtd/run/L67700000953708519
Bug: 182349282
Bug: 226637002
Bug: 226608044

Change-Id: I17e540877200f59bfd51e69e57d8bcca6cf3850f
2022-03-25 02:31:20 +00:00
Jooyung Han
b3a3a2893b Add a tool to list contents of .img file
list_image <img> lists the contents of the file.

For example:
  $ m microdroid
  $ list_image <path to microdroid.img>
  ./
  ./apex/
  ./bin
  ..

Bug: 195425111
Bug: 225121718
Test: list_image .img
Change-Id: I7c4fca184751ba20066fd25fa4c366a955dbabf6
2022-03-25 02:44:36 +09:00
Spandan Das
ad40fffa64 Merge changes I4c373b29,I9ccda6fc,I1b390b0e,I30151217
* changes:
  Do not propagate strict updatability linting to libcore/
  Create allowlist to skip strict updatability lint check
  Propagate strict_updatability_linting to transitive deps of updatable apexes
  Export LintDepSetsIntf from java package
2022-03-24 16:38:20 +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
Mitch Phillips
597605603a [HWASan] Enable zero-initialization.
Previously, we use to fill memory with 0xbe bytes. This caused a lot of
problems that necessitated disablement. For example, 0xbe-filled mutexes
are apparently locked, and there were a few instances of
uninitialized-mutex use.

Given that zero-fill is now the default behaviour, enable zero-init in
HWASan as well.

For now, only fill the first page. It would be preferable to fill the
whole allocation, but I don't want to spin for too many cycles filling
huge secondary pages. In future, we might change the behaviour to have
an explicit "zero initialize" option that completely fills the primarily
allocations, and knows it's unnecessary for the secondary.

Bug: 226078464
Test: Boot w/ HWASan (done by presubmit robot)

Change-Id: I7de3a7f9fa2fdeb5116e5bf6586babe4d06fcb91
2022-03-22 18:38:34 +00:00
Colin Cross
057beb2146 Merge "Collect deps from r8" 2022-03-22 16:40:30 +00:00
Colin Cross
22e6a6f69a Collect deps from r8
Use the new --deps-file argument to collect a deps file from r8, which
will correctly track files included by proguard flags files.

Fixes: 221956283
Test: manual
Change-Id: I92341948311c2c994cc0ae032dc19e09b2e80550
2022-03-22 16:40:13 +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
Treehugger Robot
c4ad11ec28 Merge "Prevent kotlinc from reading /tmp/build.txt" 2022-03-22 07:28:05 +00:00
Treehugger Robot
5beafc1900 Merge "Replace $(call my-dir) with a string literal" 2022-03-22 03:24:47 +00:00
Treehugger Robot
c9e38327dd Merge "Parse variable references with #s" 2022-03-22 03:15:47 +00:00
Treehugger Robot
bc1217b4e7 Merge "Revert "225341614: Enforce ExtraText in platform builds"" 2022-03-21 21:40:12 +00:00
Treehugger Robot
2f39f7dacd Merge "Don't pass static libs to r8" 2022-03-21 19:21:02 +00:00
Tor Norbye
73dca5c905 Revert "225341614: Enforce ExtraText in platform builds"
This reverts commit 4c471458ec.

Reason for revert: There were failures in some build targets that
must not have run during presubmit checks (for example,
aosp-master/errorprone@8332220)

Change-Id: I220fd70df663ba49d876fb3ebf841fa9f3f06b97
2022-03-21 18:56:14 +00:00
Tor Norbye
6014299148 Merge "225341614: Enforce ExtraText in platform builds" 2022-03-21 17:58:32 +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
Tor Norbye
4c471458ec 225341614: Enforce ExtraText in platform builds
Bug: 225341614
Test: N/A
Change-Id: Ic2ed5006643f3646315f16fe77552398f38c0265
2022-03-21 08:12:25 -07:00
Liz Kammer
cc2c1efc9a Dedupe libraries in both static and whole static
In Soong, libraries can appear in both static and whole static libs;
however, in Bazel, this results in errors due to duplicate libraries.

Test: bp2build.sh
Change-Id: I9dda4f7a7812340d28a6160d0e25f421c9db6612
2022-03-21 09:03:29 -04:00
Treehugger Robot
13642d4735 Merge "Do not dump metrics if reproxy was never started" 2022-03-21 07:05:41 +00:00