Commit Graph

34321 Commits

Author SHA1 Message Date
Paul Duffin 77bfa3e792 Merge "Do not ignore error when writing environment file" 2021-03-06 09:57:36 +00:00
Paul Duffin 6bd87750ae Merge "Add Errs to TestResult" 2021-03-06 08:46:38 +00:00
Paul Duffin 059f7f1ff3 Merge "Make error handlers treat any failures as fatal" 2021-03-06 08:45:54 +00:00
Paul Duffin 87d7dd918a Merge "Avoid SetErrorHandler mutating FixtureFactory" 2021-03-06 08:44:51 +00:00
Paul Duffin 0805d4ebdd Merge "Clean up cc.RegisterRequiredBuildComponentsForTest()" 2021-03-06 08:43:56 +00:00
Paul Duffin 166a488efe Merge "Rename FixturePreparers to GroupFixturePreparers" 2021-03-06 08:42:53 +00:00
Paul Duffin 97c8128eea Merge "Fix mutator ordering issue in apex tests" 2021-03-06 08:38:14 +00:00
Treehugger Robot d8570b3077 Merge "Remove wired corpus name, use the one from the environment" 2021-03-06 08:09:25 +00:00
Julien Desprez b1778a42cb Merge "Revert "Revert "Attempt to run all java_test_host that look unit..."" 2021-03-06 02:40:44 +00:00
Colin Cross 997f27aa03 Fix nested properties in soong config structs
Fix recursing into nested properties when creating the structs for
affectable properties in soong config modules.

Fixes: 181156850
Test: Test_createAffectablePropertiesType
Change-Id: I4fb645d7e334977d0bbf192c3b43a7bba8289f49
2021-03-05 17:26:37 -08:00
Colin Cross cd2df5dec6 Merge "Exempt framework-res from UseApiFingerprint" 2021-03-05 23:34:37 +00:00
Colin Cross 3903d401d0 Merge changes from topic "lint_repackage"
* changes:
  Remove lint outputs to prevent showing old lint results on error
  Make common dependencies of lint use restat
  Use repackaged lint binary
2021-03-05 23:34:14 +00:00
Sasha Smundak 5a27bdad7e Remove wired corpus name, use the one from the environment
Bug: 181825150
Test: run build/soong/build_kzip.bash, verify that the 'corpus' field
is still present and correct

Change-Id: I66cf44af9927d52c8fc014d93240d29c0e91c7ae
2021-03-05 15:23:04 -08:00
Colin Cross 382ba06c27 Pass ANDROID_SDK_HOME to metalava so it doesn't write to ~/.android
Give metalava an ANDROID_SDK_HOME directory in the out tree so it
doesn't write to ~/.android.

Bug: 181908035
Test: mv ~/.android ~/.android.bak && m car-doc-stubs
Change-Id: I63064ece62ff4aa1eb93cbb6c9e33038c1e8a19d
2021-03-05 14:01:44 -08:00
Paul Duffin eaadd67a99 Reinstate the enforcement of stable core platform API usage
It appears as though change I3a39be5f0b8736de4822c6a14072c78d4e4ad89d
accidentally stopped enforcing the use of the stable core platform
API in AOSP when the changes from rvc-dev-plus-aosp-without-vendor were
merged in.

Unfortunately, since then some additional usages of legacy core
platform APIs have crept in so this adds the affected modules to the
list of modules allowed to use the legacy core platform APIs.

Bug: 180399951
Test: m checkbuild
Change-Id: Ieddaf859f568bc8ee486692474a4dec48b3d25e6
Merged-In: I15e5a6c2f07e73718803501d705de0d7ab9bec90
Merged-In: Ib084ee6676d4a201f4b60533221036245d3be759
Merged-In: I629ed1454def5cf8164a6079034e2c610ed0a554
Merged-In: Ia7613f35c4392eac51c94b0d1da29ecac82eb103
2021-03-05 21:29:41 +00:00
Jaewoong Jung 083e6cd267 Merge "Clear remains of java.Dependency interface." 2021-03-05 21:11:15 +00:00
Colin Cross 2669e7edf0 Exempt framework-res from UseApiFingerprint
Generating the API fingerpring depends on framework-res, so the
fingerprint cannot be embedded into framework-res.  Hardcode an
exemption to UseApiFingerprint.

Bug: 181978889
Test: TARGET_BUILD_VARIANT=user UNBUNDLED_BUILD_TARGET_SDK_WITH_API_FINGERPRINT=true vendor/google/build/build_mainline_modules.sh
Change-Id: I621f36d5eb157dd97baa132ff109b4df791eedcc
2021-03-05 19:54:31 +00:00
Colin Cross 2787e8e65e Support robolectric prebuilts in android_robolectric_test
The version of robolectric in external/robolectric-shadows is based
on 4.1 and is difficult to update.  Support using the prebuilt versions
in prebuilts/misc/common/robolectric, with the caveat that they won't
support the in-progress SDK version.

