Commit Graph

20748 Commits

Author SHA1 Message Date
Paul Duffin
c6a50df123 Make new module creation API more flexible am: 3a4eb50829 am: 2e7885ea18
Change-Id: I250e0cfdfdcdc632f58b2b24149c17f5721535f9
2020-03-23 11:21:52 +00:00
Paul Duffin
2e7885ea18 Make new module creation API more flexible am: 3a4eb50829
Change-Id: Icd9cc9d6de27417450dec1b31cb5b0059593b209
2020-03-23 11:09:27 +00:00
Ulyana Trafimovich
660df7a709 Merge "Simplify the construction of class loader contexts for system server jars." into rvc-dev am: 26cb99941b
Change-Id: Ide12723b83822903c1f4d8163037adff582853df
2020-03-23 09:37:12 +00:00
Ulyana Trafimovich
26cb99941b Merge "Simplify the construction of class loader contexts for system server jars." into rvc-dev 2020-03-23 09:12:46 +00:00
Paul Duffin
3a4eb50829 Make new module creation API more flexible
Previously passing additional information to the implementations of
AddPrebuiltModule() or the SdkMemberProperties interface would have
required making changes to the API. This change added an
SdkMemberContext object into which additional information can easily
be added without requiring changes to existing implementations.

The BuildSnapshot() method was not modified because it is deprecated
and will be removed in a follow up change.

It also switches the API from passing variants as android.SdkAware to
android.Module. That is for a couple of reasons:
1) SdkAware is designed for managing the relationship between the
   module and the SDK, not for generating the output snapshot. As such
   there is nothing in SdkAware that is needed for generating the
   output snapshot.
2) Accepting android.Module instead makes it easier to use the
   underlying code for generating the snapshot module as well as the
   individual member modules.

This is in preparation for a number of improvements and bug fixes in
both the snapshot creation code and implementations to address found
while trying to built the platform against ART prebuilts.

Bug: 151937654
Test: m nothing
Change-Id: Iac10f1200c0f283aa35402167eec8f9aeb65a38e
2020-03-23 08:47:38 +00:00
Artur Satayev
afe1a60b1b [automerger skipped] Merge "Merge CSV files generated by UnsupportedAppUsageProcessor." into rvc-dev am: f95405dad5 -s ours
am skip reason: Change-Id I87d92f9c8d4b1cc1df526fc576ee3c2101116b58 with SHA-1 b5df8a04ad is in history

Change-Id: Ia887f4c05b9253a2257af27d11f7b6de2f98cbb6
2020-03-22 12:09:52 +00:00
Artur Satayev
f95405dad5 Merge "Merge CSV files generated by UnsupportedAppUsageProcessor." into rvc-dev 2020-03-22 11:53:58 +00:00
Paul Duffin
cd9407f0f3 Merge "Add abstraction for tracking compile multilib usages" am: eaf8e2deb1 am: 9402d6f683
Change-Id: I5fbe3e8b70ae35e030be25d01d6234ec4f86951f
2020-03-21 18:23:41 +00:00
Paul Duffin
9402d6f683 Merge "Add abstraction for tracking compile multilib usages" am: eaf8e2deb1
Change-Id: Icef1181989fd6fc9cac09cec0979a69006b2425f
2020-03-21 18:04:58 +00:00
Paul Duffin
eaf8e2deb1 Merge "Add abstraction for tracking compile multilib usages" 2020-03-21 17:49:57 +00:00
Jooyung Han
a5ba838a84 Merge "Revert "Enforce min_sdk_version of apex(use_vendor:true)"" am: b1eb4d4a94 am: 8c6d452d3f
Change-Id: I3798eb2ee67ff08e05ae516cf8df517c254a4089
2020-03-21 14:23:05 +00:00
Jooyung Han
8c6d452d3f Merge "Revert "Enforce min_sdk_version of apex(use_vendor:true)"" am: b1eb4d4a94
Change-Id: I9689c82ad0e7db74afde45c3427ad08260803421
2020-03-21 14:09:39 +00:00
Jooyung Han
b1eb4d4a94 Merge "Revert "Enforce min_sdk_version of apex(use_vendor:true)"" 2020-03-21 14:00:24 +00:00
Jooyung Han
bacf34d986 Revert "Enforce min_sdk_version of apex(use_vendor:true)"
This reverts commit 380fc3615c.

