Commit graph

20366 commits

Author SHA1 Message Date
Jiyong Park
2416c2903e Remove some apex_available whitelist
The marked library(ies) were available to the APEXes via the hand-written
whitelist in build/soong/apex/apex.go. Trying to remove the whitelist
by adding apex_available property to the Android.bp of the libraries.

Exempt-From-Owner-Approval: cherry-pick from AOSP

Bug: 150999716
Test: m
Merged-In: I91d1b1076733a949ca2a959ba640ce34d0233492
(cherry picked from commit 541142ce6b)
Change-Id: I91d1b1076733a949ca2a959ba640ce34d0233492
2020-04-20 16:22:56 +09:00
Anton Hansson
39a06440cd Merge "Remove _API_FILE variables" into rvc-dev 2020-04-19 07:54:27 +00:00
Anton Hansson
336f63cfb2 Remove _API_FILE variables
There are no known usages of these variables, and many have been
incorrectly set for a long time.

Also convert the <module> phony for api txt to androidmk.

Bug: 152479829
Test: m
Change-Id: Iff355041d88eb59ac47dd19a03e993cf1ce3927e
Merged-In: Iff355041d88eb59ac47dd19a03e993cf1ce3927e
2020-04-18 10:15:11 +01:00
Stephen Hines
57a45f1304 Switch to clang-r377782d (10.0.6).
Bug: http://b/153164546
Test: Built aosp_blueline successfully. Kernel also verified without
needing workarounds from LLD crash.

Change-Id: I41ae5a5be0065da98dd941b16196a3f4888b86b1
Merged-In: I41ae5a5be0065da98dd941b16196a3f4888b86b1
(cherry picked from commit 883a0fdfd9)
2020-04-17 17:39:04 -07:00
TreeHugger Robot
5d42863476 Merge "Don't check elf properties of python prebuilts" into rvc-dev 2020-04-16 17:13:33 +00:00
Artur Satayev
735be9a37a Merge "Allow defining neverallow in packages other than android." into rvc-dev 2020-04-16 13:34:40 +00:00
Artur Satayev
0f43edcfc7 Merge "Check updatable APKs compile against managed SDKs." into rvc-dev 2020-04-16 13:34:39 +00:00
Artur Satayev
b39ea9b61c Allow defining neverallow in packages other than android.
This exposes test func on ValueMatcher and helpers relevant for testing neverallows.

Bug: 153333044
Test: m
Change-Id: Ied07cd33afa537f9d7aa3c33e59f4ac985901a0f
Merged-In: Ied07cd33afa537f9d7aa3c33e59f4ac985901a0f
Exempt-From-Owner-Approval: clean cherry-pick
(cherry picked from commit c5570ac9b1)
2020-04-16 13:34:31 +00:00
Artur Satayev
e5ac15a1b7 Check updatable APKs compile against managed SDKs.
As a follow up, this property will be set to APKs participating in mainline program.

Bug: 153333044
Test: m
Change-Id: I6ea2f3c1d26992259e4e9e6a6d8cecf091d39c43
Merged-In: I6ea2f3c1d26992259e4e9e6a6d8cecf091d39c43
(cherry picked from commit 2db1c3f1c4)
Exempt-From-Owner-Approval: clean cherry-pick
2020-04-16 13:34:13 +00:00
Dan Willemsen
cac82fe511 Don't check elf properties of python prebuilts
We're not doing a great job of copying over all the library dependencies (especially when using sanitizer libraries). Just omit these from the checks, which shouldn't really matter.

Bug: 151093572
Test: treehugger
Change-Id: I8470bbfbf36a51739e8a7e699ad090a66c9db8b2
Merged-In: I8470bbfbf36a51739e8a7e699ad090a66c9db8b2
(cherry picked from commit bc32a50ff4)
2020-04-16 00:03:35 -07:00
Anton Hansson
c6fff020f5 Merge "Create a framework.aidl for non-updatable platform" into rvc-dev 2020-04-15 11:13:36 +00:00
Martin Stjernholm
2a6e9d0b01 Fix missing NOTICE targets for static libs that aren't available to
platform.