Bug: 181886851
Test: manual
Change-Id: Ie3a861cf6d637f97cf00212c02322f92c1043f0a
2021-03-05 19:22:30 +00:00
Colin Cross 31972dc487 Support remoting lint commands with RBE
Bug: 181681346
Bug: 181912787
Test: m USE_RBE=true RBE_LINT=true lint-check
Change-Id: I10596c40dc5e29075ba0cab51ea9a98cc58b3188
2021-03-05 11:13:40 -08:00
Paul Duffin 6d119b804c Fix mutator ordering issue in apex tests
Previously, the override mutators were being run before the prebuilt
mutators that did not match the runtime behavior. This change fixes
that ordering.

In the process it broke TestApexWithAppImportsPrefer. That test tries
to verify that an apex that depends on an android_app will use an
android_app_import if that is preferred. Unfortunately, it only worked
because of the incorrect order of the mutators.

The test worked before this change because the prebuilt mutators were
being run after the overridableModuleDepsMutator. That meant that any
dependencies added by that mutator onto source modules could be
replaced by the PrebuiltPostDepsMutator with the preferred prebuilt
module.

Switching the order to match the runtime meant that the prebuilt
mutators were run before the overrides so never had a chance to replace
the dependencies added by the overrides.

Bug: 181953909
Bug: 181974714
Test: m nothing
Change-Id: Ic98fdc29a63155174a3227e7e918b26f0a8763bb
2021-03-05 18:38:58 +00:00
Paul Duffin 942481b3f5 Add Errs to TestResult
Makes the error handler a little cleaner.

Bug: 181070625
Test: m nothing
Change-Id: I0f9050a98346d7d214eed570957d9810aaf26def
2021-03-05 18:20:33 +00:00
Paul Duffin ea8a386346 Make error handlers treat any failures as fatal
A lot of existing tests that expect errors to be reported do not check
the returned result. This change treats failures of the error handler
in that situation as fatal.

The default error handler already behaved that way. The others did not.

FixtureExpectsAllErrorsToMatchAPattern uses
CheckErrorsAgainstExpectations and it was safe to just make that func
treat any unmatching errors as fatal as all the existing usages are at
the end of test functions.

FixtureExpectsAtLeastOneErrorMatchingPattern uses the
FailIfNoMatchingErrors function which is used in a number of places
(including CheckErrorsAgainstExpectations) that do not want to treat
a test failure as fatal. So, that was modified to return false if no
matching error was found and the error handler treated that as fatal.

Bug: 181070625
Test: m nothing
Change-Id: I6e4df53f93250348bc050d4ff098134e6314ae30
2021-03-05 18:20:33 +00:00
Paul Duffin 52323b5113 Avoid SetErrorHandler mutating FixtureFactory
A FixtureFactory is supposed to be immutable to allow them to be safely
shared but unfortunately the implementation of SetErrorHandler broke
that constraint. That made it very easy to mistakenly add an error
handler specific to a test to a shared factory breaking other tests
that use that factory.

This change causes SetErrorHandler to create a new instance of the
factory to avoid that.

Bug: 181070625
Test: m nothing
Change-Id: Ia5356a04189099c88880a2a521af29ab72560f30
2021-03-05 18:20:33 +00:00
Paul Duffin d6ceb8600c Clean up cc.RegisterRequiredBuildComponentsForTest()
Changes this function so it only registers components from the cc
package by pushing the call to genrule.RegisterGenruleBuildComponents()
down into those packages whose tests need it.

This will make it easier to migrate cc package tests to test fixtures
as the RegisterRequiredBuildComponentsForTest() no longer overlaps with
preparers from the genrule packages.

Bug: 181070625
Test: m nothing
Change-Id: Ic00c7e480dc738d7a88d038aca6ab95a1502a24a
2021-03-05 18:20:33 +00:00
Paul Duffin a560d5a91d Rename FixturePreparers to GroupFixturePreparers
FixturePreparers is a bad name for a method that creates a collection
of FixturePreparers for a couple of reasons:
* Conventionally it would be used as the name for []FixturePreparer if
  it is necessary to add behavior to that.
* There are many different types of collection, particularly when order
  matters.

