Commit Graph

1883 Commits

Author SHA1 Message Date
Elliott Hughes da3a071eaa Remove unused mips workarounds.
This was never really finished, and hasn't been supported for years.

Test: treehugger
Change-Id: I21d4c3112aa8cf0c56e59f0cc19ff8725ef714b9
2020-03-06 18:15:44 -08:00
Colin Cross 1ec3fce9b6 Disable goma for javac actions in Soong
goma can't handle the --system argument that Android must pass to
javac.

Bug: b/143658984
Test: treehugger
Change-Id: I207668d8baa4ab28160938732a38f696aeac3f44
2020-03-05 20:46:15 +00:00
Paul Duffin f5c0a9c8f3 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.

Test: m nothing
Bug: 150451422
Change-Id: I1f96986bb497cf9d9df9916e40065f66b35a4704
2020-03-02 19:32:40 +00:00
Jiyong Park cfaa1643e8 bundle config contains (path,manifest) pairs of embedded APKs
If an APEX contains APKs and the manifest package name of the APKs are
overridden (either via override_android_app
orPRODUCT_MANIFEST_PACKAGE_NAME_OVERRIDES), that the path to the APK
(relative in the APEX) and the overridden manifest package name is
recorded in the bundle config file.

Bug: 148002117
Test: m

Change-Id: Ibb90bcefb77fa6b2dad77cb2facc6079de9ab154
2020-02-29 09:07:46 +09:00
Treehugger Robot f14cd86e23 Merge changes from topic "soong_build_number_file"
* changes:
  Add an order-only dependency on the build number file
  Add support for order-only dependencies to RuleBuilder
2020-02-28 20:15:52 +00:00
Treehugger Robot c2f4f20bde Merge "Use header jar without jarjar for sharded classpath" 2020-02-28 19:40:41 +00:00
Colin Cross 2a2e0db2a2 Add an order-only dependency on the build number file
Remote execution and other tools can be confused by references to
build_number.txt without a dependency.  Add an order-only dependency,
which maintains the current behavior.

Test: BUILD_NUMBER=1 && m aapt && aapt version # shows 1
      BUILD_NUMBER=2 && m aapt && aapt version # shows 1
      rm out/soong/.intermediates/frameworks/base/tools/aapt/aapt/linux_glibc_x86_64/aapt
      BUILD_NUMBER=2 && m aapt && aapt version # shows 2
Change-Id: Icfa98d6840b1dc2e273ba29c33011635d1cf93b1
2020-02-28 18:16:56 +00:00
David Srbecky e7ea9e631d Merge "Distinguish boot images by target rather than arch" 2020-02-28 11:07:45 +00:00
Bob Badour 40017be1c3 Merge "Unless overridden include LICENSE files in notices." 2020-02-26 20:37:22 +00:00
David Srbecky c177ebeca9 Distinguish boot images by target rather than arch
We plan to add boot image variants for host tests.
Distinguishing the variants by arch does not work,
since both host and device can have the same arch.

Change-Id: Iea73c77367affb074f97a0fc318389417ce537da
2020-02-26 17:04:21 +00:00
Yan Yan 9a63ee1b4f Merge "Update ike.jar's name in code coverage configuration" 2020-02-25 21:56:43 +00:00
evitayan 2e5606736f Update ike.jar's name in code coverage configuration
ike has been renamed to android.net.ipsec.ike. This commit applies
this name updates to the code coverage configuration.

Bug: 148625578
Test: m EMMA_INSTRUMENT=true EMMA_INSTRUMENT_FRAMEWORK=true SKIP_BOOT_JARS_CHECK=true WITH_DEXPREOPT=false android.net.ipsec.ike.com.android.ipsec_intermediates/ contains jacoco-report-classes.jar
Change-Id: Ic46a1091899eb5bc9560739ec86a9bea08585075
2020-02-25 07:43:43 +00:00
Jiyong Park 139fa4320f Merge changes Ibaf383c4,I2b1c0736
* changes:
  Expect added members for instrumented modules
  Reland "Turn on the instrumentation by default for the java code in APEXes"
