Commit graph

47314 commits

Author SHA1 Message Date
Paul Duffin
a54016c3ba Only output annotations properties in snapshots for T+
Marks the `scopeProperties.AnnotationsZip` property as only being
supported on T builds and above.

Bug: 204763318
Test: m nothing
Change-Id: Ie59396287c08da77a6a1f15d4be202429e011e17
2022-01-31 12:28:04 +00:00
Paul Duffin
106a3a4bec Allow pruning of unsupported fields in structs in maps
Adds support for traversing into a field that is of type:
   map[...]*struct{...}

This is needed to allow java_sdk_library to mark scope specific
properties, e.g. public.annotations as being target build release
specific.

It was necessary to change the Scope field from:
   Scope map[*apiScope]scopeProperties
to:
   Scope map[*apiScope]*scopeProperties

That is because there is no way in go to change the field of a struct
value of a map. i.e. you cannot do the following, not even using
reflection:
   Scope[apiScopePublic].AnnotationsZip = nil

Bug: 204763318
Test: m nothing
Change-Id: Id103f70f55d4202971321ef4925cbec4b55f8136
2022-01-31 12:28:04 +00:00
Paul Duffin
545c59273d Refactor build_release and test code
Minor restructuring of the build_release pruning code to make it easier
to add logic for handling fields of maps of structs. That includes:
1. Moving some code that is specific to clearing a selected field
   inside the associated if block.
2. Replacing an if with a switch.
3. Improving the error handling by separating the reporting of the
   container that broke from information about which field could not be
   set. That allows follow up code to provide information about the map
   key instead.

The tests were restructed by:
1. Switching from using AssertDeepEquals to compare the structs to
   comparing the output of marshalling the structs to JSON. That was
   for a couple of reasons. Firstly, because JSON will marshal (and so
   allow comparison of) the contents of pointers to structs whereas
   AssertDeepEquals will just compare the pointers themselves.
   Secondly, because JSON can pretty print the output and make it
   easier to read.
2. Using a func to create a new instance of the input structure for
   each test. That is to allow the test to modify the input structure,
   e.g. by clearing a field in a struct that is pointed to by a map.
   The test previously relied on the input structure being immutable
   and passed by value but a follow up change will change that by
   adding a map field that contains pointers to structs.

Bug: 204763318
Test: m nothing
Change-Id: I84dc99621497b7263e30466895b823eb02cb2b56
2022-01-31 12:28:04 +00:00
Kousik Kumar
5ddefa3df4 Merge "Move env var config loading to be within the config package." 2022-01-31 04:40:50 +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
b3af19caa2 Merge "list all valid flags (commands) to soong_ui upon unknown command" 2022-01-29 06:34:19 +00:00
Usta Shrestha
defcf8d227 Merge "name parameters for clarity" 2022-01-29 06:33:55 +00:00
Treehugger Robot
fd8f0ffee0 Merge "Fix the names of the dynamically inherited modules." 2022-01-29 04:35:39 +00:00
Treehugger Robot
a038c2f269 Merge "Make the Apache 2.0 text available to packages." 2022-01-29 01:41:16 +00:00
Sasha Smundak
845cb29c2b Fix the names of the dynamically inherited modules.
The module name passed to rbld.inherit should be its path without the suffix.

Bug: 215182113
Test: internal
Change-Id: Ic65a5b73037be84f31f8db29f71f793b6c6034bb
2022-01-28 17:41:15 -08:00
Treehugger Robot
7afffe6af0 Merge "Allow UWB to use Rust in reference HAL" 2022-01-28 22:08:36 +00:00
Treehugger Robot
52ef4c3373 Merge "Limit JIT tier for javac" 2022-01-28 21:59:05 +00:00
Bob Badour
45923719be Make the Apache 2.0 text available to packages.
It might be useful to associate other library names than "Android"
with the Apache 2.0 license text.

Test: m nothing
Change-Id: I3ccbd9ca77f330bb81bf2bf4ec53cfb873befe8b
2022-01-28 12:55:32 -08:00
Jared Duke
0849c14aea Limit JIT tier for javac
javac is generally a short-lived JVM invocation that doesn't greatly
benefit from deep JIT tiering. As such, favor faster startup time
by limiting to tier 1 JIT for javac execution. This should greatly
reduce overall CPU usage from Java compilation for an arbitrary
Android build (~20%), and deliver a small but modest improvement in
overall Java build times (~5%).

Representative incremental build times with this change:
  * real 18m3.507s
  * user 563m4.838s
and without:
  * real 19m11.909s
  * user 751m27.790s

Follow-up changes will apply similar flags for other short-lived JVM
build commands.

