Commit graph

50294 commits

Author SHA1 Message Date
Yi Kong
128b608f3c Enable enum-enum-conversion warning
Test: presubmit
Bug: 154138986
Change-Id: I1076e732118c138774ab377adc3273a41f7dde08
2022-04-06 14:32:02 +08:00
Wei Li
c055d88c16 Merge "Export provenance metadata for prebuilt APKs and APEXes." 2022-04-06 04:03:41 +00:00
Colin Cross
40f8c75752 Merge "Use kapt stubs for kotlin header jar for javac" 2022-04-05 23:59:34 +00:00
Colin Cross
bbf5f8c158 Merge "Enable turbine for api generating annotation processors when using kotlin" 2022-04-05 23:48:12 +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
Colin Cross
93d65fb60d Merge "Enable kotlin's jvm-abi-gen plugin to generate header jars" 2022-04-05 23:32:54 +00:00
Wei Li
340ee8e699 Export provenance metadata for prebuilt APKs and APEXes.
Bug: 217434690
Test: atest --host gen_provenance_metadata_test
Test: m provenance_metadata

Change-Id: I91c184b6e6fe5ccfc3fc65b55b09e7a3da9502a0
2022-04-05 16:16:16 -07: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
Treehugger Robot
8210fbec1f Merge "Support converting simple $(eval) expressions" 2022-04-05 22:44:07 +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
Treehugger Robot
ccba7e76bb Merge "Enable enum-float-conversion warning" 2022-04-05 21:10:46 +00:00
Treehugger Robot
de0d46f5e0 Merge "Add libtrusty-rs to Rust allow list" 2022-04-05 20:54:18 +00:00
Treehugger Robot
ef03b3d8ba Merge "support errorprone javacflags" 2022-04-05 17:46:08 +00:00
Yi Kong
4e309eebe8 Enable enum-float-conversion warning
Test: presubmit
Bug: 154255917
Change-Id: Ib419dbbf0f512551c35c618d2af69a29853f01ae
2022-04-06 00:02:13 +08:00
Trevor Radcliffe
85b935eff2 Merge "Add support for test_suites to cc_test_library" 2022-04-05 15:34:53 +00:00
Colin Cross
465a131ac9 Merge "Add a symbols_map tool for extracting identifiers from elf and r8 files" 2022-04-05 14:16:16 +00:00
Treehugger Robot
90b6e70c5a Merge "Tweak linux_glibc properties for musl builds in build/soong" 2022-04-05 13:39:36 +00:00
Anton Hansson
71cf2a3cc6 Merge "Remove apex framework jars from hard-coded list" 2022-04-05 11:46:04 +00:00
Paul Duffin
3f19ffb711 Merge "analyze_bcpf: Explain why a package is split/single" 2022-04-05 11:41:17 +00:00
Paul Duffin
b84f1d5bb8 Merge "analyze_bcpf: Indent multi-line text to improve formatting" 2022-04-05 11:15:14 +00:00
Paul Duffin
ffd5b32aba Merge "signature_trie: Avoid unnecessary wrapping and unwrapping of values" 2022-04-05 11:14:59 +00:00
Anton Hansson
51bbac2137 Remove apex framework jars from hard-coded list
All apex jars get auto-instrumented since
I2b1c0736202de26c5ea88c0ab14574bd7207a5fb

Test: $ EMMA_INSTRUMENT=true EMMA_INSTRUMENT_FRAMEWORK=true m nothing && \
      $ grep LOCAL_MODULE.*framework-sdkextensions.com.android.sdkext$ \
            out/soong/Android-aosp_coral.mk  -A9 -B2 | grep JACO
Change-Id: I1de5ba6673bef93b16c302412f920d93129d4420
2022-04-05 09:00:57 +00: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
Treehugger Robot
5f58c378b6 Merge "Keep dependency files out of the apk file." 2022-04-05 05:53:22 +00: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
Bob Badour
2c8888edef Keep dependency files out of the apk file.
Bug: 227682036

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

Change-Id: I1a9775af7c652191bb1ce3b97c1cb9365b469c19
2022-04-04 19:21:18 -07:00
Treehugger Robot
34f3673f54 Merge "Enable int-in-bool-context warning" 2022-04-05 01:21:10 +00:00
Colin Cross
c6ef485370 Use kapt stubs for kotlin header jar for javac
When compling kotlin code with annotation processors we are generating
java stubs for the kotlin sources using kapt, and parsing them in
turbine when running the annotation processors.  Passing --output
to turbine will also compile the stubs into a header jar that can
be used as a dependency to javac, allowing the javac and kotlinc
rules to run in parallel.  The turbine-apt header jar can't be used
as the header jar for downstream modules as it doesn't contain the
kotlin metadata needed by kotlinc rules, so the kotlinc gen-jvm-abi
plugin output is still used for the module's final header jar.

Test: TestKapt
Bug: 222095735
Change-Id: I82d0900f3dc30f3e3ebd7cab0693dfe741d9b955
2022-04-04 16:42:46 -07:00
Colin Cross
b5db401599 Enable turbine for api generating annotation processors when using kotlin
Normally turbine is disabled when an api generating annotation processor
is in use because the annotation processors are run in javac, so any
generated api would not be present in the turbine header jar.  When
compiling with kotlin and annotation processors, the annotation processors
(including any that generate api) are run in an extra turbine invocation
to generate sources to make the results visible to kotlinc, and so can
also be compiled by the normal turbine invocation.  Force turbine enabled
when kotlin sources are present.