Reason for revert: breaking one of internal targets

Change-Id: Ica96c44078e5a7f674410828af3ba851317775dd

Exempt-From-Owner-Approval: revert to fix build failure
2020-03-21 13:59:12 +00:00
Artur Satayev
8a950790ee 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
Merged-In: I87d92f9c8d4b1cc1df526fc576ee3c2101116b58
Test: diff unsupportedappusage_index.csv hiddenapi-index.csv
Exempt-From-Owner-Approval: cp from r.android.com/1239709
2020-03-21 13:01:17 +00:00
Paul Duffin
be065bf9a3 Merge "Add support for using cc_library in sdk/module_exports" am: 3dcf75d343 am: 257eea8803
Change-Id: I64b01d20196d253451c8dfa97adf3f5847d364c3
2020-03-21 10:26:21 +00:00
Paul Duffin
257eea8803 Merge "Add support for using cc_library in sdk/module_exports" am: 3dcf75d343
Change-Id: Iac733a378370fd39dc59e815932b51a883840f4c
2020-03-21 10:05:39 +00:00
Paul Duffin
3dcf75d343 Merge "Add support for using cc_library in sdk/module_exports" 2020-03-21 09:50:28 +00:00
Jooyung Han
1e368946f0 Merge "Enforce min_sdk_version of apex(use_vendor:true)" am: 1950f1d413 am: 2b6ed45dfb
Change-Id: I7d51199c11017ae89b7aa886cc75d5e937c38850
2020-03-21 09:38:17 +00:00
Jooyung Han
2b6ed45dfb Merge "Enforce min_sdk_version of apex(use_vendor:true)" am: 1950f1d413
Change-Id: I1e865835045825e9b1f3a9b34c60d141829385ca
2020-03-21 09:25:52 +00:00
Jooyung Han
1950f1d413 Merge "Enforce min_sdk_version of apex(use_vendor:true)" 2020-03-21 09:14:58 +00:00
Treehugger Robot
1bd33b0429 Merge "cc: fix a utility to make C macro name" am: f23f4739f1 am: 6eaa524713
Change-Id: I7edda21442ff43146b297b570cc729587d82d899
2020-03-21 05:23:43 +00:00
Treehugger Robot
6eaa524713 Merge "cc: fix a utility to make C macro name" am: f23f4739f1
Change-Id: Iabdff41e47552963e526abe44bac8d7331d4b2a1
2020-03-21 05:08:34 +00:00
Treehugger Robot
f23f4739f1 Merge "cc: fix a utility to make C macro name" 2020-03-21 04:47:41 +00:00
Yabin Cui
fce8818c3a Merge "Switch from clang-r377782b to clang-r377782c." into rvc-dev am: 06af9190b1
Change-Id: Ied01085f2cd3ddc73e96f68eef99d58b4c6d4a8a
2020-03-21 03:55:53 +00:00
Yabin Cui
06af9190b1 Merge "Switch from clang-r377782b to clang-r377782c." into rvc-dev 2020-03-21 03:37:02 +00:00
Makoto Onuki
e6d26dcd30 [automerger skipped] Merge "Do not include any documentation when building stubs" into rvc-dev am: 571c9d93b3 -s ours
am skip reason: Change-Id I27eafb5a61bb9d26a74ca25f84c9daca17a8394f with SHA-1 39de325122 is in history

