Commit graph

20438 commits

Author SHA1 Message Date
Ivan Lozano
1a1d28888c Merge "Make rust_test file output more similar to cc_test." 2020-06-12 16:12:28 +00:00
Ulya Trafimovich
6e82748bd6 Rename dexpreopt.config field to bring it in sync with Make.
Different names of the same field in Make and in Soong resulted in
the field being dropped when unmarshalling the JSON from Make to Soong.
As a result, the list of optional used libraries for Make modules was
always empty.

Test: lunch aosp_cf_x86_phone-userdebug && m
Test: Cherry-pick in internal master and observe that the logcat error
    "ClassLoaderContext shared library size mismatch" for GoogleDialer
    has disappeared:
    terminal-1 $ lunch cf_x86_phone-userdebug && m && launch_cvd
    terminal-2 $ adb wait-for-device && adb root \
        && adb logcat | grep 'size mismatch'
    (nothing after the change, one error message before the change)

Bug: 132357300
Change-Id: I57820646fa7c1d8af01b2cbc8a3521da450719c0
2020-06-12 14:47:50 +01:00
Jaewoong Jung
fe25dc9f3b Merge "Revert "Add module name to sh_test install path."" 2020-06-12 04:08:28 +00:00
Treehugger Robot
6db2306c57 Merge "Use inclusive language in build/soong" 2020-06-12 03:19:02 +00:00
Jaewoong Jung
3d14ab7b2b Merge "Make override modules compatible with prebuilts." 2020-06-12 01:15:45 +00:00
Stephen Crane
b7fd37cb08 Fix module name when autogenerating test config
c5b8749853 broke specifying a name via the
`autogenTemplateWithName` function by hard-coding
`ctx.ModuleName()`. This restores that functionality.

Bug: 158784626
Test: atest rustBinderTest_integration
Change-Id: I05674e85defb363aa3cdf3e2dd895d1174e6b48f
2020-06-11 23:22:09 +00:00
Chris Gross
190fdc0b1a Use EMMA_INSTRUMENT_FRAMEWORK for apex framework libs.
Static coverage builds that trigger a dexpreopt target for a bootclasspath
jar can fail since coverage for jars in apexes are turned on by default
which requires jacocoagent to be present on the bootclasspath.

Fix this by using EMMA_INSTRUMENT_FRAMEWORK to conditionally instrument
framework libs in apexes.

Bug: 157737183
Test: EMMA_INSTRUMENT=true EMMA_INSTRUMENT_STATIC=true m -j droid
Change-Id: I2c323553e08741bc46b196bc3bb860614bc3f85b
2020-06-11 23:21:47 +00:00
Jaewoong Jung
fb25a64fdd Make override modules compatible with prebuilts.
Prebuilt's prefer flag doesn't work against override modules because
override modules are sort of virtual modules that delegate all the work
to their base modules. Therefore, even if a prebuilt module suppresses
installation of its src-counterpart override module, the actual build
actions are still performed in the base module.

This change fixes it by filtering out override modules that are being
replaced by prebuilts.

Test: prebuilt_test.go
Bug: 152155285
Change-Id: I859b35c0629b2b6258dd1ec5e020ba2c77ff9612
2020-06-11 16:01:30 -07:00
Colin Cross
440e0d0542 Use inclusive language in build/soong
Test: m checkbuild
Change-Id: Id07890b7cbc2397291a658ca00e86b43c743aafc
2020-06-11 15:33:16 -07:00
Michael Butler
0c55445b72 Revert "Add module name to sh_test install path."
This reverts commit 2d4f1a2f7e.

Reason for revert: Droidcop: Potential culprit for Bug 158778263 - verifying through Forrest before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted.

Bug: 158778263
Change-Id: I5287b3c9331b08925dd22b32c84e4c3b6f71b58a
2020-06-11 21:17:30 +00:00
Ivan Lozano
fc80fe7f2f Make rust_test file output more similar to cc_test.
This changes the way the output filename is calculated for rust_test
binaries to be more similar to cc_test.

This also removes the option to define multiple test binaries in a
single rust_test module via the TestPerSrc mutator. Now each rust_test
module corresponds to a single test binary.

