Commit graph

20491 commits

Author SHA1 Message Date
Paul Duffin
2b9e3d39d9 Simplify java library sdk member code
Adds the accessor function for retrieving the impl/header jars to the
librarySdkMemberType structure instead of passing it into its
buildSnapshot() method.

That enabled:
* The removal of the [header/impl]LibrarySdkMemberType structs.
* The removal of their implementations of BuildSnapshot.
* Replacing buildSnapshot() with BuildSnapshot()

This will make subsequent refactoring of the SdkMemberType interface
a little simpler.

Bug: 153306490
Test: m nothing
Bug: 150451422
Merged-In: I1f96986bb497cf9d9df9916e40065f66b35a4704
Change-Id: I1f96986bb497cf9d9df9916e40065f66b35a4704
2020-04-22 12:51:29 +01:00
Paul Duffin
b0cbec3ada Add CommonOS variant for sdk
Adds a CommonOS variant for sdk that depends on the os specific
variants and is used to generate a single sdk for multiple OsTypes,
e.g. host linux and android.

At the minute the member types only support a single OsType but the
basic mechanism for managing the CommonOS variant and collating the
variants across all of them is there.

The only visible effect of this change is that the location of the
generated snapshot is changed, it is no longer os specific and instead
is in the same location irrespective of which os it is built for.

A lot of tests needed to be changed to specify "common_os" as the
variant type instead of the specific os type. As that is the same across
all tests it is hard coded in CheckSnapshot method.

Bug: 153306490
Test: m nothing
Bug: 150451422
Merged-In: If36be39b06d6910453649f7c288c2d34f688b2f4
Change-Id: If36be39b06d6910453649f7c288c2d34f688b2f4
2020-04-22 12:51:28 +01:00
Paul Duffin
290334dd7d Fix bug in error reporting when adding duplicate properties
Bug: 150451422
Bug: 153306490
Test: m nothing
Merged-In: Ia557992d71537aca0757866e9114b30bdf52bb6b
Change-Id: Ia557992d71537aca0757866e9114b30bdf52bb6b
2020-04-22 12:51:28 +01:00
Paul Duffin
bdd47a863a Avoid invoking sdk member to add empty list of dependencies
Simplifies debugging sdk membership code when it is only called if an
appropriate member is present.

Bug: 153306490
Test: m nothing
Merged-In: I32bc93e0484c829bdbd6b050822249feb6404f89
Change-Id: I32bc93e0484c829bdbd6b050822249feb6404f89
2020-04-22 12:51:27 +01:00
Paul Duffin
c2e3206507 Add windows to the list of available OS's in sdk tests
Makes the tests more realistic as they cover what happens when an sdk
OS specific variant is disabled (Windows is disabled by default). This
will allow issues around disabled variants to be detected early during
Soong bootstrapping.

Bug: 153306490
Test: m nothing
Merged-In: I7ec47dbca52e38750166d755daf706aadea12d15
Change-Id: I7ec47dbca52e38750166d755daf706aadea12d15
2020-04-22 12:51:27 +01:00
Paul Duffin
132e66f1b9 Add support for cc_library_headers in sdk/module_exports
Bug: 148933848
Bug: 153306490
Test: m nothing
Merged-In: Ife6ee0f736238727a11b4421532eaeb29d46c1b7
Change-Id: Ife6ee0f736238727a11b4421532eaeb29d46c1b7
2020-04-22 12:51:26 +01:00
Paul Duffin
5b47358ccc Prune any empty property sets from the modules before transforming
Ensures that the generated prebuilt modules do not contain empty
property sets.

Bug: 148933848
Bug: 153306490
Test: m nothing
Merged-In: I99d5da1c4e3a72836e81e021ef043df53888e66b
Change-Id: I99d5da1c4e3a72836e81e021ef043df53888e66b
2020-04-22 12:51:26 +01:00
Paul Duffin
ce5881f0a4 Simplify cc library sdk snapshot handling of include dirs/headers
Previously, the code for generating a snapshot of a cc library was
split into two separate phases. The first phase copied the files that
needed copying and the second phase added the properties for the
include dirs. This separation made it difficult to make sure that the
two phases were in sync.

This change merges those two phases together so the same paths used to
copy the files are used in the properties ensuring consistency. As the
various type of include dir and header were treated slightly different
to each other this parameterizes that behavior.