The NOTICE file generation depends on the NOTICE targets for all static
library dependencies. If such a dependency didn't have
//apex_available:platform it didn't get any AndroidMk entry and hence
no NOTICE target via soong_cc_prebuilt.mk. If it was then depended upon
by a binary or library that is accessible to platform, the NOTICE
dependency failed.

Normally such a dependency is invalid, but there are corner cases where
binaries go neither into platform nor any APEX module, and they can
legitimately have such dependencies (cf. b/152241137).

With this CL requests to skip installation of such a static libraries
are ignored so that they get AndroidMk entries, which will always have
LOCAL_UNINSTALLABLE_MODULE set.

Test: "m simpleperf_ndk" with https://r.android.com/1273016, which
  removes //apex_available:platform from libs that simpleperf_ndk
  depends on statically.
Bug: 152241137
Bug: 149217815
Change-Id: If36e85dd16ade56d4ec1d6744811df5a15b6242c
Merged-In: If36e85dd16ade56d4ec1d6744811df5a15b6242c
2020-04-14 17:09:47 +01:00
TreeHugger Robot
89030a315a Merge "Clean com.android.neuralnetworks APEX whitelist" into rvc-dev 2020-04-14 12:21:42 +00:00
Jooyung Han
84026389e7 apex: remove compat symlinks to vndk apex
For R+, symlinks from /system/lib to VNDK APEX are not necessary. (Note
that, symlinks to older VNDK are still necessary because older vendor
may access old locations.)

Hence, do not make symlinks for R+ VNDK APEX.

Bug: 142911355
Test: m # check /system/lib[64]/ for symlinks
        # cf should contain 28/29 symlinks but no symlinks for R
Change-Id: I852fad7edebed3e4edc03c374b3643da6b053fed
2020-04-14 14:22:31 +09:00
Jiyong Park
be024ad673 Don't allow a lib having stubs to become a member of VNDK
If a lib has stubs, that means the library provides stable C APIs and
the APIs are guaranteed to be maintained in a backwards compatible
manner. Then there is no reason to have the same library in VNDK,
because VNDK is for libraries (usually having C++ interfaces) where API
stability across the yearly releases is hard (or impossible) to be
guaranteed.

This change triggers an error when the build system finds a VNDK lib
which has stubs defined. Users are suggested to make the lib an LLNDK
one.

Exempt-From-Owner-Approval: cherry-pick from AOSP

Bug: 151303316
Test: m
Merged-In: Id305196a9d5a6fc7e7f9c02f3fa076859dc9a282
(cherry picked from commit ea97f51a29)
Change-Id: Id305196a9d5a6fc7e7f9c02f3fa076859dc9a282
2020-04-13 13:08:16 +09:00
TreeHugger Robot
a59774eb49 Merge "soong config: add value_variable substitution" into rvc-dev 2020-04-11 17:24:57 +00:00
TreeHugger Robot
a6ffd8b141 Merge "Make the names of 'soong_config_module_type_import' modules unique." into rvc-dev 2020-04-10 21:09:21 +00:00
Sasha Smundak
227d5675c5 Make the names of 'soong_config_module_type_import' modules unique.
blueprint.writeAllModuleActions attemts to sort modules by name, and
sorting them assumes that each module's name is unique. Although
soong_config_module_type_import modules will not generate anything,
their names should be unique, too for that reason.

Fixes: 150421585
Test: m nothing
Change-Id: I6782e42c129dc3b0fc7649ce97d5f94effc63fa7
Merged-In: I6782e42c129dc3b0fc7649ce97d5f94effc63fa7
2020-04-10 13:54:07 -07:00
Anton Hansson
846101ace0 Merge "Expand neverallow for sdk_version: none" into rvc-dev 2020-04-10 18:53:30 +00:00
Jaewoong Jung
1883126573 Merge "Add libs properties to runtime_resource_overlay." into rvc-dev 2020-04-10 17:41:19 +00:00
Jaewoong Jung
ca095d786a Add libs properties to runtime_resource_overlay.
Test: app_test.go
Test: Converted an existing RRO module.
Bug: 148788111
Change-Id: I723c7175760da019d38893e54f236c45f4c973ea
2020-04-10 07:05:07 -07:00
Anton Hansson
fec6c23734 Expand neverallow for sdk_version: none
Allow the platform stubs to specify sdk_version: none,
and add generic support for a regexp matcher.