Bug: 205303544
Test: m
Change-Id: Ic6315b976063f4330902930a6cf5e5cb394c554c
2022-01-28 11:39:47 -08:00
Keyi Gui
0107901dec Merge "Add new file name to output inputs/outputs of actions of modules into a new file when m json-module-graph is executed." 2022-01-28 14:39:31 +00:00
Pedro Loureiro
e4c255cb04 Merge "Add special case for test-only module in configuredJars method" 2022-01-28 09:50:36 +00:00
kgui
67007248a5 Add new file name to output inputs/outputs of actions of modules into a new file when m json-module-graph is executed.
And also delete the logic in droidstubs to output JSONDataActions.

Test: local.

Change-Id: Ib5d6f1f69c16c41f128e481131775c7699f96464
2022-01-28 13:52:50 +08:00
Treehugger Robot
c7afdefa26 Merge "Add option to generate BTF debug info for bpf programs" 2022-01-28 01:51:05 +00:00
Chih-hung Hsieh
7892c6d76d Merge "Add tidy.md document" 2022-01-27 23:07:25 +00:00
Treehugger Robot
cd22b62add Merge "Revert "Reland "Enable hwasan use after scope detection.""" 2022-01-27 22:54:24 +00:00
Treehugger Robot
428d5ad909 Merge changes I728208ed,Ifdb50809
* changes:
  [cc] Add per-file OWNERS for cc/coverage.go
  [cc/coverage] Override/disable -Wframe-larger-than
2022-01-27 22:17:29 +00:00
Treehugger Robot
6bf833f428 Merge changes from topic "musl_rust"
* changes:
  Support building rust modules against musl libc
  Support genrules as CrtBegin and CrtEnd in rust
  Support multiple crtbegin and crtend dependencies
2022-01-27 21:39:18 +00:00
Connor O'Brien
2573965c5e Add option to generate BTF debug info for bpf programs
Add "btf" option that generates BTF debug info to support easier map
inspection. This is accomplished by passing the "-g" flag to clang
when compiling the BPF program.

The "-g" option also generates a number of DWARF debug sections which
are not necessary for loading BTF information, so strip these to avoid
increasing file size unnecessarily. bpfloader currently only supports
BTF info for maps, not programs, so we also strip the .BTF.ext section
containing program BTF info.

Bug: 203823368
Test: libbpf_load_test
Test: verify time_in_state.o includes .BTF section iff "btf: true" is
set
Test: verify time_in_state.o still loads if BTF is enabled
Change-Id: Ica25b253bace59d04130b0210350188399889bbe
Signed-off-by: Connor O'Brien <connoro@google.com>
2022-01-27 12:00:45 -08:00
Chih-Hung Hsieh
22c27e8458 Add tidy.md document
Test: make
Change-Id: Ic2198532be4135401faffdda34d0e108c57b241c
2022-01-27 11:02:17 -08:00
Pirama Arumuga Nainar
0d7d3e1647 [cc] Add per-file OWNERS for cc/coverage.go
Test: N/A
Change-Id: I728208ed9ef10e032fd12e495ba67121e4c849e5
2022-01-27 10:49:13 -08:00
Pirama Arumuga Nainar
f776c8c47c [cc/coverage] Override/disable -Wframe-larger-than
We can expect frame size increase with coverage instrumentation.

Test: N/A
Change-Id: Ifdb50809c83939ded5a26804aa0ae9404eb1a107
2022-01-27 10:47:55 -08:00
Pirama Arumuga Nainar
1785fcb171 Merge "[rust/coverage] Remove obsolete WAR to pass -z,start-stop-gc" 2022-01-27 18:37:40 +00:00
Pirama Arumuga Nainar
7ac26891cf Merge "[docs] Add README for native code coverage" 2022-01-27 18:29:12 +00:00
Trevor Radcliffe
13ae63c7e3 Merge "Remove res and assets in androidmk if default" 2022-01-27 14:53:14 +00:00
Sam Delmerico
2882dcb74b Merge "product variables are consumed via soong injection" 2022-01-27 14:31:08 +00:00
Sam Delmerico
af20c7cad1 Merge "build device binary for java_test_host" 2022-01-27 14:30:39 +00:00
Pirama Arumuga Nainar
2b34678ce2 [docs] Add README for native code coverage
Publish internal doc at go/android-native-coverage-local-workflow to
AOSP so it's available publicly.

Also add OWNERS for this file.

Test: N/A
Change-Id: I8d25e840b83294e90743d1cb8ff8d86a4579e34a
2022-01-27 05:16:45 +00:00
Yi Kong
a86875eefb Merge "Add tests for afdo.go" 2022-01-27 04:27:28 +00:00
Florian Mayer
fd337b3963 Revert "Reland "Enable hwasan use after scope detection.""
This reverts commit 0edaddf2ce.