2020-02-25 07:02:33 +00:00
Jiyong Park 93e57a0b86 Expect added members for instrumented modules
hiddenapi expects that all members in a class to have corresponding hidden
API flags. However, this can't be satisfied when the java module having
the class is instrumented; JaCoCo added a few number of synthetic
members. In this case, give 'no-force-assign-all' option to the hidden
api tool so that it doesn't complain about the synthetic methods.

Also, disabling instrumenting jacocoagent itself, because it doesn't
make sense.

Exempt-From-Owner-Approval: PS3 fixes a typo in a comment. PS2 got ORV.

Bug: 149353192
Test: SKIP_ABI_CHECKS=true EMMA_INSTRUMENT=true
EMMA_INSTRUMENT_FRAMEWORK=true SKIP_BOOT_JARS_CHECK=true m
out/soong/.intermediates/external/apache-xml/apache-xml/android_common_com.android.art.debug/hiddenapi/unaligned/unaligned.jar
Change-Id: Ibaf383c439945ab664e885af319548b56e2c8cb6
2020-02-25 07:01:18 +00:00
Treehugger Robot a35e3ffd96 Merge "Merge CSV files generated by UnsupportedAppUsageProcessor." 2020-02-25 04:01:52 +00:00
Jiyong Park 00cae1cc88 Reland "Turn on the instrumentation by default for the java code in APEXes"
This reverts commit c021ea0b35.

Bug: 149353192
Change-Id: I2b1c0736202de26c5ea88c0ab14574bd7207a5fb
Test: N/A (this is a clean revert) forward fix will be followed
2020-02-24 15:59:21 +09:00
Colin Cross 094cde4430 Require apps built against the SDK to use JNI built against the NDK
Apps that expect to run on older platforms should use JNI libraries
that will also run on older platforms.  Require that apps that set
sdk_version have jni_libs modules that also set sdk_version, or
set jni_uses_platform_apis: true to bypass the check.

Fixes: 149591057
Test: app_test.go
Change-Id: I76b9b45fb5773bc4dfc10520108f4f3578723909
2020-02-21 14:54:31 -08:00
Colin Cross f7d84017f7 Use header jar without jarjar for sharded classpath
Sharding uses the header jar of all of the classes of the module
with the sources of a subset, but was incorrectly used the jarjar
version of the header jar, which may have renamed some of the
classes.

Fixes: 149969343
Test: m framework-minus-apex
Change-Id: I568c939f8030d3ddc1e7fa8796cffcac4d6172e8
Merged-In: I568c939f8030d3ddc1e7fa8796cffcac4d6172e8
(cherry picked from commit f5a6628b27)
2020-02-21 14:31:01 -08:00
Bob Badour a75b057e17 Unless overridden include LICENSE files in notices.
As a second step to removing the go/android3p instructions to copy or
to link NOTICE to LICENSE, include LICENSE files in the notices, which
will allow deleting all of the copied/linked NOTICE files.

The change causes a few additions to the system image notice files.

Test: manually built and compared before and after notices
Change-Id: Ia7bc58e2eba7bed5e63934881b5298201a93bc3e
2020-02-21 20:40:43 +00:00
Colin Cross 1a9be9f3d0 Merge "Add jni_uses_platform_api property to android_app" 2020-02-21 06:58:48 +00:00
Treehugger Robot 53fe467c67 Merge changes from topic "soong_tests_ndk"
* changes:
  Make apex use cc.GatherRequiredDepsForTests
  Move NDK test modules into cc/testing.go
2020-02-20 20:39:16 +00:00
Artur Satayev b5df8a04ad Merge CSV files generated by UnsupportedAppUsageProcessor.
Flow:
1. Annotation processor generates a CSV file per class as a CLASS_OUTPUT resource.
2. hiddenapi.go extracts individual .csv files and merges them into an index.csv file per module.
3. hiddenapi_singleton.go merges individual index.csv files into a combined .csv file.

In a follow up hiddenapi-index.csv would replace unsupportedappusage_index.csv