Bug: 142935992
Bug: 153306490
Test: m nothing
Merged-In: I7877464987bbdae9662e5e3f02bb5e5a75dca5a3
Change-Id: I7877464987bbdae9662e5e3f02bb5e5a75dca5a3
2020-04-22 12:51:25 +01:00
Paul Duffin
28246ac9ee Add support for transforming a property set after its contents
This change adds support for transforming a property set after its
contents. This allows a transform to recursively prune empty property
sets that were created for a module.

The transformPropertySet method was renamed to
transformPropertySetBeforeContents and a new
transformPropertySetAfterContents method was added.

Bug: 148933848
Bug: 153306490
Test: m nothing
Merged-In: Ia198d47e042b98c69406db4bc12859869816a387
Change-Id: Ia198d47e042b98c69406db4bc12859869816a387
2020-04-22 12:51:25 +01:00
Paul Duffin
853b8dbe0e Add cc_prebuilt_library_headers
In preparation for adding cc_library_headers support to
sdk/module_exports.

Two changes were needed to make the prebuilt version work.
1) Had to stop the prebuilt version of the library from creating static
   and shared variants for header only.
2) Had to allow the code to export/reexport include dirs to run even
   when no src is provided.

Bug: 148933848
Bug: 153306490
Test: m nothing
Merged-In: Idd50ed38bc90d1d93551f78e6310f167941487d9
Change-Id: Idd50ed38bc90d1d93551f78e6310f167941487d9
2020-04-22 12:51:24 +01:00
Paul Duffin
598e1e0255 Fix issues with bp transformation
Returning nil from transformPropertySet in order to remove it did
not work because it ends up comparing as (*bpPropertySet, nil) and
not an untyped nil which causes the test against nil to fail.

This change adds tests to check that returning nil will delete a
property/property set from the containing property set and fixes the
code so that it passes the tests. It extracts common code to transform
a property set and its contents as well as code for creating new
property sets.

Bug: 148933848
Bug: 153306490
Test: m nothing
Merged-In: I35dc3c39c76e701821891622615c09b094cf697f
Change-Id: I35dc3c39c76e701821891622615c09b094cf697f
2020-04-22 12:51:24 +01:00
Paul Duffin
246ac3092f Separate cc_library_headers to its own file and add tests
Preparation for adding cc_library_headers to sdk.

Bug: 148933848
Bug: 153306490
Test: m nothing
Merged-In: Icbc86b21f44dc79393b82be339cf3b133cbf9d8c
Change-Id: Icbc86b21f44dc79393b82be339cf3b133cbf9d8c
2020-04-22 12:51:09 +01:00
Paul Duffin
ac897cfdf7 Allow compile_multilib to be specified on module exports
This is needed to allow the art-host-module-exports to restrict itself
to just managing the linux 64 bit version of the host tools as that is
the only variant that is currently supported by all host tools. This
greatly simplifies that process and allows us to make progress on the
unbundling.

Bug: 142935992
Bug: 153306490
Test: m nothing
Merged-In: I62d016d97c2df73e5feecf912638f477fedd97c9
Change-Id: I62d016d97c2df73e5feecf912638f477fedd97c9
2020-04-22 12:51:06 +01:00
Inseob Kim
eb59165dee Add C++ Host support on sysprop_library
With Host_supported: true, C++ part of sysprop_library will create host
variant which can be used from host modules. As there are no native
system property support on host, libbase functions will be used instead.
Adding support on host will help reduce code complexity of other
host_supported modules.

Bug: 147708854
Bug: 153306490
Test: m, sysprop_test, manually test host binary
Merged-In: I850d91fea298ef1a0c16c6a7a9ec1aca5cf37e69
Change-Id: I850d91fea298ef1a0c16c6a7a9ec1aca5cf37e69
2020-04-22 12:50:22 +01:00
TreeHugger Robot
d50865fcec Merge "Skip version mutator for host/ramdisk/recovery" into rvc-dev 2020-04-22 09:08:17 +00:00
TreeHugger Robot
077630ad2c Merge "Make sure car-lib system APIs are not changing unintentionally" into rvc-dev 2020-04-21 23:21:07 +00:00
Stephen Hines
2cc74a9621 Merge "Switch to clang-r377782d (10.0.6)." into rvc-dev 2020-04-21 21:43:18 +00:00
Oliver Nguyen
6f641c1cac Only package gcno files for gcov coverage builds.
Bug: 154550223
Test: m -j NATIVE_COVERAGE=true droid dist tests
Test: m -j CLANG_COVERAGE=true droid dist tests
Change-Id: I81598bcab8db105de6692156c001fc961409ce63
2020-04-21 12:40:27 -07:00
Makoto Onuki
91ec494500 Make sure car-lib system APIs are not changing unintentionally
Soon had a special rule to skip the "released-api" compatibility
check on the car-lib system API. We should enable it.