Reason for revert: b/http://b/214007768

Change-Id: I60a2e3a5386601992fcb5632c142dd28bdb611b2
2022-01-27 03:31:28 +00:00
Kousik Kumar
3ff037e3d9 Move env var config loading to be within the config package.
When the environment variable config file is loaded after config object
is initialized, we  end up loading the USE_RBE variable in the config
file after the code to start reproxy process is run. This causes a
problem when USE_RBE variable itself is set in the config files. To
avoid this, I've moved the config file loading code to be within the
config package, this makes the main.go file cleaner too.

Test:
Ran a build with USE_RBE:true set in the config json file. The build
fails without this change and succeeds with this change.

Bug: b/209486170
Change-Id: Iab3957b64f4b5456a861057d16ad318f4f78e0cb
2022-01-26 18:40:43 -05:00
Pirama Arumuga Nainar
668da23096 [rust/coverage] Remove obsolete WAR to pass -z,start-stop-gc
Bug: http://b/199203503

Rust's llvm-project source now includes  https://reviews.llvm.org/D97448
and we no longer need this workaround.

Test: m unicode-xid_test_src_lib and verify __llvm_prf_data section is
      present.
Change-Id: I0387bd3af8bfc765f3aba3b309bfbc7ef49d565d
2022-01-26 21:39:49 +00:00
Sam Delmerico
b3342ce580 build device binary for java_test_host
This commit adds support for a java_host_test that requires a target
binary to run. If the binary has host and target variants and is added
as a dependency in the `data` attribute, then the host variant is used.
Instead, we need a way to force the use of the target variant.

Bug: 182919153
Test: add code from aosp/1647282/1 && atest AuthFsHostTest
Change-Id: I68a6259b41a5e6809e1b82eec3122ffdf5067f56
2022-01-26 19:57:27 +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
Pedro Loureiro
561c7765de Add special case for test-only module in configuredJars method
Same pattern used for com.android.sdkext / test_framework-sdkextensions

Test: m nothing
Test: also tried this with related CLs that make use of this
functionality

Bug: 195732042
Change-Id: I5adfb0e8650e2e262bf646e56b29965798d0a42f
2022-01-26 18:48:07 +00:00
Treehugger Robot
2d305010af Merge "[cc/tidy] Disable cert-err33-c" 2022-01-26 10:34:58 +00:00
Yi Kong
d5954a2a92 Add tests for afdo.go
Bug: 79161490
Test: presubmit
Change-Id: I686b5226aad5011ab30a0a105f8c7866cd610502
2022-01-26 17:46:33 +08:00
Yi Kong
3440d0d474 Merge "Sampling PGO deprecation" 2022-01-26 05:43:42 +00:00
Wei Li
a61dbd457e Merge "Add bp2build support for property "compressible" of apex module." 2022-01-26 01:37:09 +00:00
Treehugger Robot
f73658bdc6 Merge "[NFCI] Change llvm-ar '-format' to be '--format'." 2022-01-26 00:53:36 +00:00
Pirama Arumuga Nainar
5fc137b63b [cc/tidy] Disable cert-err33-c
Bug: http://b/216364337

This check warns when return values of standard-library functions
(including fprintf, snprintf) are not checked. Some of these warnings
turn to error when tidy_checks_as_errors in Android.bp.

Disable this for now and follow-up after compiler update to disable or
fix individual instances.

Test: Build with new compiler
Change-Id: I5af89b3f9cea4961c69708c51d22c510d478405b
2022-01-25 15:45:06 -08:00
Trevor Radcliffe
82cf9a7d4b Remove res and assets in androidmk if default
Test: new tests in androidmk_test and bpfix_test. Ran against file.
Fixes: 209019903
Change-Id: I5fc9005302c006b3205b4cbd04cef7c2aca40bc8
2022-01-25 23:10:21 +00:00
Matthew Maurer
2f90708221 Allow UWB to use Rust in reference HAL
Bug: 216358770
Change-Id: If0be032a248f6258232e2e47c489983b5416c536
2022-01-25 22:40:12 +00:00
Wei Li
f034cb4d7b Add bp2build support for property "compressible" of apex module.
Bug: 214466457
Bug: 207551677
Test: b build //build/bazel/examples/apex/minimal:build.bazel.examples.apex.minimal
Test: b test //build/bazel/tests/apex:build.bazel.examples.apex.minimal_apex
Test: b test //build/bazel/tests/apex:build.bazel.examples.apex.minimal_capex

Change-Id: I6bf12c1b0c52d4486968bb430a67a3c3110766db
2022-01-25 19:42:43 +00:00