Commit graph

1372 commits

Author SHA1 Message Date
Treehugger Robot
4a349ab66b Merge "Friendly error message on apex_available and min_sdk_version checks" 2021-03-05 03:30:11 +00:00
Makoto Onuki
e9d0de4932 Merge "Remove myself from the OWNERS" 2021-03-04 17:04:53 +00:00
Lukács T. Berki
ddebd2c82a Merge "cd to / before running soong_build ." 2021-03-04 07:07:02 +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
Xin Li
cbcc5b7179 Merge "Merge RQ2A.210305.007" 2021-03-03 21:41:40 +00:00
Xin Li
2964583d62 Merge RQ2A.210305.007
Bug: 180401296
Merged-In: I422ccc35977e0be846bb7a3497a50c2fc2c42e92
Change-Id: I230429666794c8218e515099292600d77a4b9604
2021-03-03 09:12:01 -08:00
Makoto Onuki
55418f8c37 Remove myself from the OWNERS
Bug: n/a
Test: n/a
Change-Id: I84f09ac8dc619921d4f8adfc3ea56f5ee01510a2
2021-03-03 08:21:17 -08:00
Mathew Inwood
f8dcf5ead2 Make apex.updatable default to true.
Update tests accordingly and add a new test case for this.

Bug: 180375550
Test: Treehugger
Change-Id: I835e189f4dae1e4bc79dce7bc59b7b9c7bd19fd9
2021-03-03 10:28:26 +00:00
Lukacs T. Berki
7690c09953 cd to / before running soong_build .
This lets one avoid any decisions as to when to chdir there during its
execution and leads to better sandboxing because the pwd doesn't leak to
init() functions anymore.

Test: Manual.
Change-Id: I1560da8ed3a621249426f9e8908aa890c21e13ba
2021-03-03 09:14:22 +01:00
Colin Cross
fdf28ca403 Merge changes I3e6bc9b5,If9f8fb10
* changes:
  Disable TestSendLog on the buildbots
  Remove global state from VNDK apexes
2021-03-03 01:45:02 +00:00
Paul Duffin
b267e12670 Merge "Verify the prebuilt_apex selects the correct input apex file" am: 9b41efabd1
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1610797

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I422ccc35977e0be846bb7a3497a50c2fc2c42e92
2021-03-02 21:36:01 +00:00
Paul Duffin
6f342644d0 Merge "Add test to verify the deapexer rule's input apex file" am: 30c9fe93e0
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1610796

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ibb6beaaa979cb14cf005a9bed7fd851253f91115
2021-03-02 21:26:58 +00:00
Colin Cross
2807f0047b Remove global state from VNDK apexes
Use the name of the apex instead of a global map to find the right
VNDK apex for each VNDK version.

Bug: 181689854
Test: apex tests
Change-Id: If9f8fb10d09e125c9e7d44228e1aa746bf53c082
2021-03-02 12:23:16 -08:00
Hyundo Moon
4416350471 Add modules-annotation-minsdk in allowed_deps
This enables using @MinSdk in media APEX.

Bug: 181649697
Test: Builds successfully
Change-Id: If69d0a6e84e31d26484c7e29dfdde4f14410a024
2021-03-02 17:22:34 +00:00
Paul Duffin
4b786d2da1 Merge "Remove deapexer and prebuilt apex select mutators" 2021-03-02 10:48:29 +00:00
Paul Duffin
9b41efabd1 Merge "Verify the prebuilt_apex selects the correct input apex file" 2021-03-02 10:47:48 +00:00
Paul Duffin
30c9fe93e0 Merge "Add test to verify the deapexer rule's input apex file" 2021-03-02 10:47:33 +00:00
Treehugger Robot
3310e2d9ea Merge "APEX uses the latest version of the stub" am: ce80f18749
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1609533

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I294103da51c7a9ad11a81e3eadb1a0e2e98920e8
2021-03-02 02:03:34 +00:00
Treehugger Robot
ce80f18749 Merge "APEX uses the latest version of the stub" 2021-03-02 01:02:18 +00:00
Paul Duffin
764a15f4e5 Merge "Allow java_sdk_library_import to contribute to hiddenapi processing" am: 69804ac388
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1609478

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I9c06fde9d8d3f34ec60bea58bfa39f5dc98a66bd
2021-03-01 19:31:06 +00:00
Paul Duffin
b1426419ec Merge "Retrieve dex implementation jars from apex for java_sdk_library_import" am: 0a8d5248ef
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1609477

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ia9e4f4591c7fc3ee8ab303635a71ac84b1a99327
2021-03-01 19:30:32 +00:00
Paul Duffin
c04fb9e6a2 Remove deapexer and prebuilt apex select mutators
Originally, when the prebuilt_apex was first created, it selected the
source to use in its DepsMutator. It did that because that was a
convenient place for it to perform that work which had to be:
* After the arch mutator had run so MultiTargets() was available.
* Before the prebuilt_select mutator runs as that relied on the Source
  property to have been set.