Change-Id: I1847668fd672b4c4544f3a5e95b593837090204e
2020-03-20 23:52:43 +00:00
Makoto Onuki
571c9d93b3 Merge "Do not include any documentation when building stubs" into rvc-dev 2020-03-20 23:29:44 +00:00
TreeHugger Robot
8b24b404c6 [automerger skipped] Merge "Fix forwarding a vararg parameter" into rvc-dev am: fc5fafd902 -s ours
am skip reason: Change-Id I03f011557d10c6e2bc06813491cd8df2cce7c6ea with SHA-1 cd87c69de4 is in history

Change-Id: Ideb6d997051219d0cc954862c7834b5486c04e62
2020-03-20 19:55:00 +00:00
TreeHugger Robot
fc5fafd902 Merge "Fix forwarding a vararg parameter" into rvc-dev 2020-03-20 19:40:06 +00:00
Yabin Cui
690c8b8b5e Switch from clang-r377782b to clang-r377782c.
Bug: 149849077
Test: N/A
Change-Id: Id8b5dd13e87d1acd8dab1431fa6859721553c49c
(cherry picked from commit 3125c990ed)
2020-03-20 11:17:30 -07:00
Treehugger Robot
d1803dfe19 Merge "Cleanup vendor_boot artifacts in PRODUCT_OUT on installclean" am: 8bf9eeb912 am: af11135954
Change-Id: I187ec22773080dfd4dad92d5c2301d15a5db7b01
2020-03-20 17:50:19 +00:00
Treehugger Robot
af11135954 Merge "Cleanup vendor_boot artifacts in PRODUCT_OUT on installclean" am: 8bf9eeb912
Change-Id: Ibf533d71008d80b6a8c51d2a4e599e95cf63ee86
2020-03-20 17:35:28 +00:00
TreeHugger Robot
3958fb08ad Merge "Cleanup vendor_boot artifacts in PRODUCT_OUT on installclean" into rvc-dev am: d775f6ae65
Change-Id: I51c26e820c945e64638301013ed39eb6a8c77338
2020-03-20 17:35:25 +00:00
Treehugger Robot
8bf9eeb912 Merge "Cleanup vendor_boot artifacts in PRODUCT_OUT on installclean" 2020-03-20 17:23:17 +00:00
Martin Stjernholm
69672d3ba6 Merge changes I2ab8f6aa,I53d58100 am: 71da478f51 am: 38f986a920
Change-Id: Ib0605f9caa2d8dbc6335f6f39dbae204d1a6d9a0
2020-03-20 17:23:12 +00:00
TreeHugger Robot
d775f6ae65 Merge "Cleanup vendor_boot artifacts in PRODUCT_OUT on installclean" into rvc-dev 2020-03-20 17:22:53 +00:00
Martin Stjernholm
38f986a920 Merge changes I2ab8f6aa,I53d58100 am: 71da478f51
Change-Id: Ic7327f1455c0a96bdfa6e8e587d879904b47ed7e
2020-03-20 17:07:27 +00:00
Paul Duffin
9c3760eb14 Add abstraction for tracking compile multilib usages
Ensures consistent tracking of multilib usages.

Bug: 142935992
Test: m nothing
Change-Id: I82ba4a53a21a0823503cb98f7edfde449b48b440
2020-03-20 16:55:24 +00:00
Paul Duffin
9b76c0b65a Add support for using cc_library in sdk/module_exports
Added link type support in module creation code as cc_prebuilt_library
has to provide both shared and static libraries.

Had to add some calls to FirstUniquePaths() around the include dirs
settings in library_sdk_member as otherwise the shared variant contains
duplicate include dirs (presumably because it gets one set from its
dependency on the static variant and one set of its own). That
difference in include dirs causes problems in the generated
cc_prebuilt_library.

