Skip to content
  1. Mar 24, 2020
    • Dan Willemsen's avatar
      soong_config: bool_variables shortcut · 2b8b89cf
      Dan Willemsen authored
      Using a lot of boolean variables can become very verbose without adding
      really any new information:
      
            variables: ["a", "b", "c"],
        }
      
        soong_config_bool_variable {
            name: "a",
        }
      
        soong_config_bool_variable {
            name: "b",
        }
      
        soong_config_bool_variable {
            name: "c",
        }
      
      Now turns into:
      
            bool_variables: ["a", "b", "c"],
        }
      
      Test: built-in tests
      Change-Id: If5455a38433431c7ecbce1e5b32cfbb47f42602a
      2b8b89cf
  2. Mar 23, 2020
    • Ulya Trafimovich's avatar
      Fix null pointer dereference in Soong on dexpreopt arc-services. · b358ebb7
      Ulya Trafimovich authored
      The null pointer dereference was caused by trying to get device name
      from a config passed to dexpreopt. For Make modules, the config is a
      stub that doesn't have a device name. The fix is to use build directory
      instead of device name (it is provided both by the full config passed
      to Soong modules and by the stub config passed to Make modules).
      
      Test: walleye-userdebug boots.
      Test: aosp_bertha_arm-userdebug builds and generates arc-services.odex.
      
      Bug: 152193534
      Change-Id: I7adc173646cae6eaee188c6672629a5a942aea06
      Merged-In: I7adc173646cae6eaee188c6672629a5a942aea06
      (cherry picked from commit 9790f105)
      b358ebb7
    • Ulyana Trafimovich's avatar
    • Ulya Trafimovich's avatar
      Simplify the construction of class loader contexts for system server jars. · dacc6c56
      Ulya Trafimovich authored
      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
      Merged-In: I33c4087f8bfacd0ecb89877aa150b75360d06710
      (cherry picked from commit a4a83b0e)
      
      Exempt-From-Owner-Approval: cherry-pick.
      dacc6c56
    • Paul Duffin's avatar
      Use reflect.Zero(type) to get value to clear field · 7b5f1a61
      Paul Duffin authored
      Previously, the common value extraction code used an empty structure
      to get the value to use to clear a field whose value is common. This
      change removed the structure and used reflect.Zero(..) to get the
      value instead.
      
      Bug: 142935992
      Test: m nothing
      Change-Id: Ibd5103dacb86e7754a786356c0d15ffbde7f98bf
      7b5f1a61
    • Paul Duffin's avatar
      Sdk snapshot set compile_multilib per OsType · 6a7e953e
      Paul Duffin authored
      Previously, when an sdk snapshot only supported a single os type the
      compile_multilib was set based on the multilib usages by the members
      of that variant. After the change to support multiple os types per
      snapshot the multilib setting was based on the multilib usages across
      all the members of all sdk variants. That meant that if one os type
      used only "64" and the other used "both" then they would both be
      treated as "both" leading to missing variants when the snapshot was
      unpacked.
      
      This change tracks the multilib usages per os type and adds a property
      for each one.
      
      It intentionally changes a couple of tests:
      1) Either by adding compile_multilib that is missing.
      2) By targeting it at a specific os type instead of host.
      
      The latter change is important to prevent the snapshot from being
      used on a host platform (which will match the host target section)
      but which is a different os type to the ones supported by the
      snapshot.
      
      Bug: 142935992
      Test: m nothing
      Change-Id: I883919b644292c3d019db223bb4fd5c11b39591f
      6a7e953e
    • Paul Duffin's avatar
      Remove old SdkMemberType API for creating snapshot modules · 495ffb9f
      Paul Duffin authored
      Migrates system modules and droid stubs over to use the new API for
      creating the snapshot modules and removes the old API.
      
      Test: m nothing
      Change-Id: Ia825767f1f7ee77f68cfe00f53e09e6f6bfa027f
      495ffb9f
    • Paul Duffin's avatar
      Improve consistency of handling java snapshot properties · a551a1c2
      Paul Duffin authored
      Previously, java snapshot properties (java_library and java_test)
      relied on the properties not being optimized when there was a single os
      type and instead being added directly to the common os type properties.
      However, that means that the behavior is inconsistent for other member
      types depending on whether there was one os type or not.
      
      This change updates the java sdk member handling to support
      optimization. This involved:
      1) Adding AidlIncludeDirs field to librarySdkMemberProperties to
         specify the aidl include dirs instead of extracting that from the
         library field.
      
      2) Renaming jarToExport to JarToExport (in both
         library/testSdkMemberProperties)to allow it to be optimized.
      
      3) Adding MemberType() and Name() methods to SdkMemberPropertiesContext
         to avoid having to store the former in the properties struct and
         retrieve the latter from the library/test fields.
      
      4) Removing the now unused library/test fields from the properties
         structures.
      
      5) Separating the processing of the jar/test config in
         AddToPropertySet(...) as they may be optimized separately.
      
      6) Ditto for the jar/aidl include dirs.
      
      7) While doing this work I noticed that although the contents of the
         aidl include dirs are copied into the snapshot the java_import does
         not make use of them. Raised bug 151933053 and added TODO to track
         that work.
      
      Bug: 142935992
      Test: m nothing
      Change-Id: Iba9799e111ca5672b2133568163d8c49837ba9cd
      a551a1c2
    • Paul Duffin's avatar
      Make new module creation API more flexible · 3a4eb508
      Paul Duffin authored
      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
      3a4eb508
  3. Mar 21, 2020
  4. Mar 20, 2020
    • Treehugger Robot's avatar
    • Paul Duffin's avatar
      Add abstraction for tracking compile multilib usages · 9c3760eb
      Paul Duffin authored
      Ensures consistent tracking of multilib usages.
      
      Bug: 142935992
      Test: m nothing
      Change-Id: I82ba4a53a21a0823503cb98f7edfde449b48b440
      9c3760eb
    • Paul Duffin's avatar
      Add support for using cc_library in sdk/module_exports · 9b76c0b6
      Paul Duffin authored
      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
      9b76c0b6
    • Martin Stjernholm's avatar
      Merge changes I2ab8f6aa,I53d58100 · 71da478f
      Martin Stjernholm authored
      * changes:
        Add SDK member support for cc_object.
        Add cc_prebuilt_object.
      71da478f
    • Ola Rozenfeld's avatar
      27818b99
    • Patrice Arruda's avatar
      Generate the build_error protobuf file on first build action error. · 85f227ee
      Patrice Arruda authored
      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
      85f227ee
    • Martin Stjernholm's avatar
      Add SDK member support for cc_object. · cd07bce4
      Martin Stjernholm authored
      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
      cd07bce4
    • Martin Stjernholm's avatar
      Add cc_prebuilt_object. · 0b92ac8e
      Martin Stjernholm authored
      To be used for prebuilt object support in SDK snapshots.
      
      Test: m nothing
      Bug: 148934017
      Change-Id: I53d58100cc1d410c5cf5b7906de7ed6f7add2035
      0b92ac8e
    • Ola Rozenfeld's avatar
      Migrating RBE flags to RBE_ variables. · 3992e375
      Ola Rozenfeld authored
      Test: N/A, this only adds new variables.
      
      Change-Id: Iad09352090ec255af82e77941e6e050137f1e83b
      3992e375
  5. Mar 19, 2020
  6. Mar 18, 2020
Loading