Bug: 154632388
Test: m droid
Change-Id: Ib4e584def7e786e3e129cd2bfb23958ac9b4b72d
2020-04-21 12:01:04 -07:00
Artur Satayev
695ddadcb4 Merge "Remove Android compat annotations on jarjar transform." into rvc-dev 2020-04-21 10:42:10 +00:00
Artur Satayev
a479d943dd Remove Android compat annotations on jarjar transform.
Set a system property to enable Android specific transformer that drops
UnsupportedAppUsage annotation for repackaged classes to avoid adding
unneeded hidden api symbols on jarjar.

Bug: 146418363
Test: m, manual diff hiddenapi-flags.csv
Exempt-From-Owner-Approval: patch approved by owner
Change-Id: I10b49feb15257301574162b5d389cbc30277f672
Merged-In: I10b49feb15257301574162b5d389cbc30277f672
(cherry picked from commit 762d9f38af)
2020-04-20 16:22:42 +01:00
Jeongik Cha
8691f3f75c Apply EnforceRROExemptedTargets in Soong
As PRODUCT_ENFORCE_RRO_EXEMPTED_TARGETS is defined in make, define it in
soong accordingly

Bug: 150820813
Test: m
Change-Id: I309482b6ad439a7602127f68f2f7ffa856b9e192
Merged-In: I309482b6ad439a7602127f68f2f7ffa856b9e192
2020-04-20 14:02:23 +00:00
Jiyong Park
d5e0ea25d1 Don't run apex_available check for coverage builds
Coverage build adds extra dependencies for the runtime libs. Marking
them and their transitive dependenciese with apex_available doesn't make
any value; it instead adds noise.

Exempt-From-Owner-Approval: cherry-pick from AOSP

Bug: 150999716
Test: m
Merged-In: I08e51cec1de6ded624ef9d4c41c1e5b2e611ff38
(cherry picked from commit 58d1090032)
Change-Id: I08e51cec1de6ded624ef9d4c41c1e5b2e611ff38
2020-04-20 16:26:18 +09:00
Jiyong Park
d182e5512f Remove some apex_available whitelist for the adbd APEX
The marked library(ies) were available to the adbd APEX via the
hand-written whitelist in build/soong/apex/apex.go. Trying to remove the
whitelist by adding apex_available property to the Android.bp of the
libraries.

Exempt-From-Owner-Approval: cherry-pick from AOSP

Bug: 150999716
Test: m
Merged-In: I6afbe905dda11056559521b937803dcd85b32fe5
(cherry picked from commit 3a0db5ef4e)
Change-Id: I6afbe905dda11056559521b937803dcd85b32fe5
2020-04-20 16:24:20 +09:00
Jiyong Park
24eec07f47 Make ndk_prebuilt_* be available to any apex
The NDK prebuilts are implicitly used when building with sdk_version set.
Make the module types be available to any apex so that we don't need to
manually add apex_available property to the module definitions manually.

Exempt-From-Owner-Approval: cherry-pick from AOSP

Bug: 150999716
Test: m

Merged-In: I0870afa4c74b4a06ab1273dff84615778561ecc9
(cherry picked from commit e01e228270)
Change-Id: I0870afa4c74b4a06ab1273dff84615778561ecc9
2020-04-20 16:23:46 +09:00
Jiyong Park
2416c2903e Remove some apex_available whitelist
The marked library(ies) were available to the APEXes via the hand-written
whitelist in build/soong/apex/apex.go. Trying to remove the whitelist
by adding apex_available property to the Android.bp of the libraries.

Exempt-From-Owner-Approval: cherry-pick from AOSP

Bug: 150999716
Test: m
Merged-In: I91d1b1076733a949ca2a959ba640ce34d0233492
(cherry picked from commit 541142ce6b)
Change-Id: I91d1b1076733a949ca2a959ba640ce34d0233492
2020-04-20 16:22:56 +09:00
Anton Hansson
39a06440cd Merge "Remove _API_FILE variables" into rvc-dev 2020-04-19 07:54:27 +00:00
Anton Hansson
336f63cfb2 Remove _API_FILE variables
There are no known usages of these variables, and many have been
incorrectly set for a long time.

Also convert the <module> phony for api txt to androidmk.

