Commit graph

20631 commits

Author SHA1 Message Date
Martin Stjernholm
3044394329 Merge "Add support for SDK tests with LinuxBionic OS type." 2020-07-17 11:46:12 +00:00
Jiyong Park
10e926bc8d apex_set is force disabled when necessary
prebuilt_apex has been disabled when the device is configured for
flattened APEXes, sanitized, instrumented, or built unbundled. However,
apex_set which is another type of APEX prebuilt wasn't disabled for the
same conditions.

This change fixes the discripency. apex_set modules are also force
disabled when the prebuilts are not expected.

Bug: 161316762
Bug: 160933444
Test: OVERRIDE_TARGET_FLATTEN_APEX=true m
The built image has only the flattened APEXes and the device boots

Change-Id: I6c90dfb28d565861a473a1bdce93269ec370601d
2020-07-17 12:37:16 +09:00
Colin Cross
988dfcc067 Add environment variables to control lint checks
Set ANDROID_LINT_CHECK to a comma-separated list of lint issues
that should be checked instead of the defaults.  This will disable
all lint checks and enable only the given list.

Set ANDROID_LINT_CHECK_EXTRA_MODULES to a list of modules that provide
lint checks that should added to all modules when ANDROID_LINT_CHECK
is specified.

Bug: 153485543
Test: m ANDROID_LINT_CHECK=JavaKotlinApiUsedByModule ANDROID_LINT_CHECK_EXTRA_MODULES=JavaKotlinApiFinder TARGET_BUILD_APPS=Gallery2 lint-check dist
Change-Id: Ifdf9bf972b8550104315b0f5e98b34ad699dcb67
2020-07-16 17:37:04 -07:00
Ramy Medhat
59b611d138 Merge "Generate RBE socket address randomly for each invocation of soong." 2020-07-16 23:42:06 +00:00
Treehugger Robot
e34e5b5442 Merge "Fix non-determinism in tests." 2020-07-16 23:17:14 +00:00
Colin Cross
70f0b53000 Merge changes from topic "lint-unbundled-apps"
* changes:
  Build a zip of transitive lint reports for apps
  Add DepSets
2020-07-16 23:06:22 +00:00
Dan Albert
4fea65086f Merge changes I2ac22f7c,I7fc9d55a
* changes:
  Get NDK python script tests running.
  Fix pylint issues in gen_stub_libs.
2020-07-16 23:06:12 +00:00
Treehugger Robot
bf81ed4fd1 Merge "Pass unstripped JNI libraries to Make" 2020-07-16 22:43:53 +00:00
Martin Stjernholm
7feceb2354 Add support for SDK tests with LinuxBionic OS type.
Break apart test helpers a bit to make it possible to enable
LinuxBionic in a single test, and add LinuxBionic support to
cc.GatherRequiredDepsForTest.

Test: m nothing
Bug: 160349757
Change-Id: Iace1024c964cee2308c130c945daef9e46c18c66
2020-07-16 21:55:15 +01:00
Dan Albert
38a224dc7e Fix non-determinism in tests.
The stdlib's xml apparently cares about ordering but also doesn't
preserve it. There are a number of different recommendations of other
ways to do this, but they all depend on packages we don't have
available (lxml or xml.dom.ext, in particular).

Test: pytest
Bug: None
Change-Id: I07108d8977c302404e7c90ca75a4bf7a1144750f
2020-07-16 13:23:33 -07:00
Dan Albert
06f58afd81 Get NDK python script tests running.
Imports weren't working in tests because the package had been created.
The Python "binaries" built by Soong don't seem to take their own
pkg_path into account, so I split the separate pieces of code here out
into their own packages.

Note that the ndk_api_coverage_parser tests do not actually pass
before or after this change (seems like it might be a
non-deterministic ordering issue in the attributes of the generated
output?), but they can at least be run now.

