Commit Graph

34591 Commits

Author SHA1 Message Date
Treehugger Robot
4cb095e8cb Merge "Correct fmt printf error in bazel_handler" am: b48f9aefea am: d8c28dfd69
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1619139

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I88e0f0ff9862f46c33bb3f5288652c11d8a84843
2021-03-05 19:57:34 +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
Treehugger Robot
d8c28dfd69 Merge "Correct fmt printf error in bazel_handler" am: b48f9aefea
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1619139

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Iaf74e8841adda51297bd68a949b921bb95939028
2021-03-05 18:44:20 +00: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
Paul Duffin
94f5e6d478 Merge "Reformat license code to comply with preupload checks" am: 279790a48a am: 79a2c4d119
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1619699

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I907af15c01139df8cb60d097d155bd122399e41d
2021-03-05 09:56:00 +00:00
Paul Duffin
79a2c4d119 Merge "Reformat license code to comply with preupload checks" am: 279790a48a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1619699

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I098c5846f77d7ef0e6f544179d63dd6681f96a6e
2021-03-05 09:17:47 +00:00
Paul Duffin
279790a48a Merge "Reformat license code to comply with preupload checks" 2021-03-05 08:51:49 +00:00
Treehugger Robot
0aa0afdfe2 Merge "Friendly error message on apex_available and min_sdk_version checks" am: 4a349ab66b am: 5bb26755f9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1614908

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ia42eb7ea29401fc53c188ded76315072080b85cd
2021-03-05 05:57:35 +00:00
Julien Desprez
97b3107dbd Merge "Revert "Attempt to run all java_test_host that look unit tests"" am: bbfd5f5e7c am: f1fb4af6e9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1619801

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ic27644feb15de79119e81edb4c1c69b6b6688b0d
2021-03-05 05:54:51 +00:00
Treehugger Robot
5bb26755f9 Merge "Friendly error message on apex_available and min_sdk_version checks" am: 4a349ab66b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1614908

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I1bf9ef6394eefb01ca629010824f71b53e5e5b20
2021-03-05 05:20:30 +00:00
Julien Desprez
f1fb4af6e9 Merge "Revert "Attempt to run all java_test_host that look unit tests"" am: bbfd5f5e7c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1619801

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I133ec8120d1e3e406fe6bf5c5c9fce220837c064
2021-03-05 05:08:04 +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
Makoto Onuki
fe185ffa11 Merge "Remove myself from the OWNERS" am: e9d0de4932 am: f8a09af582
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1615279

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I78ebb78934af20071071cbdd96625899c5c8e9fe
2021-03-04 18:57:34 +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
f8a09af582 Merge "Remove myself from the OWNERS" am: e9d0de4932
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1615279

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I0a904d75d75106086fa81c8fd407ed0266bf2288
2021-03-04 17:46:50 +00: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
79a20e730b Make tests work again on Darwin. am: deba72161c am: f4c124f618
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1614816

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I614419dae630d82020ec53dbd28521f12145011b
2021-03-04 13:45:41 +00:00
Lukacs T. Berki
f4c124f618 Make tests work again on Darwin. am: deba72161c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1614816

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Id671b831f791277e6c5520eb0fa458fa58bdbf41
2021-03-04 13:08:48 +00: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
13dac96f2c Merge "cd to / before running soong_build ." am: ddebd2c82a am: db9632fbd0
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1609473

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I6fb83ce60ddefcfdff85db83c05a9fc45dc27a9c
2021-03-04 08:37:36 +00:00
Lukács T. Berki
db9632fbd0 Merge "cd to / before running soong_build ." am: ddebd2c82a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1609473

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: If4936c514dbb38c68d075952d60a8801383eaf55
2021-03-04 07:58:47 +00:00
Lukács T. Berki
ddebd2c82a Merge "cd to / before running soong_build ." 2021-03-04 07:07:02 +00:00
Petri Gynther
7ef30ccea2 Merge "Rename vendor-ramdisk to vendor_ramdisk" am: 7d3f2caec0 am: 3a54e1e1d5
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1614008

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Icf78e6b5d057b393e4a2a7f634a3b43be435599e
2021-03-04 06:11:13 +00:00
Petri Gynther
3a54e1e1d5 Merge "Rename vendor-ramdisk to vendor_ramdisk" am: 7d3f2caec0
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1614008

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I057d6c211c2da36e07af71505e8cb33825ab6d9c
2021-03-04 05:23:57 +00:00
Treehugger Robot
85d42a3590 Merge "init_rc and vintf_fragments appear in PackagingSpecs()" am: 6cfd3eeed3 am: 32da168930
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1614659

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Id6bea76a81035746256fc18d95168c85d7423f74
2021-03-04 04:42:03 +00:00
Julien Desprez
e2af725162 Merge "Attempt to run all java_test_host that look unit tests" am: ce45b73070 am: e4e279ec9e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1597083

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I3d26cf98224741a15341c6ba09d1371c8ae1c838
2021-03-04 04:41:41 +00:00
Petri Gynther
7d3f2caec0 Merge "Rename vendor-ramdisk to vendor_ramdisk" 2021-03-04 04:40:04 +00:00
Treehugger Robot
32da168930 Merge "init_rc and vintf_fragments appear in PackagingSpecs()" am: 6cfd3eeed3
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1614659

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: If2f74ee19e7c907a2f8f1e5a2d0c7701f8d56a7a
2021-03-04 04:08:53 +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
Julien Desprez
e4e279ec9e Merge "Attempt to run all java_test_host that look unit tests" am: ce45b73070
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1597083

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ieddf9035c5ea19c743a140076227d55c0fd735cc
2021-03-04 04:02:40 +00:00
Treehugger Robot
6cfd3eeed3 Merge "init_rc and vintf_fragments appear in PackagingSpecs()" 2021-03-04 02:10:37 +00:00