Test: m nothing
Bug: 142918168
Change-Id: Ie7f23fc2341c83c7814cc98e3970df4f5d4c8423
2020-03-20 16:55:24 +00:00
Martin Stjernholm
71da478f51 Merge changes I2ab8f6aa,I53d58100
* changes:
  Add SDK member support for cc_object.
  Add cc_prebuilt_object.
2020-03-20 16:53:51 +00:00
Ulya Trafimovich
a4a83b0ef9 Simplify the construction of class loader contexts for system server jars.
This reworks CL https://r.android.com/1180134 as follows:

1) Do not reorder the list of system server jars passed from Make to
  Soong via the product variable PRODUCT_SYSTEM_SERVER_JARS. This means
  that for some products the order of jars on the system server
  classpath may be non-optimal: a jar X that depends on Y may be
  dexpreopted before Y, so that all references to the classes and
  methods from Y wil be unresolved.

  Unfortunately for such products, fixing the order is not a simple
  matter of rearranging their PRODUCT_SYSTEM_SERVER_JARS, because the
  conflicts may arise when the product-specific variable gets merged
  with the common variable.

2) As a consequence of 1), do not add artificial dependencies between
  system server jars: this is now impossible, as it would create
  circular dependencies for those products that have non-optimal order
  of jars.

3) Copy dex files for system server jars to a predefined build location.
  This is necessary because at the time when Soong generates class
  loader context for k-th jar, it needs to know the paths to jars 1 ..
  (k-1), and it might have not processed those jars yet (so Soong can't
  query the paths from the modules).

  This approach is similar to the way Soong handles bootclasspath jars.

4) Do not exclude from dexpreopting system server jars that are not
  Soong modules (those that are Make modules). The previous CL excluded
  them because Make modules do not have ModuleContext. But it turns out
  that ModuleContext is not necessary, as all the information is passed
  via the dexpreopt config.

Test: aosp_walleye-userdebug boots and there are no messages in the
  logcat regarding class loader context mismatch:

  $ adb logcat | grep 'mismatch'
  # empty

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 2>/dev/null | grep '^classpath'
  classpath = PCL[]
  $ oatdump --oat-file=out/target/product/walleye/system/framework/oat/arm64/services.odex 2>/dev/null | grep '^classpath'
  classpath = PCL[/system/framework/com.android.location.provider.jar*1989208671]
  $ oatdump --oat-file=out/target/product/walleye/system/framework/oat/arm64/ethernet-service.odex 2>/dev/null | grep '^classpath'
  classpath = PCL[/system/framework/com.android.location.provider.jar*1989208671:/system/framework/services.jar*4040443083:/system/framework/services.jar!classes2.dex*2210087472]

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 -io 'system_server: .*load.*/system/framework.*'
  system_server: Loading /system/framework/oat/arm64/com.android.location.provider.odex with executable: 0
  system_server: Successfully loaded /system/framework/oat/arm64/com.android.location.provider.odex with executable: 0
  system_server: Loading /system/framework/oat/arm64/services.odex with executable: 0
  system_server: Successfully loaded /system/framework/oat/arm64/services.odex with executable: 0
  system_server: Loading /system/framework/oat/arm64/ethernet-service.odex with executable: 0
  system_server: Successfully loaded /system/framework/oat/arm64/ethernet-service.odex with executable: 0
  system_server: Loading /system/framework/oat/arm64/wifi-service.odex with executable: 0
  system_server: Successfully loaded /system/framework/oat/arm64/wifi-service.odex with executable: 0
  system_server: Loading /system/framework/oat/arm64/com.android.location.provider.odex with executable: 1
  system_server: Successfully loaded /system/framework/oat/arm64/com.android.location.provider.odex with executable: 1
  system_server: Loading /system/framework/oat/arm64/services.odex with executable: 1
  system_server: Successfully loaded /system/framework/oat/arm64/services.odex with executable: 1
  system_server: Loading /system/framework/oat/arm64/ethernet-service.odex with executable: 1
  system_server: Successfully loaded /system/framework/oat/arm64/ethernet-service.odex with executable: 1
  system_server: Loading /system/framework/oat/arm64/wifi-service.odex with executable: 1
  system_server: Successfully loaded /system/framework/oat/arm64/wifi-service.odex with executable: 1
  system_server: Loading /system/framework/oat/arm64/com.android.location.provider.odex with executable: 1
  system_server: Successfully loaded /system/framework/oat/arm64/com.android.location.provider.odex with executable: 1