Bug: 144149403
Test: m
Change-Id: Icaece0d9797bace8ae9741f7a029b9ea57fcbbb9
Merged-In: Icaece0d9797bace8ae9741f7a029b9ea57fcbbb9
2020-04-10 15:02:35 +01:00
Yi Kong
343eae73b7 Merge "Pass -Brepro ldflag to Windows builds" into rvc-dev 2020-04-10 06:01:03 +00:00
Yi Kong
dd7531160b Pass -Brepro ldflag to Windows builds
The default build-id is generated using timestamp. Pass -Brepro to
avoid using timestamp for deterministic build.

Bug: 153462962
Test: build fastboot.exe twice, got same shasum
Change-Id: I38fe993eec23c60bfcf1b76188774bfe06839fa4
Merged-In: I38fe993eec23c60bfcf1b76188774bfe06839fa4
(cherry picked from commit a3c22e7ee2)
Exempt-From-Owner-Approval: backport
2020-04-10 06:00:49 +00:00
Jooyung Han
c40b5193fe Skip version mutator for host/ramdisk/recovery
"version" mutator creates stubs variants for "cc" libraries with
"stubs.versions". These stubs are for APEX-APEX or APEX-Platform
boundaries.

For host/ramdisk/recovery variants, stubs are not necessary.

Bug: 153698496
Test: m
Change-Id: Id576c4318d9d69246a4a7e2fb4145d5fd2ab9416
2020-04-10 14:30:25 +09:00
TreeHugger Robot
fc5608ec80 Merge "Create prebuilt api modules in load hook not mutator" into rvc-dev 2020-04-09 22:53:23 +00:00
Paul Duffin
47f6315f01 Create prebuilt api modules in load hook not mutator
An attempt to reference one of the prebuilt modules directly from an
Android.bp file highlighted a bug. The prebuilt_apis module used a
mutator to create filegroup and java_import modules for a set of api
versions. That mutator ran after the "prebuilts" mutator which handled
the renaming of prebuilt modules when the matching source module was
not present. That meant that the only way to reference the module was
by explicitly adding the prefix "prebuilt_".

This change fixed that bug by creating the modules in a load hook rather
that a mutator. This ensures that the prebuilt modules are present well
before the "prebuilts" mutator is run. Removing the mutator also removes
an unnecessary traversal of the whole dependency tree.

It also updated the documentation to explain that it creates
java_import modules as well as the filegroup modules.

Bug: 153649372
Test: m droid
Change-Id: Id44dce8ca9968ae903345df6ef1c4f1be9cb76c5
2020-04-09 21:35:53 +01:00
Dan Willemsen
ec8d490d58 soong config: add value_variable substitution
There are some cases that aren't handled with the existing variable
types for booleans or known lists of strings. Similarly to our
product_variables that uses %s / %d for things like
PLATFORM_SDK_VERSION, allow vendors to define their own config variables
to be substituted into properties.

For example, some of the makefiles that I've attempted to convert had
the option to pass in version numbers from the board, or the default
display size:

  -DDISPLAY_VERSION=550
  -DDISP_H=1080

These examples happen to be integers, but since our configuration
language (make) doesn't support numbers, %s works just as well.

This change will allow the above to be represented using:

  soong_config_module_type {
      name: "acme_cc_defaults",
      module_type: "cc_defaults",
      config_namespace: "acme",
      value_variables: [
          "DISPLAY_VERSION",
	  "DISP_H",
      ],
      properties: ["cflags"],
  }

  acme_cc_defaults {
      name: "my_defaults",
      soong_config_variables: {
          DISPLAY_VERSION: {
	      cflags: ["-DDISPLAY_VERSION=%s"],
	  },
	  DISP_H: {
	      cflags: ["-DDISP_H=%s"],
	  }
      },
  }