Change 064b70c9 then duplicated the call from the DepsMutator of the
deapexer module type that was added as part of the work to make dex
files available for hiddenapi processing.

Change 356f7d45 moved it out of the the DepsMutator methods into its
their own mutators, presumably because it interfered with the
Soong -> Bazel conversion work.

This change improves the existing PrebuiltSrcsSupplier mechanism to
support reporting errors so that the logic for selecting the source can
be done on demand rather than in separate mutators.

The main complication was that PrebuiltSrcsSupplier is called with a
BaseModuleContext for both source and prebuilt modules so it cannot use
any methods on it that are related to the current module. That
necessitated adding MultiTargets() to android.Module.

Bug: 181267622
Test: m droid
Change-Id: I106c78fd21016f051a315b82b470d8f12b1f820b
2021-03-01 17:11:25 +00:00
Paul Duffin
0d10c3c304 Verify the prebuilt_apex selects the correct input apex file
This will ensure that the following refactoring does not change the
behavior.

Bug: 181267622
Test: m nothing
Change-Id: Ieb9b37c2a1ef609b2d6565c54c261439a1ce7147
2021-03-01 17:10:31 +00:00
Paul Duffin
f6932afeae Add test to verify the deapexer rule's input apex file
This will ensure that the following refactoring does not change the
behavior.

Bug: 181267622
Test: m nothing
Change-Id: I36ae9ec9a0a7977bd394f4100c72941052d763ac
2021-03-01 13:40:06 +00:00
Paul Duffin
3785673f9b Allow java_sdk_library_import to contribute to hiddenapi processing
Invokes hiddenAPIExtractInformation() on the java_sdk_library_import's
dex implementation jar provided by the deapexer (on behalf of
prebuilt_apex) so that hiddenAPI can extract the information it needs,
if anything, from the dex file.

The dex file provided by deapexer has already had the hiddenapi
information encoded into it so it does not need to do that again.

Usually, it would require a classes implementation jar as well in
order to extract information from UnsupportedAppUsage annotations but
that is not available for a java_sdk_library_import. Fortunately, the
modules that are currently affected by this do not contain any such
annotations. This just uses a public api stubs jar instead.

Bug: 181267622
Test: m nothing
Change-Id: I96275e46f8b7fecba88075319e9f2da5ae315c03
2021-03-01 12:58:28 +00:00
Paul Duffin
3985351df6 Retrieve dex implementation jars from apex for java_sdk_library_import
Bug: 181267622
Test: m nothing
Change-Id: Idd6af2482f48bd3a05db88b8a06dbbbdee01ef78
2021-03-01 12:58:28 +00:00
Jiyong Park
55549df051 APEX uses the latest version of the stub
Previously when an APEX whose min_sdk_version is set is linked to an
external library providing multiple versions of stubs, the
maximum version that is less than or equal to the min_sdk_version was
chosen. For example, if the versions of a library stubs are 28, 29, 30,
and 31, then APEX with min_sdk_version: 29 linked to the version 29 of
the stub.

This was to ensure that the APEX doesn't use any new APIs whose
existence can't be guaranteed.

This however imposes a severe restriction that the APEX can never use
new APIs even when the APIs are actually available: i.e. when the
APEX is running on a newer platform.

With the recent work about unguarded availability, using the future APIs
became much safer. When you use an API that is newer than your
min_sdk_version, the API is automatically declared as a weak symbol
(thus no link error at runtime), while the call to API is guaranteed to
be guarded with the `__builtin_available(...)` macro.