Bug: 141785760
Bug: 140451054
Bug: 148944771
Bug: 147017252

Change-Id: I33c4087f8bfacd0ecb89877aa150b75360d06710
2020-03-20 15:23:18 +00:00
Ola Rozenfeld
241ac660a8 Merge "Migrating RBE flags to RBE_ variables." am: 27818b9919 am: 7e1bd40c36
Change-Id: I4fa360bf41f5eeb70a38575903c8d655c4aa3313
2020-03-20 13:39:36 +00:00
Ola Rozenfeld
7e1bd40c36 Merge "Migrating RBE flags to RBE_ variables." am: 27818b9919
Change-Id: Icef04d5f980fd33e27c33bf7c459a607a0f4633e
2020-03-20 13:28:55 +00:00
Ola Rozenfeld
27818b9919 Merge "Migrating RBE flags to RBE_ variables." 2020-03-20 13:16:45 +00:00
Anton Hansson
3d3da711c9 Make system_server stubs consistent with other stubs am: bbd78556da
Change-Id: I284b909cda2a421f8308ac768adcdd940bc32f3b
2020-03-20 12:28:28 +00:00
Patrice Arruda
a5b141aa77 Generate the build_error protobuf file on first build action error. am: 85f227eed7 am: adcd11ad72
Change-Id: Id454752208644850a154b9c1d74eba399c55a126
2020-03-20 04:08:22 +00:00
Patrice Arruda
adcd11ad72 Generate the build_error protobuf file on first build action error. am: 85f227eed7
Change-Id: I9034ec3f4d9a32574bfa20e716411351c46587b3
2020-03-20 03:55:26 +00:00
Patrice Arruda
85f227eed7 Generate the build_error protobuf file on first build action error.
buld_error protobuf file is created the moment a build action failed.
This is for external system to detect immediately what caused the
build failure while monitoring the build_progress.pb file.

Bug: b/150401146
Test: * m nothing
      * Built successfully aosp_arm-eng and checked build_error file
        was not created.
      * Modified a cpp file to cause a build failed. Ran m and build
        failed. Checked immediately during the build that the
	build_error file was created.
      * m clean; m and during build, checked if build_error was
        removed.
Change-Id: I778616ae8cf242b49ad263b79c93321959112caa
2020-03-19 18:23:26 -07:00
Martin Stjernholm
cd07bce437 Add SDK member support for cc_object.
Test: m nothing
Test: Add
    sdk {
        name: "runtime-module-sdk",
        native_shared_libs: [
            "libc",
            "libdl",
            "libm",
            "ld-android",
        ],
        native_objects: [
            "crtbegin_dynamic",
            "crtbegin_static",
            "crtend_android",
        ],
    }
  to bionic/apex/Android.bp. Then:
    build/soong/scripts/build-aml-prebuilts.sh runtime-module-sdk
  Take the generated runtime-module-sdk-current.zip and unzip into a
  master-art tree without bionic/, edit the generated Android.bp to
  extend cc_prebuilt_* modules with:
    nocrt: true,
    stl: "none",
    system_shared_libs: [],
    apex_available: ["//apex_available:anyapex"],
    recovery_available: true,
    vendor_available: true,
    ramdisk_available: true,
  Then "m com.android.art.debug". This passes Soong but fails in the
  build step because more members are required.
Bug: 148934017
Change-Id: I2ab8f6aadb1440b325697cae4a8ed761c62d15d2
2020-03-20 00:16:14 +00:00