Test: pytest ndkstubgen
Test: pytest symbolfile
Test: pytest ndk_api_coverage_parser
Test: out/host/linux-x86/nativetest64/test_ndkstubgen/test_ndkstubgen
Test: out/host/linux-x86/nativetest64/test_symbolfile/test_symbolfile
Test: out/host/linux-x86/nativetest64/test_ndk_api_coverage_parser/test_ndk_api_coverage_parser
Bug: None
Change-Id: I2ac22f7ced7566e4808070f2f72fd04355846e0b
2020-07-16 13:23:29 -07:00
Dan Albert
802cc82af6 Fix pylint issues in gen_stub_libs.
Test: pylint scriptlib
Bug: None
Change-Id: I7fc9d55a033bab98c318cfb4db1af4eda7187af3
2020-07-16 13:21:43 -07:00
Colin Cross
824f11614e Add Validations to android.BuildParams
Pass Validations through to blueprint.

Test: m checkbuild
Change-Id: Ide9c7a6afe627277df09a9e594849a971916f044
2020-07-16 13:10:57 -07:00
Colin Cross
6e17ad5937 Use validations for blueprint tests
Pass -n to blueprint to make it use validation dependencies for tests,
which will let them run in parallel with soong_build.

Bug: 156428456
Test: m nothing
Change-Id: I706c14330543e2a7728e5dc385976900c67cb2f5
2020-07-16 13:07:06 -07:00
Colin Cross
c0efd1db13 Build a zip of transitive lint reports for apps
Add a rule to build a zip containing the lint reports from transitive
dependencies for apps, and pass it to Make.

Bug: 153485543
Test: m TARGET_BUILD_APPS=Gallery2 lint-check
Change-Id: I523c09016251377ff89d76084769be7401b95425
2020-07-16 12:51:42 -07:00
Colin Cross
9e44e21e91 Add DepSets
Add DepSets to efficiently support tracking transitive Paths without
copying, based on Bazel's depsets:
https://docs.bazel.build/versions/master/skylark/depsets.html

Test: depset_test.go
Change-Id: If744affdf1ed850113166ba611a79a891262040c
2020-07-16 12:50:11 -07:00
Ramy Medhat
ca1e44cb4b Generate RBE socket address randomly for each invocation of soong.
Test: started soong multiple times and saw different socket files in
out/soong/.temp

Change-Id: Ib0087dd3867bdbf584c6868196070840cff291aa
2020-07-16 12:18:37 -04:00
Jeff Vander Stoep
6e97a7b4a1 rust: Use host linker when building for Mac host.
This behavior is non-hermetic, but matches the behavior of the C++
support. On Linux, using lld works, but on OSX, this fails because lld
does not support Apple's new .tbd files.

Bug: 155302034
Test: On both Linux and Mac hosts:
    cd external/rust; mma

Change-Id: I0ad489113d720bdb9c3b7a67cce9d1e72266f428
2020-07-15 22:02:18 +02:00
Ivan Lozano
ec7f59c7df Merge "Fix incorrect Rust dylib extension on darwin." 2020-07-15 17:24:19 +00:00
Treehugger Robot
7e32313ef2 Merge "Do not consider disabled prebuilt variants." 2020-07-15 17:18:40 +00:00
Treehugger Robot
29e4029f5a Merge "Disable all SDK snapshot generation tests on mac." 2020-07-15 16:58:02 +00:00
Martin Stjernholm
3ff2e661bd Disable all SDK snapshot generation tests on mac.
We frequently miss putting in the per-test skip condition, and since
mac isn't tested in presubmit this leads to build breakages and time
consuming reverts. To avoid that this blanket disables all the SDK
tests on mac. It's not used there and we got test coverage in many
linux-based builds.

Bug: 145598135
Bug: 161315642
Test: `go test -v ./sdk` in build/soong on mac and linux
Change-Id: I2aea92fef2c0f8c2742396fe36610501dc5a6f0f
2020-07-15 16:58:05 +01:00
Ivan Lozano
33c05281a5 Fix incorrect Rust dylib extension on darwin.
rustc expects Rust dylibs to have a .dylib extension on darwin.