Bug: 181070625
Test: m nothing
Change-Id: I55394ff369375dcac2d7b72e4d803a4818762d36
2021-03-05 18:20:33 +00:00
Nicolas Geoffray 863f3b9fb4 Stop using '&' for class loader context.
Test: m
Bug: 132357300
Change-Id: I01a5008d5b84820f793c1c23fe2e4c4687cf4acf
2021-03-05 18:14:10 +00:00
Treehugger Robot b48f9aefea Merge "Correct fmt printf error in bazel_handler" 2021-03-05 18:08:39 +00:00
Julien Desprez b216661e84 Revert "Revert "Attempt to run all java_test_host that look unit..."
Revert reland the change after tests have been fixed

Reason for revert: relanding after fixes
Reverted Changes:
I89fbce4d7:Revert "Exclude some tests for java_test_host onbo...
Iaa89f9b7e:Revert "Attempt to run all java_test_host that loo...

Change-Id: Idaa80b2d5a8d3ba026e33b453bd163a4e2d31118
2021-03-05 18:08:36 +00:00
Paul Duffin 5e85c665d0 Do not ignore error when writing environment file
Test: m nothing
Change-Id: I4281e22ae10a649b51b9fbed7f8c1554f18885b9
2021-03-05 17:46:29 +00:00
Hai Zhang 9bb022a4aa Allow PermissionController to set min_sdk_version to 30.
PermissionController is updatable since R, so its minimum SDK version
should be 30.

Bug: 174770904
Test: build
Merged-In: I5c98dc0053687bd4601ab06f6e092aeb851cdba7
Change-Id: I5c98dc0053687bd4601ab06f6e092aeb851cdba7
2021-03-05 17:46:25 +00:00
Jaewoong Jung 62751102a9 Clear remains of java.Dependency interface.
Test: TreeHugger
Change-Id: If9dab2022a308b776d7ad760a61f0db97509b9b2
2021-03-05 14:57:51 +00:00
Jeongik Cha 480762d78b update apex/allowed_deps.txt
Bug: 150578172
Test: m
Change-Id: I0ea6b33c2d27081a5f0622edb0f5df4088a71455
Merged-In: I0ea6b33c2d27081a5f0622edb0f5df4088a71455
2021-03-05 21:47:22 +09:00
Paul Duffin 279790a48a Merge "Reformat license code to comply with preupload checks" 2021-03-05 08:51:49 +00:00
Treehugger Robot 4a349ab66b Merge "Friendly error message on apex_available and min_sdk_version checks" 2021-03-05 03:30:11 +00:00
Paul Duffin 3c298a3725 Reformat license code to comply with preupload checks
Bug: 181070625
Test: m nothing
Change-Id: I0b7c8613fcb7bc4e96908e391f1e46a9168f2507
2021-03-04 22:35:29 +00:00
Julien Desprez bbfd5f5e7c Merge "Revert "Attempt to run all java_test_host that look unit tests"" 2021-03-04 21:50:34 +00:00
Julien Desprez 1ab84fa433 Revert "Attempt to run all java_test_host that look unit tests"
Revert submission 1597083-java_test_host_default

Reason for revert: Getting ready for b/181888225 just in case
Reverted Changes:
I220551549:Attempt to run all java_test_host that look unit t...
I29dbbbf46:Exclude some tests for java_test_host onboarding

Change-Id: Iaa89f9b7e9ad72ed962cef285c70a6263e63ffd5
2021-03-04 21:08:36 +00:00
Ulya Trafimovich 6e55ef157c Disable verify_uses_libraries check if dexpreopt is globally disabled.
Without dexpreopt the check is not necessary, and although it is good to
have, it is difficult to maintain on non-linux build platforms where
dexpreopt is generally disabled (the check may fail due to various
unrelated reasons, such as a failure to get manifest from an APK).

Bug: 181570790
Bug: 132357300
Test: m nothing
Change-Id: Ie012690e8f047ae9256e26565d162c19af4e8921
2021-03-04 18:40:40 +00:00
Colin Cross 5c113d13eb Remove lint outputs to prevent showing old lint results on error
The lint rules dumped the text output file to stdout on error.  If the
lint binary exited without updating the output file it would show old
results.

Remove the output files before running lint, and only dump the text
output file if it exists.

Bug: 181681346
Test: m lint-check
Change-Id: I4fa962b1212e8715f234912a9a5e049d5c1540e8
2021-03-04 10:01:34 -08:00
Colin Cross 00d93b143f Make common dependencies of lint use restat
Use restat for the api_versions.xml and annotations.zip dependencies
of lint so that frameworks/base changes don't always result in
rerunning lint on every module.