Bug: 158500462
Test: m -j pin-utils_tests_pin_utils
Test: m -j unicode-xid_device_tests_unicode_xid
Change-Id: I6e0f79dcb4e49fa49d6ebb36abeef67a9eb180a0
2020-06-11 17:12:19 -04:00
Colin Cross
1adc63ec3d Merge changes from topics "dist-for-goals", "soong-dist", "tests-PathForSource"
* changes:
  Add DistForGoal to MakeVarsContext
  Define Soong phony rules in Make
  Remove paths from cc.TestConfig
  Remove most paths from java.TestConfig
  Allow tests to bypass PathForSource existence checks
2020-06-11 18:36:18 +00:00
Treehugger Robot
feccfbc5be Merge "Include runtime-module-host-exports in the SDK build." 2020-06-11 18:33:10 +00:00
Sophie Zheng
582bebf051 Merge "NDK Api Coverage" 2020-06-11 18:21:39 +00:00
sophiez
58cabb7af6 NDK Api Coverage
Enable ndk_library processing for api code coverage. All parsed generated xml files will be dist and later upload to artifacts.

Test: m ndk

Change-Id: I76ac52f60d5bbb106308658cf7417b845af9a49e
2020-06-11 18:18:40 +00:00
Sophie Zheng
52481b445b Merge "Add ndk api parser for ndk api coverage." 2020-06-11 17:21:05 +00:00
Ivan Lozano
f3717eec6c Match Rust gcda output to cc via -Z profile-emit.
Use the -Z profile-emit flag to ensure that rust gcda files have
/proc/self/cwd/ appended to them similar to cc modules. This makes sure
our gcda output is consistent no matter what language the binary is
written in.

Bug: 156482307
Test: gcda outputs to the new path.

Change-Id: Ife4d55f885c7e33dffa66f7436bc2bf8b5916586
2020-06-11 17:16:27 +00:00
Jaewoong Jung
9e90e61ffd Merge "Add module name to sh_test install path." 2020-06-11 16:45:56 +00:00
Thiébaud Weksteen
a2e3a6312b Merge "Add rust-project.json generator" 2020-06-11 16:01:07 +00:00
Martin Stjernholm
68b0c7a6e5 Include runtime-module-host-exports in the SDK build.
Test: build/soong/scripts/build-mainline-modules.sh
Bug: 152255951
Change-Id: I87a154a31409c83ccdd4637210f6163dfa2d7738
2020-06-11 15:48:13 +01:00
Ulyana Trafimovich
69bd288409 Merge "Fix on-device paths to used libraries in dexpreopt." 2020-06-11 13:47:19 +00:00
Ulyana Trafimovich
5cdb051ce3 Merge "Remove host boot image from boot.zip." 2020-06-11 10:04:58 +00:00
Martin Stjernholm
fa096325fe Merge changes from topics "target-build-unbundled", "unbundled-preopt"
* changes:
  Don't disable dexpreopting implicitly in unbundled builds.
  Add TARGET_BUILD_UNBUNDLED as a variable to control builds.
2020-06-11 10:01:59 +00:00
Thiébaud Weksteen
e4d12a0468 Add rust-project.json generator
Because we are not relying on Cargo.toml for our crate dependencies,
we need to provide a structured file to rust-analyzer which describes
the locations of the crates. Add a generator for that purpose, similarly
to cc/compdb and cc/ccdeps.

Bug: 156395307
Test: SOONG_GEN_RUST_PROJECT=1 m nothing && \
      cat ${ANDROID_BUILD_TOP}/out/soong/rust-project.json
Change-Id: I46efe0adeddae281eaf86707504c3aa15b5e80b8
2020-06-11 11:22:31 +02:00
Treehugger Robot
9f42bb8822 Merge "Update LLVM toolchain to r383902b." 2020-06-11 08:44:18 +00:00
Treehugger Robot
f2d19b5f34 Merge "Fix using generated test configs for sh_test, python_test and rust_test modules" 2020-06-11 08:11:16 +00:00
Inseob Kim
65ca36a72e Exclude kernel_headers from vendor snapshot
Vendor snapshot is supposed to have AOSP-defined modules which are
installed to vendor. kernel_headers are excluded from snapshot because
they always depend on vendor, regardless of locations they are defined.

Bug: 157106227
Test: m vendor-snapshot
Change-Id: If47634678797973266fcf502739216daf28ad790
2020-06-11 14:50:14 +09:00
Inseob Kim
f3044b64d7 Always create both variants for kernel headers
kernel_headers exports header files from TARGET_DEVICE_KERNEL_HEADERS,
TARGET_BOARD_KERNEL_HEADERS, and TARGET_PRODUCT_KERNEL_HEADERS. All of
them are bound to vendor, so they will always have both variants.