Bug: 153161144
Test: built-in tests
Change-Id: I18f35746b5cc39c304a136980249e886d38c6df6
Merged-In: I18f35746b5cc39c304a136980249e886d38c6df6
(cherry picked from commit b0935db8c3)
2020-04-09 13:30:38 -07:00
Julien Desprez
0eb91f4e91 Merge "Add support for order-only dependencies to RuleBuilder" into rvc-dev 2020-04-09 18:56:01 +00:00
Julien Desprez
741f48413c Merge "Add an order-only dependency on the build number file" into rvc-dev 2020-04-09 18:56:01 +00:00
Anton Hansson
85c151c3f3 Create a framework.aidl for non-updatable platform
framework.aidl includes the parcelables from the non-updatable
part of the framework as well as the modules. This causes a
dependency cycle when building module stubs:
module_stub -> module_sdk -> framework.aidl -> public_sdk -> module_stub

The module_sdk only includes the the stubs for the non-updatable
part of the framework, so it should also only contain the non-updatable
parcelables. This change creates a framework_non_updatable.aidl with
those parcelables, and updates module_current to use that.

Bug: 144149403
Test: m
Test: m && diff out/soong/framework{,_non_updatable}.aidl
      (the diff contains just TestApi + module parcelables)
Change-Id: I224117a0ff695c22d4a4317a51a9b775ed73066b
2020-04-09 17:45:30 +01:00
Automerger Merge Worker
82f316b8db Add support for order-only dependencies to RuleBuilder
Test: TestRuleBuilder
Change-Id: I1609a790dd4d0a03c8308b6e552622fe33fa2499
Bug: 153071808
Merged-In: Icfa98d6840b1dc2e273ba29c33011635d1cf93b1
2020-04-09 08:17:32 -07:00
Automerger Merge Worker
c372774b1a 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
Bug: 153071808
Merged-In: I1609a790dd4d0a03c8308b6e552622fe33fa2499
2020-04-09 08:16:44 -07:00
Ulya Trafimovich
b4d816e0c4 Relax boot image check to allow platform Jacoco variant in a coverage build.
Test: m nothing
Test: m EMMA_INSTRUMENT=true EMMA_INSTRUMENT_FRAMEWORK=true nothing

Bug: 153533941

Change-Id: I5847ec282f6b481cee61ed9ec6b6928c9a41fae7
Merged-In: I5847ec282f6b481cee61ed9ec6b6928c9a41fae7
(cherry picked from commit e0ce4ba491)
2020-04-09 14:50:44 +01:00
Ulya Trafimovich
cc21bba967 Forbid generating boot image files for jars in updatable modules.
This is to guard against the potential situation when someone adds
updatable modules to the list of boot jars by mistake.

Test: aosp_walleye-userdebug builds.

Test: Manually break the checks and observe the errors:
  - move updatable module 'conscrypt' from
    PRODUCT_UPDATABLE_BOOT_JARS to ART_APEX_JARS:
      internal error: module 'conscrypt' from updatable apex 'com.android.conscrypt' is not allowed in the ART boot image

  - add updatable module 'conscrypt' to ART_APEX_JARS
    (but do not remove it from PRODUCT_UPDATABLE_BOOT_JARS):
      error: A jar in PRODUCT_UPDATABLE_BOOT_JARS must not be in PRODUCT_BOOT_JARS, but conscrypt is.

  - move updatable module 'framework-tethering' from
    PRODUCT_UPDATABLE_BOOT_JARS to PRODUCT_BOOT_JARS:
      internal error: module 'framework-tethering' from updatable apex 'com.android.tethering' is not allowed in the framework boot image

  - add non-updatable (in AOSP) module 'android.net.ipsec.ike'
    to PRODUCT_BOOT_JARS:
      internal error: failed to find a dex jar path for module 'com.android.ipsec.ike', note that some jars may be filtered out by module constraints

Bug: 147579140

Exempt-From-Owner-Approval: cherry-pick, approved in AOSP.

