Commit graph

32120 commits

Author SHA1 Message Date
Jiyong Park
f7c3bbe433 Prebuilt stub not available to platform is handled correctly
When a shared library providing stubs is included in an APEX, only the
stub variant (i.e. version:"1", etc.) gets emitted to Android.mk. This
enforces that everything in the Make world to link to the stub providing
only the public APIs of the library. The non-stub variant (i.e.
version:"") isn't exposed, otherwise, others will be able to access
private part of the lib which isn't guaranteed to be stable.

This has been done by unhiding the stub variant when it is known that
the library is actually included in an APEX. Note that stub variants are
by default hidden.

The above mechanism however doesn't work when the shared library is
replaced by a prebuilt and when the APEX is also replaced by a prebuilt.
Then, the fact that the prebuilt library is actually in the APEX gets
lost.  In that case, AnyVariantDirectlyInAnyApex() returns false for the
prebuilt library. As a result, the stub variant remains hidden and not
emitted to Android.mk.

This change fixes the problem by checking if the lib isn't available for
the platform at all. If not available for the platform (e.g.
apex_available doesn't have "//apex_available:platform"), the lib is
assumed to be included in an APEX even when it actually didn't go
through the apex mutator (... because it's a prebuilt).

Bug: 175166063
Test: m nothing

Change-Id: I41fabd5b368baecf4dc3c5a080b466f8bcd79d77
2020-12-15 09:17:36 +09:00
Treehugger Robot
9ae3c52b20 Merge "Add dependency to list of asset files" 2020-12-12 01:48:52 +00:00
Treehugger Robot
f876a3866a Merge "Move keymint to android.hardware.security." 2020-12-12 00:14:21 +00:00
Sophie Zheng
e3a2bdf2c8 Merge "Automate NDK API coverage used by Mainline modules build integration" 2020-12-11 22:19:00 +00:00
Shawn Willden
7831d3eb42 Move keymint to android.hardware.security.
Bug: 175345910
Bug: 171429297
Test: Build
Change-Id: I219fd6c976cf6b624dcf0ae234f66e27ff251cd0
2020-12-11 20:37:03 +00:00
Colin Cross
c20dc8533e Add dependency to list of asset files
We had a dependency on each file in the asset directories, but that
wouldn't cause aapt2 to run if a file was removed.  Add a dependency
on a file that contains the list of files in the asset directories.

Fixes: 172867096
Test: m CarrierConfig && rm packages/apps/CarrierConfig/assets/carrier_config_no_sim.xml && m CarrierConfig
Change-Id: I35f3b85355fa890a3e95eaa6458a21466b6930e4
2020-12-11 19:54:16 +00:00
Ivan Lozano
30530a9e34 Merge "Rust: WriteFileRule instead of printf for protos" 2020-12-11 19:14:29 +00:00
Pirama Arumuga Nainar
d36c83862f Merge "[coverage] Wrap calls to open" 2020-12-11 17:42:09 +00:00
Treehugger Robot
f4b00aed6e Merge "Add PackageFile and use it for prebuilt build tools" 2020-12-11 15:42:50 +00:00
Ivan Lozano
90f5c1d5d6 Merge "Rust: Vendor support for Rust static libraries." 2020-12-11 13:44:31 +00:00
Ivan Lozano
f48c89cd39 Merge "Refactor for preliminary Rust vendor image support" 2020-12-11 13:40:20 +00:00
Paul Duffin
08703826bd Merge "Rename apexDepsMutator to apexInfoMutator" 2020-12-11 10:06:19 +00:00
Paul Duffin
4d934af2ee Merge "Extract testDexpreoptWithApexes() for reuse" 2020-12-11 10:06:07 +00:00
Jiyong Park
6f05a73e3e Merge "stub variants also re-exports headers" 2020-12-11 08:50:12 +00:00
Treehugger Robot
8574ae773f Merge "Allow Bazel to write to an external DIST_DIR (outside of OUT_DIR)." 2020-12-11 05:16:32 +00:00
Jiyong Park
1ad8e16fbe stub variants also re-exports headers
This change fixes a bug that headers are not re-exported from stub
variants of a library, if the headers are not from header libs, but from
shared or static libs. This is because only header lib dependencies
are respected for stubs variants.

The fix is as follows. 1) dependencies to the shared/static libs are
added even for stubs variants. 2) instead, in depsToPaths, they are
treated like header libs (i.e. don't contribute to linkFile) for the
stubs variants.

Bug: 174558745
Test: m

Change-Id: Iab6c77e7817055d0f2d09cb114186b30164fc231
2020-12-11 13:48:28 +09:00
Treehugger Robot
5571f61bc1 Merge changes I394a1b62,I6906be4c
* changes:
  Add bazel metrics directory to the list of metrics files to be uploaded.
  Allow uploading a directory of metrics files.
2020-12-11 02:15:37 +00:00
Rupert Shuttleworth
3c9f5ac787 Allow Bazel to write to an external DIST_DIR (outside of OUT_DIR).
Also get Bazel to write real files there (not symlinks) so that the DIST_DIR can be independent.

Test: Manually using e.g. DIST_DIR=/tmp/foo USE_BAZEL=1 m dist
Change-Id: I39d5219500864c9ecc85f356a028e9b5bf2607f4
2020-12-11 01:17:58 +00:00
Treehugger Robot
b0ed5768d3 Merge "Add some comments for VNDK / vendor snapshots" 2020-12-11 00:56:47 +00:00
sophiez
55e8815fb8 Automate NDK API coverage used by Mainline modules build integration
Dist txt files containing NDK APIs used by Mainline modules

Test: TARGET_BUILD_APPS=com.google.android.adbd m dist apps_only

Change-Id: I035f1e0cc7eb43fc09e796dbc6ce77e65b8aa3b4
2020-12-11 00:45:20 +00:00
Colin Cross
4158950c40 Add PackageFile and use it for prebuilt build tools
Add PackageFile that creates a PackageSpec like InstallFile,
but doesn't create the install rule.  Also improve the documentation
on InstallFile and friends, and on HostToolProvider.

Bug: 124313442
Test: m checkbuild
Change-Id: I30f44a2b3833e48d0bb71bf7c45955f88fb00bc8
2020-12-10 16:39:28 -08:00
Jiyong Park
b555609098 Merge "rust ffi libraries can be included in APEX" 2020-12-10 23:54:34 +00:00
Jiyong Park
0d399b5915 Merge "Add min_sdk_version to Rust modules." 2020-12-10 23:54:34 +00:00
Colin Cross
d3b30670f2 Merge changes I1d6750db,Ie2c197bb,I6a51c89a
* changes:
  Add TransitivePackagingSpecs
  Add executable flag to sbox copy requests
  Export files to install as a depset
2020-12-10 21:53:49 +00:00
Patrice Arruda
405640203e Add bazel metrics directory to the list of metrics files to be uploaded.
The contents of the bazel metrics directory (out/bazel_metrics or
<dist dir>/logs/bazel_metrics if dist arg is specified) is added
in the list of files to be uploaded in order to do performance
analysis of bazel builds.

Bug: b/174479728
Test: * m nothing and checked metrics_uploader log file to ensure
        if the metrics is uploaded.
      * USE_BAZEL=1 m nothing and checked if the set of metrics
        files plus the build_bazel_profile.gz is uploaded through
	the metrics_uploader log file.
Change-Id: I394a1b621a06f9acccf154faee6dcd4200fcff4c
2020-12-10 21:48:20 +00:00
Patrice Arruda
7d235cc24d Allow uploading a directory of metrics files.
The upload functionality now supports directories to be uploaded
for metrics purpose.

Bug: b/174479728
Test: Wrote unit test case.

Change-Id: I6906be4c1b7fd76ddf6ff7b94e48fe1c4209c59d
2020-12-10 21:48:05 +00:00
Pirama Arumuga Nainar
9464b6cc6c [coverage] Wrap calls to open
Bug: http://b/173448692

The coverage runtime creates files with uga+rw permissions but an
earlier umask call can restrict these and cause problems with profile
merging ('%Nm' in LLVM_PROFILE_FILE).  This change passes `--wrap,open`
to coverage builds.  The other change in this topic adds the wrapper
function to set the permissions again using `fchmod` (only for files
opened under /data/misc/trace).

Test: Manually validate permissions of files under /data/misc/trace.
Test: libprofile-clang-extras-test
Change-Id: I881474ab184d03d14c5637951aac027a363739b6
2020-12-10 21:45:34 +00:00
Ivan Lozano
9d74a52706 Rust: WriteFileRule instead of printf for protos
Use WriteFileRule instead of a rule that calls printf for generating the
module source file for rust_protobuf.

Bug: 171361369
Test: rust_protobuf modules compile
Change-Id: Ie83a30e19d7d09875f3d209662526783862d8ea0
2020-12-10 15:35:05 -05:00
Paul Duffin
949abc03eb Rename apexDepsMutator to apexInfoMutator
Generally ...DepsMutator methods add dependencies between modules but
the apexDepsMutator does not which can be confusing. This renames
apexDepsMutator to apexInfoMutator and adds some extra documentation to
clarify its function. It also renames the registered name for the
mutator and its associated providers from apex_deps to apex_info.

Test: m nothing
Bug: 171061220
Change-Id: Ic074a281215b23e982448ccff7ac075236123bee
2020-12-10 20:16:57 +00:00
Paul Duffin
c3bbb96667 Extract testDexpreoptWithApexes() for reuse
Extracts testDexpreoptWithApexes() from testDexpreoptWithApexes() to
reuse in other tests.

Test: m nothing
Bug: 171061220
Change-Id: Iee62b68d72133b4cc066e2875bd27d7051206cbc
2020-12-10 20:16:57 +00:00
Steven Moreland
35989ae98b Merge "target.apex.exclude_[shared|static]_libs to cc_* modules" 2020-12-10 19:02:02 +00:00
Ivan Lozano
6a88443089 Rust: Vendor support for Rust static libraries.
We don't have Rust VNDK support yet, but static linkage can be
supported in the interim. This adds support for making rust_ffi_static
libraries available to CC vendor modules.

Since rust_ffi_static modules will link against rlibs, we allow rlib
linkage into vendor as well, but only for the variants which use the
rlib libstd.

Bug: 172525289
Test: New Soong tests pass
Test: Example vendor cc_binary links against rust_ffi_static module.
Change-Id: Idf3aeb51e32293866f1ad965e329aa6b9e0bf2ef
2020-12-10 10:29:54 -05:00
Ivan Lozano
f9e2172aec Refactor for preliminary Rust vendor image support
Refactors parts of CC to prepare for preliminary support for using Rust
static libraries in vendor images. Some previously private functions are
made public, and additional functions are added to LinkableInterface so
GetMakeLinkType can be passed a LinkableInterface.

Bug: 172525289
Test: m
Change-Id: I5fda48e79532fe9ceab255e18d910af58048a123
2020-12-10 10:29:48 -05:00
Treehugger Robot
a4fd2ea7b2 Merge "Add neuralnetworks_utils_hal_service to apex/allowed_deps.txt" 2020-12-10 12:21:57 +00:00
Inseob Kim
de5744a199 Add some comments for VNDK / vendor snapshots
Also some files are refactored:

- snapshot_prebuilt.go is separated from vendor_snapshot.go. Now
vendor_snapshot.go contains snapshot generation codes, while
snapshot_prebuilt.go contains module definition codes.

- Some helper functions are moved from snapshot_utils.go to util.go.

- Some ambiguous names of types and functions are renamed.

We still can add more detailed comments about the snapshots. They are to
be uploaded in follow-up changes, to avoid making this change too big.

Bug: 173474311
Test: generate vndk and vendor snapshot
Change-Id: I18fa837ccdf44a042b7a78e5c3df25fd2de96d95
2020-12-10 21:12:39 +09:00
Martin Stjernholm
62bd802826 Merge "Propagate the Soong config variable for enabling ART Module building." 2020-12-10 09:32:19 +00:00
Treehugger Robot
cac133df14 Merge "Remove AndroidMkExtraFootersFunc entries param." 2020-12-10 07:04:02 +00:00
Xin Li
13850821b2 Merge "DO NOT MERGE - Merge Android R QPR1" 2020-12-10 02:18:29 +00:00
Christopher Parsons
0529cd2d59 Merge "Improve comments in cc/library.go and cc/linkable.go." 2020-12-10 02:17:58 +00:00
Xin Li
bfb1c5939a DO NOT MERGE - Merge Android R QPR1
Bug: 172690556
Merged-In: I16d3f4210df3d1e2d59a5785422ad732546935e4
Change-Id: I50bf9940fe5e1c9c7dac4f3c50e417e39e03ef30
2020-12-09 17:44:01 -08:00
Treehugger Robot
896cb8d6c6 Merge "Add missing export/unexport directives" am: 67e72529c4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1513335

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I16d3f4210df3d1e2d59a5785422ad732546935e4
2020-12-10 00:49:35 +00:00
Treehugger Robot
67e72529c4 Merge "Add missing export/unexport directives" 2020-12-10 00:36:09 +00:00
Jiyong Park
2b33ad60aa Merge "test_for is available for all cc_* module types" am: 2920d2cec0
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1517638

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I38d61acc50786ee97ee85e7cf89d9664dd91a148
2020-12-10 00:33:40 +00:00
Jiyong Park
2920d2cec0 Merge "test_for is available for all cc_* module types" 2020-12-10 00:16:29 +00:00
Ivan Lozano
eb114e6509 Merge "Move prefer_rlib from binary to base compiler." am: 366cb49b9f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1518620

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ic82eb1788b20c35995e138d2fea2c1b38b9a3e7e
2020-12-09 23:32:37 +00:00
Ivan Lozano
366cb49b9f Merge "Move prefer_rlib from binary to base compiler." 2020-12-09 23:02:53 +00:00
Treehugger Robot
8f474b0c34 Merge "Provide an interface for shared paths between Soong and Soong UI." am: 5839c91074
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1519964

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I32a6834820cf31b84eb8054d9b6fd3f92ab1ef38
2020-12-09 17:33:34 +00:00
Treehugger Robot
5839c91074 Merge "Provide an interface for shared paths between Soong and Soong UI." 2020-12-09 17:31:02 +00:00
Treehugger Robot
69ac81038a Merge "Soong: remove output file before running signapk" am: 413c3bea63
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1511908

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Iffe70681136af6d8ad427823b1583aa44246a87c
2020-12-09 17:24:52 +00:00
Treehugger Robot
413c3bea63 Merge "Soong: remove output file before running signapk" 2020-12-09 16:58:02 +00:00