Bug: 157106227
Test: manual
Change-Id: I903b7ddbee21f63174dbba47bc6c093b90d1b42d
2020-06-11 14:49:48 +09:00
Colin Cross
a6384821f9 Fix using generated test configs for sh_test, python_test and rust_test modules
Annotate the test config properties with android:"path", and always
use LOCAL_FULL_TEST_CONFIG to pass the path to Make.

Bug: 157621988
Test: manual
Change-Id: I1c020e642f83d994d63c9e9cb56e686086d5acaa
2020-06-10 22:48:16 -07:00
Treehugger Robot
7d95aac066 Merge "Add exclude_shared_libs, expand exclude_static_libs to cover static_libs" 2020-06-11 02:38:31 +00:00
Treehugger Robot
36aef533cc Merge "Fix type assertion error regarding dex_import" 2020-06-11 00:45:46 +00:00
Jaewoong Jung
2d4f1a2f7e Add module name to sh_test install path.
Bug: 156980228
Test: m ziptool-tests
Test: sh_binary_test.go
Change-Id: Ibb1d774709ea421e18d5350009c203f83c5b2d60
2020-06-10 17:23:46 -07:00
Colin Cross
062103115c Add exclude_shared_libs, expand exclude_static_libs to cover static_libs
Allow variants to exclude shared or static libs.

Bug: 153609531
Test: manual
Change-Id: I6ac9c445ed233c774a051743ed6760058c9918e9
2020-06-10 15:47:34 -07:00
Stephen Hines
b31d77e57c Update LLVM toolchain to r383902b.
Bug: http://b/149417653
Test: m
Change-Id: I0e191b463852da8b5eb5a4e092ef9b5da255df3d
2020-06-10 15:39:31 -07:00
Martin Stjernholm
d297b77e84 Merge "Fix duplicate install targets from sdk variants in --skip-make mode." 2020-06-10 18:25:44 +00:00
Elliott Hughes
a82ad479a4 Merge "Remove TARGET_PREFER_32_BIT support." 2020-06-10 18:07:06 +00:00
Jiyong Park
9e83f0b531 Fix type assertion error regarding dex_import
Ida6f7bb784efe74cc1fa0e8d370eaee803f08b0f made it possible to add
dex_import modules into apex, but that change had a bug. When creating
Android.mk for the dex_import module, the code executed an unchecked
type assertion to convert java.DexImport to java.Dependency, which
cannot be successful. This change fixes the bug by doing a checked type
assertion instead.

Bug: 157886942
Test: m (test added)
Change-Id: Id22c20d42effce539fab10b0d349bf340d467f02
2020-06-11 00:35:03 +09:00
Ulya Trafimovich
9ab4933a1c Remove host boot image from boot.zip.
Host boot image is not needed in boot.zip, which is used for the ART
APK scanner and runs on target. This commit also changes the paths in
the boot.zip by removing OS subdirectory.

Test: lunch aosp_cf_x86_phone-userdebug && m
Test: m out/soong/vsoc_x86/dex_bootjars/boot.zip \
    && zipinfo -1 out/soong/vsoc_x86/dex_bootjars/boot.zip
    system/framework/x86/boot-framework.art
    system/framework/x86/boot-framework.oat
    system/framework/x86/boot-ext.art
    system/framework/x86/boot-ext.oat
    system/framework/x86/boot-core-icu4j.art
    system/framework/x86/boot-core-icu4j.oat
    system/framework/x86/boot-telephony-common.art
    system/framework/x86/boot-telephony-common.oat
    system/framework/x86/boot-voip-common.art
    system/framework/x86/boot-voip-common.oat
    system/framework/x86/boot-ims-common.art
    system/framework/x86/boot-ims-common.oat
    system/framework/x86/boot-framework-atb-backward-compatibility.art
    system/framework/x86/boot-framework-atb-backward-compatibility.oat
    system/framework/x86/boot-framework.vdex
    system/framework/x86/boot-ext.vdex
    system/framework/x86/boot-core-icu4j.vdex
    system/framework/x86/boot-telephony-common.vdex
    system/framework/x86/boot-voip-common.vdex
    system/framework/x86/boot-ims-common.vdex
    system/framework/x86/boot-framework-atb-backward-compatibility.vdex