Bug: 145132366
Change-Id: I87d92f9c8d4b1cc1df526fc576ee3c2101116b58
Test: diff unsupportedappusage_index.csv hiddenapi-index.csv
2020-02-20 20:21:49 +00:00
Treehugger Robot 112045230d Merge "Use flag names with merge_csv.py." 2020-02-20 19:17:19 +00:00
Colin Cross ee87c60fc3 Add jni_uses_platform_api property to android_app
Add a jni_uses_platform_api property that will be used to allow
an app that builds against the SDK to use JNI libraries that build
against platform APIs.  For now it is a noop, but the next CL will
make it enforcing.

Bug: 149591057
Test: m checkbuild
Change-Id: Id7b7c8186bf0e28498a4cfb15c6a6ccc95df3679
2020-02-19 19:07:11 -08:00
Colin Cross f28329de73 Move NDK test modules into cc/testing.go
Move the NDK modules defined in app_test.go into cc/testing.go in
preparation for using sdk_version: "current" in more tests.

Test: all soong tests
Change-Id: I80bc31225fb4562fce42781219cefbbd6affae06
2020-02-19 18:59:15 -08:00
Jiyong Park 2d6d5d8995 Merge "Permissions XML file for java_sdk_library is mutated for APEX" 2020-02-19 23:57:14 +00:00
Paul Duffin 83a2d967de Allow java_system_modules_import to replace java_system_modules
Previously, there were some places where a java_system_module_import
could not be used in place of a java_system_module. That was because
the code assumed a *SystemModules type not a *systemModulesImport type.
This change introduces a SystemModulesProvider interface that is used
instead and is implemented on both types.

Bug: 142940300
Test: m nothing
      ran new tests before changes to make sure they detected the issue
	  and after to make sure the changes fixed the issue.