Test: m SystemUI
Bug: 222095735
Change-Id: I5fcfe67e46cb4a4e90388f088327488959b6571f
2022-04-04 16:42:46 -07:00
Colin Cross
220a9a1245 Enable kotlin's jvm-abi-gen plugin to generate header jars
Kotlin's jvm-abi-gen plugin can generate header jars similar to the
turbine output for java sources, which can be used to avoid recompiling
downstream modules when the ABI hasn't changed.  Unlike turbine, the
plugin runs as part of the main kotlinc invocation, so it doesn't allow
the downstream modules to start compiling any sooner.

A future possible optimization is to use turbine to compile the kapt
stubs, at least for the  kotlin+annotation processor modules that already
generate them, which would allow compiling downstream modules before
invoking kotlinc or javac, as well as invoking kotlinc and javac in
parallel with each other.

Bug: 222095735
Test: TestKotlin
Test: m SystemUI
Change-Id: Ib1bb2ecea47c851a108a26f9ed4f827f289d1321
2022-04-04 16:42:46 -07: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
Colin Cross
36f55aabcd Add a symbols_map tool for extracting identifiers from elf and r8 files
Add a symbols_map tool that can extract an identifiying hash from
and elf file or an r8 dictionary.  The tool writes the hash to a
textproto, and also supports a merge mode to combine textprotos into
a output file for inclusion in the build artifacts.

Bug: 218888599
Test: m dist
Test: symbols_map_test.go
Change-Id: Icd3ed6e5510e058c92d97c78759e7a4cfcdbb6ca
2022-04-04 15:53:38 -07:00
Trevor Radcliffe
f389cb4e35 Add support for test_suites to cc_test_library
Some cc_test_library modules will need to be installed for
compatibility test. This CL adds the capacity to use the
test_suites property to enable this behavior.

Fixes: 226402757
Test: Wrote unit tests, confirmed installation to proper dirs,
      and verified conversion that necessitated this change
Change-Id: I7313d4927d28aacad9e444962fd2a7efc6c3bc1f
2022-04-04 19:10:13 +00:00
Cole Faust
e0762c419f Merge "Correct type of dir function" 2022-04-04 17:53:11 +00: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
Paul Duffin
b99d480e1d analyze_bcpf: Explain why a package is split/single
Previously, the script would determine whether a package was split,
single or could be used as a prefix but did not explain why. This
change provides additional information to explain why they are split.

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: I3e2d5c0b54b5cc028013ce5ea979ebd9b9bf2c0d
2022-04-04 18:24:40 +01:00
Yi Kong
07d9ca7de3 Merge "Update to clang-r450784b" 2022-04-04 17:12:45 +00:00
Treehugger Robot
7a45d37e62 Merge "convert java_import jars with arch variants" 2022-04-04 16:06:55 +00:00
Paul Duffin
ea836c2baf analyze_bcpf: Indent multi-line text to improve formatting
Addresses a comment on the review of the initial changes to add
analyze_bcpf script.

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: I8c030dcc1a29f106ca57dca8c97a5cb4425e7674
2022-04-04 16:59:36 +01:00
Yi Kong
3f0358bfda Update to clang-r450784b
Test: presubmit
Bug: 219872355
Change-Id: I2ea4855dfcbe9dd297bbd3cf96a451c35038498d
2022-04-03 04:26:03 +08:00
Bob Badour
3aae38d451 Merge "Revert "Revert "Build notice files from license metadata.""" 2022-04-02 00:43:34 +00:00
Cole Faust
0e2b256846 Correct type of dir function
It should return a string, not a list.

Bug: 227245326
Test: go test
Change-Id: If0cb382dede52200c0595ae939a8064641216af1
2022-04-01 11:49:24 -07: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
Ember Rose
1d3b79f78f Merge "Rename InvalidNullabilityOverride suppression" 2022-04-01 17:53:00 +00:00
Ember Rose
7c57af39e5 Rename InvalidNullabilityOverride suppression
Test: N/A
Bug: 227661934
Change-Id: I26fcb5b7de58e8c982054a5a54e3526e0b8be2a2
2022-04-01 10:38:54 -04: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
Paul Duffin
dbbb8374a2 signature_trie: Avoid unnecessary wrapping and unwrapping of values
Previously, Leaf.values() and Leaf.append_values() would wrap the
Leaf's value inside a list before appending it to the list of values.
So, the values list was actually a list of lists of values. The
get_matching_rows method would then use chain.from_iterable() to
flatten that list of list of values into a list of values.

This change removes the initial wrapping in a list and so removes the
need to flatten them into a single list. It also adds a test for the
values() method. Prior to this change the expected value would have
been [[1], ["A"], [{}]].

Bug: 202154151
Test: atest --host analyze_bcpf_test signature_trie_test verify_overlaps_test
Change-Id: Ida78500c9ab4466de127b2c36501b3606d0f3fe5
2022-04-01 15:04:23 +01:00
Bob Badour
2a5c090c31 Fix breakage: bad path join using '/' literal
Typo in filename s/b NOTICE.html.gz not NOTICES.html.gz

Bug: 227682036

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

Change-Id: I75cc28e3ef22d975ad46f4e167071f6d82ba253d
2022-03-31 23:40:28 -07:00