Commit graph

32856 commits

Author SHA1 Message Date
Paul Duffin
a43f927cd6 Add sdk test for incorrect handling of generated headers
Bug: 180427921
Test: m nothing
Change-Id: I3d7ff2625eb5c6f5ed5e094da2a5ce6acc0c987c
2021-02-22 18:23:22 +00:00
Paul Duffin
75b902a964 Separate versioned/unversioned testing in sdk/cc_sdk_test.go
Uses new capability added in previous change to separate the testing of
the versioned and unversioned snapshots in sdk/cc_sdk_test.go. Any test
that generated an _snapshot module that simply listed the modules and
did not check a new type only tests the unversioned output to reduce
the duplication and cost of changing the tests.

Bug: 180479010
Test: m nothing
Change-Id: If11f82b3dd8ec79110b3a2f5adf193b6464000ab
2021-02-22 18:23:22 +00:00
Paul Duffin
d075907d29 Support testing versioned/unversioned sdk Android.bp files separately
Previously, the only way to test the Android.bp file generated by the
sdk module was to test both the unversioned and versioned parts
together. This change allows them to be tested separately.

Bug: 180479010
Test: m nothing
Change-Id: I3d695bcfbff030a6da393283ab30ec0979fb2826
2021-02-22 18:23:22 +00:00
Treehugger Robot
4c666e81d0 Merge "Add modules-utils-build_system to allowed deps" 2021-02-22 18:22:46 +00:00
Paul Duffin
37e0de5004 Only export sysprop headers in exported sysprop include directory
Bug: 180712399
Test: m nothing
Change-Id: Ia93d20fe0fecf977773257fa43fe40e7fe9f024f
2021-02-22 18:05:18 +00:00
Paul Duffin
33056e8a9a Export aidl, proto and sysprop generated headers separately
Previously, a cc library that included .aidl, .proto and/or .sysprop
files and exported headers generated from at least one of those types
would actually export generated headers from all of them.

While headers generated from .sysprop files are always exported those
generated from .aidl or .proto should only be exported when explicitly
requested.

This change treats them separately as expected. It has the potential
to break the build as it could reduce the set of headers exported and
so a dependent module that needed those would break. The fix in that
case is to simply add one (or both) of the following to the module
that previously exported those headers:

  aidl: {
    export_aidl_headers: true,
  }

  proto: {
    export_proto_headers: true,
  }

Bug: 180712399
Test: m droid
Change-Id: I488182e27dd423d261443612f98d5c112dd3ef8f
2021-02-22 18:05:10 +00:00
Paul Duffin
bc179bc44f Merge "Add tests for exported generated headers" 2021-02-22 18:03:00 +00:00
Ulya Trafimovich
8c35fcf4d5 Add non-fatal mode for verify_uses_libraries check.
The new mode is enabled with environment variable
RELAX_USES_LIBRARY_CHECK. If the variable is set to true, then a
verify_uses_libraries check failure does not fail the build, instead it
sets a special compiler filter "extract" for dexpreopt, which means that
the DEX file will be extracted, but it won't be compiled to native code.
Class loader context will be set to empty in this case (not &, as it is
going to be deprecated soon).

If the variable RELAX_USES_LIBRARY_CHECK is unset or set to something
other than "true", then the old behaviour of the verify_uses_libraries
check is preserved.

The intended use case for this flag is to have a smoother migration path
for the Java modules that need to add <uses-library> information in
the build files. The flag allows to quickly silence build errors. This
flag should be used with caution and only as a temporary measure, as it
masks real errors and affects performance.

verify_uses_libraries check is reworked so that it writes the error
message to a status file (which is used instead of the former timestamp
file). Currently the stored error message is not used, but it may be
used later to produce a warning. Dexpreopt command checks if the status
file exists and is nonempty; if that is the case, then compiler filter
is set to "extract".
Bug: 132357300

Test: Manually add some mismatch between the libraries in the Android.bp
      and Android.mk files for dexpreopted apps, build with
      RELAX_USES_LIBRARY_CHECK=true and obsserve that the build doesn't
      fail and they are compiled with compiler-filter "extract".
      Unset RELAX_USES_LIBRARY_CHECK and observe that the build fails.

Change-Id: Ibb5d993a25b1df1d2e70b7d5aafc6997f9d64e67
2021-02-22 15:41:03 +00:00
Treehugger Robot
d4b9d04557 Merge "update apex/allowed_deps.txt" 2021-02-22 15:38:08 +00:00
Jingwen Chen
ba369adff1 bp2build: Unexport GenerateBazelTargetsForDir.
Resolving a comment from aosp/1595678

Test: build/bazel/scripts/milestone-2/demo.sh
Change-Id: Ia7aba2b149fc09615fbafee67838632c71320f1b
2021-02-22 10:22:58 -05:00
Anton Hansson
f19be717c6 Merge "Remove sdkext apex_available allowlist" 2021-02-22 12:20:00 +00:00
Christoffer Quist Adamsen
e850737ee4 Allow missing classes in R8 builds
Bug: 180878971
Bug: 72683872
Test: TARGET_PRODUCT=aosp_arm64 m -j core-oj
Change-Id: I663220567eb8f034d3efccc60228aef91c716e8e
2021-02-22 12:09:01 +00:00
Lorenzo Colitti
97ca28e990 Add the new NetworkStack shim libraries to APEX allowed deps.
These are not currently tracked before because the shims are just
filegroups. aosp/1598155 is turning them into libraries so each
shim can build with the appropriate SDK version.