Change-Id: I7b16ac5708880bdf61e6f5b1e6616c986f0ed763
2020-02-19 14:24:15 +00:00
Artur Satayev 79fac05b45 Use flag names with merge_csv.py.
Bug: 145132366
Test: diff -w out/soong/hiddenapi/hiddenapi-greylist.csv
Change-Id: If63c8ae5eda48e49bf58a338bf08f0f2d4fea3cf
2020-02-19 13:24:04 +00:00
Nicolas Geoffray cbeaab2974 Merge "Add system server jars expressed in make in the system server classpath." 2020-02-19 07:40:19 +00:00
Jiyong Park e383388f98 Permissions XML file for java_sdk_library is mutated for APEX
This change fixes a regression that was introduced with
I597bccbb177b6b6320c3a3edeff467243230d384. With the change, the content
of the permissions XML file for a java_sdk_library was determined before
the java_sdk_library is mutated for an APEX. As a result, the file path
to the implementation jar library was always set to
/system/framework/*.jar regardless of whether the java_sdk_library is
part of an APEX or not.

This change fixes the problem, by creating the permissions XML file via
a new module type. The content of the xml file is determined after the
xml file is mutated for APEXes.

Bug: 149600642
Test: m

Change-Id: Id21f8d8285df49b0b3be1daf0f101f2bc978eeb0
2020-02-19 09:47:37 +09:00
Treehugger Robot 2f94e85f14 Merge "Allow for setting a logging_parent for an Android App." 2020-02-18 22:57:31 +00:00
Baligh Uddin 5b16dfb39a Allow for setting a logging_parent for an Android App.
Unit test: go test ./... -test.v -run TestOverrideAndroidApp
Unit test: python manifest_fixer_test.py

BUG: 148198056
Change-Id: Ib5ff235d2a93e88b86aec1c0b16327ea938a094d
2020-02-18 09:37:56 -08:00
Jaewoong Jung 36b6aec26a Merge "Simple refactoring of prefix related functions." 2020-02-18 15:08:41 +00:00
Treehugger Robot 7c9662a8e9 Merge "sdk_version: "system_server_current"" 2020-02-18 09:55:54 +00:00
Nicolas Geoffray 47cbfcdd3e Add system server jars expressed in make in the system server classpath.
This was missed in:
https://android-review.googlesource.com/c/platform/build/soong/+/1180134

Test: lunch and build ARC, check SYSTEMSERVERCLASSPATH
Bug: 148944771
Bug: 141785760
Bug: 140451054
Change-Id: I619aee5441f7233010067a6c780e978f38ba7796
2020-02-17 19:47:05 +00:00
Jackal Guo 954b29728d Merge "Revert "Turn on the instrumentation by default for the java code in APEXes"" 2020-02-17 05:12:06 +00:00
Jackal Guo c021ea0b35 Revert "Turn on the instrumentation by default for the java code in APEXes"
This reverts commit 33b6654eea.

Reason for revert: verify build breakage

Change-Id: I712a9de8ca3bfb17c36d3b8efa6176cdaf26640e
2020-02-17 03:25:56 +00:00
Jaewoong Jung 3aff5787e2 Simple refactoring of prefix related functions.
Rename the two prefix-in-list funcs so that their usages are clearer.
Also find and replace all the code that essentially does either.

This introduces additional loops in some places, but I think the added
readability and simplicity outweighs the performance degradation, which
should be negligible anyway.

Test: m nothing
Test: TreeHugger
Change-Id: I37e2276ca0c815105ed0031f23c0b1264b480e4f
2020-02-14 14:33:49 -08:00
Treehugger Robot 1d62b1c536 Merge "Turn on the instrumentation by default for the java code in APEXes" 2020-02-14 21:55:40 +00:00
Jiyong Park 33b6654eea Turn on the instrumentation by default for the java code in APEXes
Bug: 149353192
Test:  DIST_DIR=dist_dir TARGET_BUILD_VARIANT=userdebug
EMMA_INSTRUMENT=true NATIVE_COVERAGE=true
TARGET_BUILD_APPS="com.android.media"
vendor/google/build/build_unbundled_coverage_mainline_module.sh and
check that jacoco-report-classes.jar is created.
Change-Id: I28e3dc82b7913f60b2278126fca255306e48a424
2020-02-14 07:21:56 +09:00
Martin Stjernholm 6d415273c0 Do all dexpreoptDisabled checks before registering a dex2oat host dep.
Also disable dexpreopting for host. These are necessary to avoid adding
dependencies on dex2oat in various non-platform builds where they will
break.

Since we cannot assume at least one module enables dexpreopting now,
the two dexpreopt singletons are silently disabled if there has been no
call to dexpreopt.GetGlobalSoongConfig.

Bug: 145934348
Bug: 148312086
Bug: 148319588
Bug: 148690468
Test: m
Test: env OUT_DIR=out-tools prebuilts/build-tools/build-prebuilts.sh
  on the aosp-build-tools branch
Test: build/soong/soong_ui.bash --make-mode static_sdk_tools dist DIST_DIR=out-dist BUILD_HOST_static=1
  on internal (cf b/148312086#comment8)
Test: build/soong/soong_ui.bash --make-mode dist DIST_DIR=out-apps TARGET_BUILD_APPS=Launcher3 TARGET_BUILD_VARIANT=userdebug
  on internal without art/ and external/vixl/ (cf b/148319588)
Change-Id: I240dade7204b87fc2d12181534ab23439eca8b46
2020-02-13 17:46:48 +00:00
Martin Stjernholm 8d80ceeb12 Pass dexpreopt config structs by reference.
Should cut down on a bit of copying, and also required for an upcoming
CL that'll change GetCachedGlobalSoongConfig.

Test: m nothing
Bug: 145934348
Change-Id: I6bed737d9b061b5239cc603ad881f4ccd4312e43
2020-02-13 17:46:48 +00:00
Martin Stjernholm d90676fdde Reland: Get the dex2oat host tool path from module dependency on the
binary module.

This uses the Once cache for GlobalSoongConfig to propagate the dex2oat
path from a module dependency to the singletons (both the one that
writes out dexpreopt_soong.config and the one that creates the
dexpreopted boot images). Unless dexpreopting is disabled altogether
through DisablePreopt in dexpreopt.config, that means:

- We must ensure at least one module registers a dex2oat tool
  dependency and resolves a GlobalSoongConfig using it, or else the
  singletons fail. That means we litter dex2oat dependencies in java
  modules even when they won't get dexpreopted and hence don't really
  need them.

- We still assume there's at least one java_library or android_app in
  the build.

This relands https://r.android.com/1205730 without changes - the
necessary fixes are in the child CLs.

Bug: 145934348
Test: m
  (check that out/soong/dexpreopt_soong.config points to dex2oatd64)
Test: env USE_DEX2OAT_DEBUG=false m
  (check that out/soong/dexpreopt_soong.config points to dex2oat64)
Test: env OUT_DIR=out-tools prebuilts/build-tools/build-prebuilts.sh
  on the aosp-build-tools branch
Change-Id: I66661711b317d1e4ec434861982919bdde19b575
2020-02-13 17:46:48 +00:00
Martin Stjernholm 40f9f3c061 Reland: Move the Once cache for dexpreopt.GlobalConfig into the
dexpreopt package.

Preparation for a future CL that will need to get the make-written
GlobalConfig from within dexpreopt.

Also rename the Load*Config functions to Parse*Config, since they don't
actually load the config files anymore.

This relands https://r.android.com/1211982.

Bug: 145934348
Test: m
Change-Id: Icb9332a93811d77d2d8b06e983b92501b180a358
2020-02-13 17:46:48 +00:00
Martin Stjernholm 75a48d8ae2 Reland: Separate dexpreopt.GlobalSoongConfig to allow independent
caching of it.

Introduce a Once cache for GlobalSoongConfig to allow it to get binary
tool paths from ordinary module dependencies (coming in a future CL)
that are then reused in singletons.

This relands https://r.android.com/1205729.

Bug: 145934348
Test: m
Change-Id: I039d6e204bee5ddc16d8e2d85057fbec20e326fe
2020-02-13 17:21:13 +00:00
Ulya Trafimovich f3ff010bd4 Use precise class loader context for system server jars.
This patch excludes non-Soong system server jars from dexpreopting.

System server jars should be dexpreopted together for better
performance: each jar should have all preceding system server jars
in its class loader context (that is passed to dex2oat and recorded
in the resulting .oat file to be used by the loader).

This means that we need a total order on system server jars. The
default order provided by PRODUCT_SYSTEM_SERVER_JARS is not good, as
it does not always respect genuine dependencies between jars (counter-
examples are rare, but non-trivial to fix: b/148219586).

This patch adds a post deps mutator pass that creates additional
dependencies and enforces global order. These are later used to
generate precise class loader contexts and system server classpath.

Test: Class loader contexts in the oat files for system server jars
  match expectations:

  $ oatdump --oat-file=out/target/product/walleye/system/framework/oat/arm64/com.android.location.provider.odex | grep '^classpath'
  classpath = PCL[]
  $ oatdump --oat-file=out/target/product/walleye/system/framework/oat/arm64/services.odex | grep '^classpath'
  classpath = PCL[/system/framework/com.android.location.provider.jar*1919890654]
  $ oatdump --oat-file=out/target/product/walleye/system/framework/oat/arm64/wifi-service.odex | grep '^classpath'
  classpath = PCL[/system/framework/com.android.location.provider.jar*1919890654:/system/framework/services.jar*4269704903:/system/framework/services.jar!classes2.dex*134345935]
  ...

Test: The phone boots and logcat has no scary messages related to
  class loader contexts:

  $ lunch aosp_walleye-userdebug && m
  $ adb reboot bootloader && fastboot flashall -w && adb wait-for-device
  $ adb root
  $ adb shell stop
  $ adb logcat -c
  $ adb shell setprop dalvik.vm.extra-opts -verbose:oat
  $ adb shell start
  $ adb logcat | egrep -i 'system_server: .*load.*/system/framework'
  02-03 14:14:26.912  5016  5016 I system_server: Loading /system/framework/oat/arm64/com.android.location.provider.odex with executable: 1
  02-03 14:14:26.914  5016  5016 I system_server: Successfully loaded /system/framework/oat/arm64/com.android.location.provider.odex with executable: 1
  02-03 14:14:26.914  5016  5016 I system_server: Loading /system/framework/oat/arm64/services.odex with executable: 1
  02-03 14:14:26.916  5016  5016 I system_server: Successfully loaded /system/framework/oat/arm64/services.odex with executable: 1
  02-03 14:14:26.927  5016  5016 I system_server: Loading /system/framework/oat/arm64/wifi-service.odex with executable: 1
  02-03 14:14:26.933  5016  5016 I system_server: Successfully loaded /system/framework/oat/arm64/wifi-service.odex with executable: 1
  02-03 14:14:26.933  5016  5016 I system_server: Loading /system/framework/oat/arm64/ethernet-service.odex with executable: 1
  02-03 14:14:26.934  5016  5016 I system_server: Successfully loaded /system/framework/oat/arm64/ethernet-service.odex with executable: 1
  02-03 14:14:26.946  5016  5016 I system_server: Loading /system/framework/oat/arm64/com.android.location.provider.odex with executable: 0
  02-03 14:14:26.947  5016  5016 I system_server: Successfully loaded /system/framework/oat/arm64/com.android.location.provider.odex with executable: 0
  02-03 14:14:26.947  5016  5016 I system_server: Loading /system/framework/oat/arm64/services.odex with executable: 0
  02-03 14:14:26.948  5016  5016 I system_server: Successfully loaded /system/framework/oat/arm64/services.odex with executable: 0
  02-03 14:14:26.948  5016  5016 I system_server: Loading /system/framework/oat/arm64/wifi-service.odex with executable: 0
  02-03 14:14:26.948  5016  5016 I system_server: Successfully loaded /system/framework/oat/arm64/wifi-service.odex with executable: 0
  02-03 14:14:26.949  5016  5016 I system_server: Loading /system/framework/oat/arm64/ethernet-service.odex with executable: 0
  02-03 14:14:26.949  5016  5016 I system_server: Successfully loaded /system/framework/oat/arm64/ethernet-service.odex with executable: 0
  02-03 14:14:30.480  5016  5016 I system_server: Loading /system/framework/oat/arm64/com.android.location.provider.odex with executable: 1
  02-03 14:14:30.481  5016  5016 I system_server: Successfully loaded /system/framework/oat/arm64/com.android.location.provider.odex with executable: 1