Change-Id: Idf0541908059c454348181d90b0b3e5d6d350057
2020-06-10 15:54:23 +01:00
Ulya Trafimovich
9f3052cd78 Fix on-device paths to used libraries in dexpreopt.
Test: lunch aosp_cf_x86_phone-userdebug && m
Test: Cherry-pick in internal master and check that on-device path to
    com.google.android.dialer.support.jar now is on /product partition
    (as it should be) and not on /system:
    $ oatdump \
        --instruction-set=x86 \
        --oat-file=out/target/product/vsoc_x86/product/priv-app/GoogleDialer/oat/x86/GoogleDialer.odex \
      | grep '^classpath' \
      | grep -o '[^[]*com.google.android.dialer.support.jar'
    /product/framework/com.google.android.dialer.support.jar

Bug: 132357300
Change-Id: Idf279ac713b9b29ff3a29f1b072bc1d57f48db26
2020-06-10 14:53:36 +01:00
Roland Levillain
4f5297b438 Rename native code coverage paths product variables in Soong.
Rename `CoveragePath` and `CoverageExcludePaths` as
`NativeCoveragePath` and `NativeCoverageExcludePaths` (resp.).
Also rename function `android.CoverageEnabledForPath` as
`android.NativeCoverageEnabledForPath`.

Test: m nothing
Bug: 158212027
Change-Id: Id2c11a638e88088096420b537effa866d7667304
2020-06-10 13:00:07 +01:00
Jiyong Park
d4873a6b68 Merge "dex_import that isn't available for platform isn't installed" 2020-06-09 23:02:10 +00:00
Colin Cross
3cda0d8df9 Add DistForGoal to MakeVarsContext
Add methods to MakeVarsContext to allow Singletons to dist
artifacts without manually adding $(dist-for-goals) in Make.

Test: m checkbuild
Change-Id: Ia5ddb31afe29329f2df0ae1297ed963c8c28e590
2020-06-09 14:38:51 -07:00
Colin Cross
c3d87d3112 Define Soong phony rules in Make
To support dist-for-goals in Soong, we need to define all phony rules
in Make so that dist-for-goals can insert additional dependencies on
them.  Collect all the phony rules in phonySingleton and write them
out as Make rules when Soong is embedded in Make, or as blueprint.Phony
rules when Soong is run standalone.

Test: m checkbuild
Change-Id: I68201eff30744b0f487fc4f11f033767b53a627d
2020-06-09 14:38:50 -07:00
Colin Cross
2fce23ae6d Remove paths from cc.TestConfig
Now that tests don't need to specify every path passed to
PathForSource or PathForModuleSrc, remove them from cc.TestConfig.

Test: all soong tests
Change-Id: I90cd7b4dfc49c156afbb0eea9a77159c3e1860fa
2020-06-09 14:38:47 -07:00
Colin Cross
238c1f3903 Remove most paths from java.TestConfig
Now that tests don't need to specify every path passed to
PathForSource or PathForModuleSrc, remove most of them from
java.TestConfig.  Leave a few that are globbed by lots of tests,
and move a few that are globbed by a single test into the tests.

Test: all soong tests
Change-Id: Ica91d7203a6a7dbca0fd4fed84c78f149b8699e1
2020-06-09 14:38:39 -07:00
sophiez
b858c6d497 Add ndk api parser for ndk api coverage.
Test: m test_ndk_api_coverage_parser

Change-Id: I7be4f505757b1ca915de5e378952f8b104e1d362
2020-06-09 14:33:20 -07:00
Colin Cross
5e6a797982 Allow tests to bypass PathForSource existence checks
Forcing every test to specify every file it wants to pass to
PathForSource or PathForModuleSrc is painful to maintain and
doesn't add any value.  Allow tests to reference paths through
PathForSource and PathForModuleSrc without specifying them in
the mock FS.

Test: all soong tests
Change-Id: Ia8a8fd965a338d0645b3721314bf91f50146ad21
2020-06-09 14:23:11 -07:00
Chris Parsons
26cdf135ff When bpfix fails in androidmk, output the tree anyway
This can help with debugging cases where the resulting blueprint file is
invalid.

Test: Manual run of androidmk
Change-Id: I39605afa851aa6cdd8b49cc56386a8fc7347115c
2020-06-09 16:01:51 -04:00
Victor Khimenko
bf488e10e8 Merge "Make it possible to specify separate rules for native_bridge case" 2020-06-09 17:41:28 +00:00
Ivan Lozano
4231e344fa Merge "Specify SONAME when building Rust shared libs." 2020-06-09 15:49:34 +00:00