Change-Id: I25ca2f52530fcfa1f9823b2cfa3485db9c0d0db1
Merged-In: I25ca2f52530fcfa1f9823b2cfa3485db9c0d0db1
(cherry picked from commit b28cc3758c)
2020-04-09 14:50:21 +01:00
Jaewoong Jung
aeb9e6ffe8 Merge "Collect JNI coverage data only for first target." into rvc-dev 2020-04-09 04:38:31 +00:00
Jooyung Han
045f3db022 Merge "Remove PLATFORM_VERSION_FUTURE_CODENAMES" into rvc-dev 2020-04-08 23:41:54 +00:00
Jaewoong Jung
e62e594a24 Collect JNI coverage data only for first target.
Modules with compile_multilib property set to "both" cause builds to
fail due to duplicate Make recipes. Fix it by outputting reports only
for the first target for now.

Bug: 153461674
Test: Built cts with the coverage flags set.
Change-Id: Ibb8da6e9c112a857695cd7095a62c910cddfbb94
2020-04-08 16:33:23 -07:00
Jooyung Han
e17caa63a6 Apex: add NeverAllowRule for updatable
to enforce that apexes that set updatable: true also set min_sdk_version

Bug: 152655956
Test: m
Change-Id: I0d2e9f9b3234873de073ab82d91211faedd16498
2020-04-08 05:20:11 +00:00
Jooyung Han
424175d72a Remove PLATFORM_VERSION_FUTURE_CODENAMES
It has been wrong to split ALL_VERSIONS into exclusive two sets of
before/after TARGET_PLATFORM_VERSION.

And PLATFORM_VERSION_ALL_CODENAMES supports all *active* list of
non-finalized codenames.

Bug: 152960049
Test: m
Change-Id: I78ca88758998e440bea72ba2d56d90eea3ec99ae
2020-04-08 09:25:20 +09:00
TreeHugger Robot
ee42b2079d Merge "Support arch variant for data attribute" into rvc-dev 2020-04-07 22:08:45 +00:00
Automerger Merge Worker
0f2c0ad8c3 Support arch variant for data attribute
Bug: 143220441
Test: atest VtsHalDrmV1_2TargetTest
Change-Id: I2381f78b486852da267caa363b4c4cb5660c9055
Merged-In: I2381f78b486852da267caa363b4c4cb5660c9055
2020-04-07 12:52:22 -07:00
Jooyung Han
3978d03fb7 Merge "Build VNDK APEX for VNDK-Lite" into rvc-dev 2020-04-07 16:49:39 +00:00
TreeHugger Robot
cd963fc63b Merge "Use 0777 instead of FileInfo() for dirs." into rvc-dev 2020-04-06 17:12:11 +00:00
Przemysław Szczepaniak
2bce0e8002 Clean com.android.neuralnetworks APEX whitelist
Test: coral-userdebug build
Bug: 148593574
Change-Id: I1babea6c221dec1cd5364250d09f5ea541494942
Merged-In: I1babea6c221dec1cd5364250d09f5ea541494942
2020-04-06 12:05:53 +00:00
Jooyung Han
95148f607e Merge "Apex: support codenames for min_sdk_version" into rvc-dev 2020-04-05 00:14:37 +00:00
Jaewoong Jung
4f5edfc43c Use 0777 instead of FileInfo() for dirs.
Golang's FileInfo() implementation recognizes FAT filesystem directories
correctly, but doesn't actually add executable bits, which essentially
makes them inaccessible. Use 0777 when we know we're dealing with
directories.

Fixes: 153207404
Test: manually tested with an aar file with FAT permission bits.
Change-Id: Ie9f5320bc44d24b2f9d54d4036bb1747456655bb
2020-04-03 19:00:53 -07:00
TreeHugger Robot
909eaf5282 Merge "soong_config: bool_variables shortcut" into rvc-dev 2020-04-03 21:27:22 +00:00
Yi Kong
bc6341b895 Merge "Add platform-wide sampling PGO option" into rvc-dev 2020-04-03 16:52:20 +00:00
Dan Willemsen
1934adc077 soong_config: bool_variables shortcut
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"],
  }

Bug: 153161144
Test: built-in tests
Change-Id: If5455a38433431c7ecbce1e5b32cfbb47f42602a
Merged-In: If5455a38433431c7ecbce1e5b32cfbb47f42602a
(cherry picked from commit 2b8b89cfa2)
2020-04-03 08:57:41 -07:00