Bug: 152479829
Test: m
Change-Id: Iff355041d88eb59ac47dd19a03e993cf1ce3927e
Merged-In: Iff355041d88eb59ac47dd19a03e993cf1ce3927e
2020-04-18 10:15:11 +01:00
Stephen Hines
57a45f1304 Switch to clang-r377782d (10.0.6).
Bug: http://b/153164546
Test: Built aosp_blueline successfully. Kernel also verified without
needing workarounds from LLD crash.

Change-Id: I41ae5a5be0065da98dd941b16196a3f4888b86b1
Merged-In: I41ae5a5be0065da98dd941b16196a3f4888b86b1
(cherry picked from commit 883a0fdfd9)
2020-04-17 17:39:04 -07:00
TreeHugger Robot
5d42863476 Merge "Don't check elf properties of python prebuilts" into rvc-dev 2020-04-16 17:13:33 +00:00
Artur Satayev
735be9a37a Merge "Allow defining neverallow in packages other than android." into rvc-dev 2020-04-16 13:34:40 +00:00
Artur Satayev
0f43edcfc7 Merge "Check updatable APKs compile against managed SDKs." into rvc-dev 2020-04-16 13:34:39 +00:00
Artur Satayev
b39ea9b61c Allow defining neverallow in packages other than android.
This exposes test func on ValueMatcher and helpers relevant for testing neverallows.

Bug: 153333044
Test: m
Change-Id: Ied07cd33afa537f9d7aa3c33e59f4ac985901a0f
Merged-In: Ied07cd33afa537f9d7aa3c33e59f4ac985901a0f
Exempt-From-Owner-Approval: clean cherry-pick
(cherry picked from commit c5570ac9b1)
2020-04-16 13:34:31 +00:00
Artur Satayev
e5ac15a1b7 Check updatable APKs compile against managed SDKs.
As a follow up, this property will be set to APKs participating in mainline program.

Bug: 153333044
Test: m
Change-Id: I6ea2f3c1d26992259e4e9e6a6d8cecf091d39c43
Merged-In: I6ea2f3c1d26992259e4e9e6a6d8cecf091d39c43
(cherry picked from commit 2db1c3f1c4)
Exempt-From-Owner-Approval: clean cherry-pick
2020-04-16 13:34:13 +00:00
Dan Willemsen
cac82fe511 Don't check elf properties of python prebuilts
We're not doing a great job of copying over all the library dependencies (especially when using sanitizer libraries). Just omit these from the checks, which shouldn't really matter.

Bug: 151093572
Test: treehugger
Change-Id: I8470bbfbf36a51739e8a7e699ad090a66c9db8b2
Merged-In: I8470bbfbf36a51739e8a7e699ad090a66c9db8b2
(cherry picked from commit bc32a50ff4)
2020-04-16 00:03:35 -07:00
Anton Hansson
c6fff020f5 Merge "Create a framework.aidl for non-updatable platform" into rvc-dev 2020-04-15 11:13:36 +00:00
Martin Stjernholm
2a6e9d0b01 Fix missing NOTICE targets for static libs that aren't available to
platform.

The NOTICE file generation depends on the NOTICE targets for all static
library dependencies. If such a dependency didn't have
//apex_available:platform it didn't get any AndroidMk entry and hence
no NOTICE target via soong_cc_prebuilt.mk. If it was then depended upon
by a binary or library that is accessible to platform, the NOTICE
dependency failed.

Normally such a dependency is invalid, but there are corner cases where
binaries go neither into platform nor any APEX module, and they can
legitimately have such dependencies (cf. b/152241137).

With this CL requests to skip installation of such a static libraries
are ignored so that they get AndroidMk entries, which will always have
LOCAL_UNINSTALLABLE_MODULE set.

Test: "m simpleperf_ndk" with https://r.android.com/1273016, which
  removes //apex_available:platform from libs that simpleperf_ndk
  depends on statically.
Bug: 152241137
Bug: 149217815
Change-Id: If36e85dd16ade56d4ec1d6744811df5a15b6242c
Merged-In: If36e85dd16ade56d4ec1d6744811df5a15b6242c
2020-04-14 17:09:47 +01:00
TreeHugger Robot
89030a315a Merge "Clean com.android.neuralnetworks APEX whitelist" into rvc-dev 2020-04-14 12:21:42 +00:00
Jooyung Han
84026389e7 apex: remove compat symlinks to vndk apex
For R+, symlinks from /system/lib to VNDK APEX are not necessary. (Note
that, symlinks to older VNDK are still necessary because older vendor
may access old locations.)