Bug: 155302034
Test: rust_library_host outputs have correct extension on darwin.
Change-Id: I17b0d7eaf0f42f8186185e3f14c3a8e992c74fde
2020-07-15 11:35:30 -04:00
Makoto Onuki
7bbcc22858 Merge "Proper API hierarchy between MODULE_LIBS and PRIV_APPS system APIs" 2020-07-15 15:26:06 +00:00
Martin Stjernholm
f467732447 Do not consider disabled prebuilt variants.
This relands https://r.android.com/1356826 without changes. It got
reverted as part of b/161315642 but is not related to that issue.

Test: m nothing
Test: `m` with prebuilt SDKs in the manifest
Bug: 151303681
Bug: 161315642
Change-Id: I7af892ae28a8208113e0801b1b8a8204edb61ec8
2020-07-15 14:27:13 +01:00
Jakub Pawlowski
75b1005f77 Merge "Revert "Do not consider disabled prebuilt variants."" 2020-07-15 10:33:41 +00:00
Jakub Pawlowski
ca7b2c3eb7 Merge "Revert "Add compile_multilib properties to all native prebuilts."" 2020-07-15 10:33:41 +00:00
Charles Chen
6ffbe57270 Revert "Do not consider disabled prebuilt variants."
This reverts commit 235e2fdbd3.

Reason for revert: <build break>

Bug: 161315642
Change-Id: Ie741252dc1d0749591f141c71c3d59ce45f0234f
2020-07-15 08:56:22 +00:00
Charles Chen
29936ae5a7 Revert "Add compile_multilib properties to all native prebuilts."
This reverts commit 1e9c2677fd.

Reason for revert: Break build

Bug: 161315642
Change-Id: Ibf3d5e88412327e8f08d08272b75cd3df34a71e5
2020-07-15 04:01:45 +00:00
Treehugger Robot
6da69732e4 Merge "Add compile_multilib properties to all native prebuilts." 2020-07-15 02:51:21 +00:00
Makoto Onuki
d92d515048 Proper API hierarchy between MODULE_LIBS and PRIV_APPS system APIs
Test: build / treehugger
Bug: 146727827
Exempt-From-Owner-Approval: Cherry-picking from goog/master to aosp/master
Merged-in: Ia6a1c3a795ceb168f0f478a50e5e2415d6a92ba4
Change-Id: Ia6a1c3a795ceb168f0f478a50e5e2415d6a92ba4
2020-07-15 01:34:32 +00:00
Dan Willemsen
695dc69ac4 Add support for macOS 11 SDK
Test: try building on the xcode 12 beta 2 macOS 11 SDK
Change-Id: Ic7e245ca418914798ba737106c6a345844e7a6ac
2020-07-14 16:53:43 -07:00
Treehugger Robot
3058878cc7 Merge "Use the build start time from Soong main UI for metrics build timestamp." 2020-07-14 21:04:48 +00:00
Liz Kammer
40be9bb8e1 Merge "Set sdk_version for prebuilt_api to scope" 2020-07-14 18:17:44 +00:00
Patrice Arruda
73c790f59e Use the build start time from Soong main UI for metrics build timestamp.
Currently, the build timestamp saved to the build_date_timestamp
field in the MetricsBase metrics protobuf usually comes from a text
file named build_date.txt. It may not be accurate for metrics purposes.
Instead, use the build start time from Soong main UI for a better
timestamp.

Bug: b/140638454
Test: Ran and checked the build_date_timestamp by running the printproto
      command.
Change-Id: I4d893fbbf9830ba21911e56ae13bc5272be47ae6
2020-07-14 17:23:23 +00:00
Treehugger Robot
75fd488028 Merge "Use monotonic clock instead of wall time clock for metrics." 2020-07-13 23:48:42 +00:00
Liz Kammer
f971af7997 Set sdk_version for prebuilt_api to scope
Remove old TODO setting sdk_version to "current" as the associated bug
appears to have been fixed.

Test: m checkapi
Change-Id: I7737fbd17d2f54fc4578e04d07875b4b8d408ef9
2020-07-13 15:41:20 -07:00
Colin Cross
562b6ee5cf Merge "Support lint on unbundled builds" 2020-07-13 21:33:09 +00:00
Patrice Arruda
958b89c0b5 Use monotonic clock instead of wall time clock for metrics.
From several dashboards, there are high spikes from several
builds where the real time of executing a part of the build
system took many many hours. This is due to using the wall
time clock when calculating the duration. For metrics, the
monotonic clock should be used for more accurate measurement.
Also, cleaned up the time.go file to use the proper proto
functions when marshalling perf protobuf and deleted
unnecessary functions.