Test: m
Change-Id: I9df3dd98d46f49943211cb0893493d628ddd157c
Merged-In: I9df3dd98d46f49943211cb0893493d628ddd157c
2021-02-22 20:32:34 +09:00
Anton Hansson
6536ad7d0f Remove sdkext apex_available allowlist
Not needed anymore.

Bug: 180886919
Test: m
Change-Id: I1f716076eeb44c979e92b767ea67692649e1bfb4
2021-02-22 10:08:40 +00:00
Thiébaud Weksteen
9997ea73a3 Setup ANDROID_RUST_VERSION env variable
Some crates (i.e. rustversion) probe at build time the version of Rust
to enable features or tests. Pass the version via an environment
variable so it can be used by a patched crate.

Bug: 178357400
Test: m librustversion
Change-Id: If57a6339b71d2188c56e7dc6709075e4537403b4
2021-02-22 10:56:43 +01:00
Treehugger Robot
4b5c5f9283 Merge "Add phony target for depsinfo." 2021-02-22 09:32:21 +00:00
Jingwen Chen
2391d08872 Merge "bp2build: add a simple UI to report migration progress." 2021-02-22 03:23:13 +00:00
Justin Yun
b4697b8125 Merge "Update test_min_api_level for cc_test" 2021-02-21 05:36:37 +00:00
Jeongik Cha
79f4ab21db update apex/allowed_deps.txt
Bug: 150820813
Test: m

Change-Id: Ib8ada6607b628a120103b64ea83132b3f3e6492e
Merged-In: Ib8ada6607b628a120103b64ea83132b3f3e6492e
2021-02-21 00:11:59 +09:00
Jeffrey Vander Stoep
8348e09173 Merge "Disable unnecessary_wraps clippy lint" 2021-02-20 07:06:41 +00:00
Jeffrey Vander Stoep
92c674dc32 Merge "Update Rust toolchain to 1.50.0" 2021-02-20 07:06:41 +00:00
Treehugger Robot
f0a869847a Merge "Remove EnforceRROExemptedTargets" 2021-02-20 01:47:43 +00:00
Justin Yun
107a4cb56c Update test_min_api_level for cc_test
By replacing MinApiLevelModuleController with
ShippingApiLevelModuleController, we don't need to define
api-level-prop option. The property name must not be a parameter but
be defined in the module controller.

test_min_sdk_version is removed as it is not used.

Bug: 178990561
Test: atest vts_core_liblp_test
Change-Id: Ib4660b91c7adb2ec8b970197dc6f65b8e6952a66
2021-02-20 00:46:21 +00:00
Colin Cross
aa2555387d Add ctx to AndroidMkExtraEntriesFunc
Add a ctx parameter to AndroidMkExtraEntriesFunc to allow them to
access providers.

Test: m checkbuild
Change-Id: Id6becc1e425c3c3d8519248f8c0ce80777fac7cc
Merged-In: Id6becc1e425c3c3d8519248f8c0ce80777fac7cc
2021-02-19 23:05:40 +00:00
Elliott Hughes
272649ceb5 Merge "__ANDROID_UNGUARDED_AVAILABILITY__ is gone now." 2021-02-19 22:27:11 +00:00
Evan Severson
5149805dcc Add modules-utils-build_system to allowed deps
Test: Treehugger
Bug: 178426097

Change-Id: I4c485b32c3479e08077206d497185b21aad45631
2021-02-19 10:59:54 -08:00
Elliott Hughes
5a8c9531e4 __ANDROID_UNGUARDED_AVAILABILITY__ is gone now.
So no need to keep `-D`ing it.

Bug: http://b/179067538
Test: treehugger
Change-Id: If5bcead40d3bb355c241e363a8f1a956cb144438
2021-02-19 10:43:19 -08:00
Paul Duffin
3cb603eb51 Add tests for exported generated headers
Improves the test coverage for exporting of generated headers. These
tests highlight the bug described in b/180712399.

Follow up changes will refactor and fix bugs in this code. Adding the
tests separately help ensure that those changes do not inadvertantly
change the behavior.

Test: m nothing
Bug: 180712399
Change-Id: I0225b0cf53259071edb99a94be5014ed0e019bde
2021-02-19 17:12:01 +00:00
Julien Desprez
251261d01b Merge "Switch cc_test host_supported: true to unit tests" 2021-02-19 16:55:04 +00:00
Jeff Vander Stoep
41f8157ba7 Disable unnecessary_wraps clippy lint
Bug: 180268112
Test: build
Fixes: 180703142
Change-Id: I13f3de49318a6a9d2141042836a08ba7e300648f
2021-02-19 17:19:39 +01:00
Anton Hansson
a6bf4a189c Merge "Disallow using error-prone merge strategies" 2021-02-19 15:27:29 +00:00
Thiébaud Weksteen
052398b1ce Merge "Enable size measurement for Rust binaries" 2021-02-19 14:32:01 +00:00
Jingwen Chen
164e0867fc bp2build: add a simple UI to report migration progress.
Sample output:

[bp2build] cc_library_headers: 5 targets
[bp2build] cc_object: 5 targets
[bp2build] filegroup: 4 targets
[bp2build] genrule: 4 targets
[bp2build] sh_binary: 1 targets
[bp2build] Generated 19 total BUILD targets from 39270 Android.bp modules.

This CL adds an additional CodegenMetrics return value to
GenerateBazelTargets calls, which are called from bp2build, queryview,
and their tests. For this UI, we only want to use it for bp2build, and
not queryview or tests, since it's not useful for the former, and can
pollute the CLI for the latter.

Test: build/bazel/scripts/milestone-2/demo.sh
Change-Id: Ic84307a1ed1a25e360c9b23459e5449d932bc2e7
2021-02-19 09:30:11 -05:00
Anton Hansson
771fd524f2 Disallow using error-prone merge strategies
DO NOT MERGE / RESTRICT AUTOMERGE and its cousin DO NOT MERGE
ANYWHERE are almost always misused. Make it an error to upload
commits with those merge strategies.

Bug: 156896646
Test: repo upload -n (with DNM and RM commits)
Change-Id: Iae3540fa35dbd7b87a14b53a20be0cd23a206f3a
2021-02-19 13:05:54 +00:00
Treehugger Robot
f4dd965933 Merge "Add bloaty package" 2021-02-19 09:54:28 +00:00
Treehugger Robot
999314fd98 Merge "Add bloaty_merger" 2021-02-19 09:45:39 +00:00
Jiyong Park
4bbd6cfcaf bootimg supports building (non-vendor) boot.img
Bug: 178562516
Test: m microdroid_boot-5.10
Change-Id: I120fc954eb00362bdd2c02e3f3ef147670c69d8f
2021-02-19 18:26:32 +09:00
Jingwen Chen
4e86b6ae43 Merge "bp2build: cc_object converter." 2021-02-19 03:54:43 +00:00
Inseob Kim
525fdd57b5 Merge "Allow uninstallable prebuilt_etc to be packaged" 2021-02-19 03:49:33 +00:00
Jeongik Cha
cee5ba973d Remove EnforceRROExemptedTargets
There is no more target relying on EnforceRROExemptedTargets

Bug: 150820813
Test: m
Change-Id: If50d22c0e4f99e8c50d6a30cb94a0c3a5646b6fa
2021-02-19 12:16:12 +09:00
Eric Holk
277b0e7f41 Make statsd apex available as a prebuilt
Bug: 178236337
Test: build-mainline-modules.sh
Change-Id: I807eca7c5296227f4b593fc9f52d29bd20e78645
2021-02-18 17:39:51 +00:00
Martijn Coenen
15679b7b27 Merge "Add MediaProvider dependencies to allowed_deps.txt" 2021-02-18 16:55:38 +00:00
Pedro Loureiro
8a75058d3f Merge "Add support for lint baseline files" 2021-02-18 15:53:13 +00:00
Thiébaud Weksteen
df229cb00a Enable size measurement for Rust binaries
Bug: 172339742
Test: m out/soong/binary_sizes.pb
Change-Id: Ibc9feaa1c806b888d8850303ab7eeaf5e5337e35
2021-02-18 15:46:19 +01:00
Thiébaud Weksteen
6d48aad0ff Add bloaty package
This package can be used by other binary generator to gather the section
sizes at build time. It uses bloaty_merger to export all the measured
data into a single proto file.

Bug: 172339742
Test: m out/soong/binary_sizes.pb
Change-Id: I0ca87cdb2fb8b77226e79d9dcd762abe64aeea51
2021-02-18 15:46:14 +01:00
Treehugger Robot
ca52bfcf0f Merge "Further simplify the link type check routine" 2021-02-18 13:54:27 +00:00
Mathew Inwood
29bb2fd7ed Add phony target for depsinfo.
Test: m com.android.art-depsinfo
Change-Id: I13d741b0cbc9f5dbc9a28c9c28d17f89a2b20232
2021-02-18 11:36:40 +00:00
Jiyong Park
4941e4b9d1 Merge "Linktype check error message becomes more correct" 2021-02-18 11:32:03 +00:00
Jiyong Park
7f87e1ab49 Further simplify the link type check routine
Bug: 180477804
Test: m nothing
Change-Id: I216be96cf844fe42ba0cec467eea8520ff4ef4f2
2021-02-18 20:29:05 +09:00
Pedro Loureiro
5d190cc24e Add support for lint baseline files
Test: m droid
Test: go test ^TestJavaLint # (from soong/build/java)

Change-Id: I249a0a0597b0bf8495460ed283b476ad2eb36edc
2021-02-18 11:15:30 +00:00