So, there really is no reason to use the old version of the stub. We can
always use the latest version of stub safely.

Bug: N/A
Test: m
Change-Id: Iaac0d8761d8929154527dc2e861a51ae31e23d49
2021-03-01 09:12:32 +00:00
Lorenzo Colitti
1fd8f115b2 Merge "Add the new NetworkStack shim libraries to APEX allowed deps." am: 9023138b5e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1597976

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Icaefda26de292dc9b3bd011cc13c36d0f8893e10
2021-02-24 16:39:00 +00:00
Lorenzo Colitti
9023138b5e Merge "Add the new NetworkStack shim libraries to APEX allowed deps." 2021-02-24 16:01:08 +00:00
TreeHugger Robot
4191ec7529 Merge "Merge ab/7061308 into stage." into stage-aosp-master 2021-02-23 08:43:12 +00:00
Treehugger Robot
277303f042 Merge "Add ctx to AndroidMkExtraEntriesFunc" 2021-02-22 22:40:31 +00:00
Treehugger Robot
4c666e81d0 Merge "Add modules-utils-build_system to allowed deps" 2021-02-22 18:22:46 +00:00
Treehugger Robot
d4b9d04557 Merge "update apex/allowed_deps.txt" 2021-02-22 15:38:08 +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
Xin Li
982c52b034 Merge ab/7061308 into stage.
Bug: 180401296
Merged-In: I4638ba660a8cc1748693224ac15e6aa6cad33646
Change-Id: I24dd13b52b3f3a007d79753e32cb64e7f36df47c
2021-02-21 09:24:23 -08: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
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
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
Martijn Coenen
15679b7b27 Merge "Add MediaProvider dependencies to allowed_deps.txt" 2021-02-18 16:55:38 +00:00
Jiyong Park
4941e4b9d1 Merge "Linktype check error message becomes more correct" 2021-02-18 11:32:03 +00:00
Martijn Coenen
fd66847ac1 Add MediaProvider dependencies to allowed_deps.txt
Bug: 180375550
Test: builds
Change-Id: I0f5acf1f2de1f9f16294c0ef0e62a7bf48929aff
Merged-In: I0f5acf1f2de1f9f16294c0ef0e62a7bf48929aff
2021-02-18 09:17:07 +00:00
Jiyong Park
670e0f62a6 Linktype check error message becomes more correct
The type linkType has String() method and the error message is created
using it.

Bug: 180477804
Test: m nothing
Change-Id: I74fe9c93b74904177dbe9d29cd3aa3304b67ba4f
2021-02-18 13:10:18 +09:00
Jooyung Han
847f230c78 Merge "clean up hard-coded min_sdk_version (statsd)" 2021-02-18 00:00:00 +00:00
Jooyung Han
cc60da80fb clean up hard-coded min_sdk_version (statsd)
These modules set min_sdk_version explicitly.

Bug: 158059172
Test: m nothing
Change-Id: I0dc6e22b76eb433118e3ab509440d2a16812726e
2021-02-16 19:23:42 +09:00
Jiyong Park
0671146fd0 filesystems property can be specific to arch
Some filesystems (like boot_image type) are arch-specific. This change
allows us to have filesystems property inside the arch.<arch> struct.

Bug: 178978059
Test: m
Change-Id: I09faa6186b4a3fa35f348fc0805d894b4dc27ffd
2021-02-16 06:58:57 +09:00
Colin Cross
b87f4b4cab Merge "Convert java.Dependency to JavaInfo provider" 2021-02-13 00:39:24 +00:00
Lev Proleev
56ca4e4706 Merge "Add NNAPI AIDL interface to allowed deps" 2021-02-10 16:45:19 +00:00
Treehugger Robot
b68036f44b Merge "Add LOCAL_LICENSE_KINDS to build/soong" 2021-02-10 07:18:29 +00:00
Colin Cross
dcf71b299c Convert java.Dependency to JavaInfo provider
Export information about java dependencies through a Provider
instead of accessing the module directly.

Test: java_test.go
Test: no changes to build.ninja
Change-Id: Ifc5d566bf6f6ebc0ad399e948effaa1ef6a22876
2021-02-09 15:36:25 -08:00