Bug: b/143492984
Test: Wrote and ran unit test case.
Change-Id: I1540cfbf37915e3045ecedaa2595c1f9429bcd62
2020-07-13 21:14:34 +00:00
Treehugger Robot
aeaffeb710 Merge "Add array type property flags, equivalent to args" 2020-07-13 20:52:20 +00:00
Liz Kammer
585cac22d9 Add array type property flags, equivalent to args
The property args is currently a string, but represents a collection of
arguments to metalava/doclava. This has resulted in variables being used
rather than default modules to share arguments.

Test: go test java_tests
Bug: 145644363
Change-Id: I670235e8f1cf19bfe8909049c4765637d0accd47
2020-07-13 08:57:49 -07:00
Treehugger Robot
775c8e1af7 Merge "Do not consider disabled prebuilt variants." 2020-07-13 13:59:30 +00:00
Treehugger Robot
20efa41af8 Merge "Set LOCAL_APKCERTS_FILE for apk_set modules in apexes" 2020-07-13 11:39:43 +00:00
Colin Cross
b7cea24fe3 Merge "Use unzip -DD" 2020-07-13 05:58:42 +00:00
Treehugger Robot
9d98ac15bb Merge "Fix string concatenation error" 2020-07-12 23:08:40 +00:00
Colin Cross
d783bbbace Use unzip -DD
We put reproducible timestamps in zip files so that the artifacts
are consistent, but that leads to old timestamps in the output
directory if they are unzipped as part of the build.  Use
unzip -DD when unzipping to update the timestamps.

Bug: 161015009
Test: touch -d 2020-01-01 ref; find $OUT/system -not -newer ref
Change-Id: I70407a627cb070e24be510faa6a774e3d9eae3a8
2020-07-12 05:37:46 +00:00
Inseob Kim
41405cc275 Merge "Nullify stl and sanitize of llndk_headers" 2020-07-11 05:19:17 +00:00
Colin Cross
4fb652d681 Set LOCAL_APKCERTS_FILE for apk_set modules in apexes
I321e80fd636a955213761f56a3ac64bfe7f7f7c0 missed setting
LOCAL_APKCERTS_FILE for apk_set modules in apexes, which causes
invalid apkcerts.txt files.

Bug: 160652723
Test: m apkcerts-list
Change-Id: I1ccaafd04978374d0da10363a1d782cfeae428e7
Merged-In: I1ccaafd04978374d0da10363a1d782cfeae428e7
(cherry picked from commit 7e2b36c7d5)
2020-07-10 20:38:50 -07:00
Colin Cross
8a6ed3750d Support lint on unbundled builds
Use prebuilts of the annotations.zip and api-versions.xml files
when running lint in an unbundled build.

Test: m TARGET_BUILD_APPS=Gallery2 lint-check
Change-Id: Idacf3758a2769678a635941486183673e95b43f8
2020-07-10 19:30:32 -07:00
Martin Stjernholm
1e9c2677fd Add compile_multilib properties to all native prebuilts.
There was a special case in cc_prebuilt_binary only, which resulted in
prebuilt libraries getting both 32 and 64 bit variants even when their
sources only had one of them, and the other variant would be defunct
since it wouldn't get any prebuilt artefact.

This moves the handling of compile_multilib completely to the common
update code, so that SDK members don't need to deal with it. It doesn't
take SDK member defaults into account, which means a bit more
boilerplate in the snapshots, but it's simpler and less error prone
(different SDK member types have different defaults).

Bug: 151303681
Test: m nothing
Test: build/soong/scripts/build-aml-prebuilts.sh art-module-host-exports
  Check that the generated Android.bp passes Soong.
Change-Id: Ib73444c6788ee1c78480bdb103aa2b8ae8f2c63c
2020-07-11 00:38:24 +01:00