Hence, do not make symlinks for R+ VNDK APEX.

Bug: 142911355
Test: m # check /system/lib[64]/ for symlinks
        # cf should contain 28/29 symlinks but no symlinks for R
Change-Id: I852fad7edebed3e4edc03c374b3643da6b053fed
2020-04-14 14:22:31 +09:00
Jiyong Park
be024ad673 Don't allow a lib having stubs to become a member of VNDK
If a lib has stubs, that means the library provides stable C APIs and
the APIs are guaranteed to be maintained in a backwards compatible
manner. Then there is no reason to have the same library in VNDK,
because VNDK is for libraries (usually having C++ interfaces) where API
stability across the yearly releases is hard (or impossible) to be
guaranteed.

This change triggers an error when the build system finds a VNDK lib
which has stubs defined. Users are suggested to make the lib an LLNDK
one.

Exempt-From-Owner-Approval: cherry-pick from AOSP

Bug: 151303316
Test: m
Merged-In: Id305196a9d5a6fc7e7f9c02f3fa076859dc9a282
(cherry picked from commit ea97f51a29)
Change-Id: Id305196a9d5a6fc7e7f9c02f3fa076859dc9a282
2020-04-13 13:08:16 +09:00
TreeHugger Robot
a59774eb49 Merge "soong config: add value_variable substitution" into rvc-dev 2020-04-11 17:24:57 +00:00
TreeHugger Robot
a6ffd8b141 Merge "Make the names of 'soong_config_module_type_import' modules unique." into rvc-dev 2020-04-10 21:09:21 +00:00
Sasha Smundak
227d5675c5 Make the names of 'soong_config_module_type_import' modules unique.
blueprint.writeAllModuleActions attemts to sort modules by name, and
sorting them assumes that each module's name is unique. Although
soong_config_module_type_import modules will not generate anything,
their names should be unique, too for that reason.

Fixes: 150421585
Test: m nothing
Change-Id: I6782e42c129dc3b0fc7649ce97d5f94effc63fa7
Merged-In: I6782e42c129dc3b0fc7649ce97d5f94effc63fa7
2020-04-10 13:54:07 -07:00
Anton Hansson
846101ace0 Merge "Expand neverallow for sdk_version: none" into rvc-dev 2020-04-10 18:53:30 +00:00
Jaewoong Jung
1883126573 Merge "Add libs properties to runtime_resource_overlay." into rvc-dev 2020-04-10 17:41:19 +00:00
Jaewoong Jung
ca095d786a Add libs properties to runtime_resource_overlay.
Test: app_test.go
Test: Converted an existing RRO module.
Bug: 148788111
Change-Id: I723c7175760da019d38893e54f236c45f4c973ea
2020-04-10 07:05:07 -07:00
Anton Hansson
fec6c23734 Expand neverallow for sdk_version: none
Allow the platform stubs to specify sdk_version: none,
and add generic support for a regexp matcher.

Bug: 144149403
Test: m
Change-Id: Icaece0d9797bace8ae9741f7a029b9ea57fcbbb9
Merged-In: Icaece0d9797bace8ae9741f7a029b9ea57fcbbb9
2020-04-10 15:02:35 +01:00
Yi Kong
343eae73b7 Merge "Pass -Brepro ldflag to Windows builds" into rvc-dev 2020-04-10 06:01:03 +00:00
Yi Kong
dd7531160b Pass -Brepro ldflag to Windows builds
The default build-id is generated using timestamp. Pass -Brepro to
avoid using timestamp for deterministic build.

Bug: 153462962
Test: build fastboot.exe twice, got same shasum
Change-Id: I38fe993eec23c60bfcf1b76188774bfe06839fa4
Merged-In: I38fe993eec23c60bfcf1b76188774bfe06839fa4
(cherry picked from commit a3c22e7ee2)
Exempt-From-Owner-Approval: backport
2020-04-10 06:00:49 +00:00
Jooyung Han
c40b5193fe Skip version mutator for host/ramdisk/recovery
"version" mutator creates stubs variants for "cc" libraries with
"stubs.versions". These stubs are for APEX-APEX or APEX-Platform
boundaries.

For host/ramdisk/recovery variants, stubs are not necessary.

Bug: 153698496
Test: m
Change-Id: Id576c4318d9d69246a4a7e2fb4145d5fd2ab9416
2020-04-10 14:30:25 +09:00