Bug: 181681346
Test: m lint-check
Change-Id: Ic6a540b41cf79b21441311a8baefe528a3d90d8b
2021-03-04 10:00:09 -08:00
Colin Cross 84f3dc1c9d Use repackaged lint binary
Lint references lint-classpath.jar, which does not contain any classes
by has a manifest that points to other jars for the classpath.  This
breaks dependency tracking during the build.  Use a lint tool that
is repackaged into a single jar.

Bug: 181681346
Test: m lint-check
Change-Id: I07d2b7404c18626e03c5af3ef5a75dd7f899cb0e
2021-03-04 09:56:15 -08:00
Makoto Onuki e9d0de4932 Merge "Remove myself from the OWNERS" 2021-03-04 17:04:53 +00:00
Liz Kammer 15b04e2cbd Correct fmt printf error in bazel_handler
When running tests locally, it fails to build due to using the incorrect
formatting.

Test: go test soong test
Change-Id: Iccdc3fbc93e409d74f1b71d929dd9650492b401d
2021-03-04 09:45:21 -05:00
Lukacs T. Berki deba72161c Make tests work again on Darwin.
aosp/1609473 broke this by making originalEnv empty unless
InitEnvironment() is called, which doesn't happen in tests.

Bug: 181835672
Test: "m nothing" on Linux and Darwin.
Change-Id: I33f9cce65a9151e620e1dddafb62d4c599ed2cac
2021-03-04 10:54:50 +01:00
Lukács T. Berki ddebd2c82a Merge "cd to / before running soong_build ." 2021-03-04 07:07:02 +00:00
Petri Gynther 7d3f2caec0 Merge "Rename vendor-ramdisk to vendor_ramdisk" 2021-03-04 04:40:04 +00:00
Jiyong Park 767dbd9d3b Friendly error message on apex_available and min_sdk_version checks
1) suggest a fix at the end of the message
2) add new lines around the dependency path so that they are visually
separated from rest of the error message

Bug: N/A
Test: m with an intentional break
error: bionic/apex/Android.bp:32:1: module "com.android.runtime" variant "android_common_com.android.runtime_image": "libutils_headers" requires "libsystem_headers" that doesn't list the APEX under 'apex_available'.

Dependency path:
           via tag apex.dependencyTag: { name:executable payload:true}
    -> crash_dump{os:android,image:,arch:arm_armv8-a,sdk:,apex:apex10000}
           via tag cc.libraryDependencyTag: { Kind:staticLibraryDependency Order:normalLibraryDependency wholeStatic:false reexportFlags:false explicitlyVersioned:false dataLib:false ndk:false staticUnwinder:false makeSuffix: skipApexAllowedDependenciesCheck:false excludeInApex:false}
    -> libtombstoned_client_static{os:android,image:,arch:arm_armv8-a,sdk:,link:static,apex:apex10000}
           via tag cc.libraryDependencyTag: { Kind:staticLibraryDependency Order:normalLibraryDependency wholeStatic:true reexportFlags:true explicitlyVersioned:false dataLib:false ndk:false staticUnwinder:false makeSuffix: skipApexAllowedDependenciesCheck:false excludeInApex:false}
    -> libcutils{os:android,image:,arch:arm_armv8-a,sdk:,link:static,asan:,apex:apex10000}
           via tag cc.libraryDependencyTag: { Kind:headerLibraryDependency Order:normalLibraryDependency wholeStatic:false reexportFlags:false explicitlyVersioned:false dataLib:false ndk:false staticUnwinder:false makeSuffix: skipApexAllowedDependenciesCheck:false excludeInApex:false}
    -> libutils_headers{os:android,image:,arch:arm_armv8-a,sdk:,asan:,apex:apex10000}
           via tag cc.libraryDependencyTag: { Kind:headerLibraryDependency Order:normalLibraryDependency wholeStatic:false reexportFlags:true explicitlyVersioned:false dataLib:false ndk:false staticUnwinder:false makeSuffix: skipApexAllowedDependenciesCheck:false excludeInApex:false}
    -> libsystem_headers{os:android,image:,arch:arm_armv8-a,sdk:,asan:,apex:apex10000}

Consider adding "com.android.runtime" to 'apex_available' property of "libsystem_headers"

Change-Id: I09f92c3086ea433780133a33ba0ad73baee6dc41
2021-03-04 13:07:36 +09:00
Treehugger Robot 6cfd3eeed3 Merge "init_rc and vintf_fragments appear in PackagingSpecs()" 2021-03-04 02:10:37 +00:00
Julien Desprez ce45b73070 Merge "Attempt to run all java_test_host that look unit tests" 2021-03-04 02:00:58 +00:00
Xin Li cbcc5b7179 Merge "Merge RQ2A.210305.007" 2021-03-03 21:41:40 +00:00