Bug: 141785760
Bug: 140451054
Bug: 148944771

Change-Id: Idac678dbd1f5fe0e381ce8e0e3561423f8a31389
2020-02-13 14:39:03 +00:00
Ulya Trafimovich 4cdada2d1f Make PRODUCT_BOOT_JARS and PRODUCT_UPDATABLE_BOOT_JARS disjoint.
This is to unify boot jars with system server jars:
PRODUCT_SYSTEM_SERVER_JARS and PRODUCT_UPDATABLE_SYSTEM_SERVER_JARS
do not overlap.

Test: aosp_walleye-userdebug boots

Exempt-From-Owner-Approval: cherry-pick.
Bug: 146363577
Change-Id: If001049a46f8e9d38921dabeedbd61e971ebfe73
Merged-In: If001049a46f8e9d38921dabeedbd61e971ebfe73
(cherry picked from commit ef4358e536)
2020-02-13 13:35:39 +00:00
Treehugger Robot 6655756230 Merge "Automatically set compile_dex:true and hostdex:true for APEX variants" 2020-02-12 05:35:25 +00:00
Jiyong Park 6b21c7d2ab Automatically set compile_dex:true and hostdex:true for APEX variants
... unless they are turned off explicitly.

Bug: 147221965
Test: m
Change-Id: I6b91d6409d9cf06ad09467c53d5d51a9c693256e
2020-02-12 10:47:36 +09:00
Jiyong Park aae9bd11c2 sdk_version: "system_server_current"
The new sdk version "system_server_current" is for system server
components that needs to use all public APIs, system APIs, module APIs,
and the system server APIs.

Bug: 146757305
Test: m
Change-Id: I24fd5af010532a110393676607dc90889f2ec17e
2020-02-12 04:36:43 +09:00