Commit graph

20183 commits

Author SHA1 Message Date
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
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
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
Yi Kong
e6a9e64f70 Add platform-wide sampling PGO option
This causes the compiler to emit some additional debug infomation that
will be used for sampling PGO. These debug infomation will get stripped
so it only affects intermediate files.

Test: build
Bug: 79161490
Bug: 153039105
Change-Id: Ie4d1d5ffbd311ba6e268cb94a618f5272be246ef
Merged-In: Ie4d1d5ffbd311ba6e268cb94a618f5272be246ef
(cherry picked from commit ceb5b76c91)
2020-04-03 12:00:04 +00:00
Vladimir Marko
b92ae27ca0 Add file with updatable BCP packages to /system/etc/
Make `permitted_packages` mandatory for updatable boot class
path jars. Collect the permitted_packages from those jars to
a file installed as /system/etc/updatable_bcp_packages.txt .

(cherry picked from commit 205e6c2a15)

Test: aosp_taimen-userdebug boots.
Test: adb shell cat /system/etc/updatable-bcp-packages
Test: Manual, remove permitted_packages from framework-tethering,
      build fails.
Bug: 151314205
Merged-In: I21def97ace9081e707910d449943c683189f16cf
Change-Id: I68486f0d8d3368636e1a5324321bd0106fbe241a
2020-04-03 11:26:19 +01:00
David Srbecky
163bda65fd 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.

(cherry picked from commit c177ebeca9)

Test: m
Bug: 152037801
Merged-In: Iea73c77367affb074f97a0fc318389417ce537da
Change-Id: I8b95882bb00cd2fd1f6cfd8a2784f9ebb957eec6
2020-04-03 11:25:13 +01:00
Bill Peckham
39ea894335 Merge "Include partition tag in apexkeys.txt." into rvc-dev 2020-04-03 01:04:50 +00:00
Dan Willemsen
2071132e99 Fix long mac test times; only initialize host settings once
It looks like sometime in late February our Mac builds started taking
~10 minutes longer than before. On my local workstation the Soong tests
were taking >25 minutes before completing (likely because I don't have
the older SDKs installed, and we iterate from older to newer to find the
oldest installed SDK).

Most of this time was spend running the `xcrun` tools to interrogate the
system about which Mac SDKs are installed and where the tools are. This
will never change during any build or test, so wrap it all in a
sync.Once so that we only ever call them once.

And remove the macSdkPath variable, which has been unused for years and
no longer works (as we don't allow the use of xcode-select during the
build).

Bug: 153010389
Test: prebuilts/build-tools/build-prebuilts.sh on a Mac
Change-Id: I39b2d49739e628e4c11bec4805b25039115d2fd0
Merged-In: I39b2d49739e628e4c11bec4805b25039115d2fd0
(cherry picked from commit 6ba5367a70)
2020-04-02 14:53:36 -07:00
Bill Peckham
1c610cfed1 Include partition tag in apexkeys.txt.
The partition tag helps merge_target_files.py determine
which apexkeys.txt to select from the framework partial
target files and which to select from the vendor partial
target files. The partition tag is the pysical partition
name, for example, a system_ext module on a device where
system_ext is at system/system_ext has a system
partition tag.

Bug: 138942268
Change-Id: Ia07887b34f1aa77dae94ef23610dfef83c1a5849
Merged-In: Ia07887b34f1aa77dae94ef23610dfef83c1a5849
2020-04-02 17:15:47 +00:00
Jooyung Han
29e91d2121 Apex: support codenames for min_sdk_version
Apex can use codenames like "Q", "R" for its min_sdk_version property.
Also, cc_library can use codenames for its stubs.versions.

Bug: 152655956
Test: vendor/google/build/build_mainline_modules.sh
Change-Id: I077ad7b2ac5d90b4c8708921e43846206f05ba70
2020-04-02 23:26:41 +09:00
Anton Hansson
66e365565f Merge "Remove neverallow rules for framework-mediaprovider" into rvc-dev 2020-04-02 11:07:17 +00:00
Jooyung Han
42d7718086 Merge "Enforce apex.min_sdk_version for bundled builds" into rvc-dev 2020-04-01 15:37:23 +00:00
Artur Satayev
0f9e77362c Merge "Use modular removed-dex.txt files for greylisting." into rvc-dev 2020-04-01 13:07:41 +00:00
Anton Hansson
cd4c32e556 Merge "Always keep rsp files" into rvc-dev 2020-04-01 09:53:02 +00:00
Dan Shi
91847d895d Merge "Merge "Rename VTS to VTS10" am: 7182c45fe7 am: 4058983c0c am: 8989420fee am: 2d2a3643f5" into rvc-dev 2020-04-01 04:31:32 +00:00
Hsin-Yi Chen
1422d6d13d Merge "Fix the logic for selecting ABI dump paths" into rvc-dev 2020-04-01 04:02:03 +00:00
Dan Shi
1a9a9127b1 Merge "Rename VTS to VTS10" am: 7182c45fe7 am: 4058983c0c am: 8989420fee am: 2d2a3643f5
Bug: 151896491
Test: none

Change-Id: Iee9324c4edefef56171ecfac64fd11a9595e5f7c
Merged-In: Iadad4ba96bf9a7f3b1d12c9d4eeb90fb1ed0841d
Merged-In: Iee9324c4edefef56171ecfac64fd11a9595e5f7c
(cherry picked from commit ee3ec387b0)
2020-03-31 23:20:53 +00:00
Anton Hansson
a5cb6fe9bb Remove neverallow rules for framework-mediaprovider
We actually want some targets (in particular, the MediaProvider apk)
to link against framework-mediaprovider.

The gist of what the neverallow rule achieves (disallow general use)
is achieved equally well with visibility rules, which
framework-mediaprovider already has.

Bug: 152891096
Test: m nothing
Change-Id: Ic4b0a571985b9ad1dfdd56d45035f224a622700e
2020-03-31 20:37:26 +01:00
Artur Satayev
a8ec55990f Use modular removed-dex.txt files for greylisting.
Use droidstubs for public and system stubs to provide a list of @removed APIs. As these APIs are not present in the stubs, they are not whitelisted / greylised automatically. Keep them on greylist manually.

Bug: 143864733
Test: diff out/soong/hiddenapi/hiddenapi-flags.csv
Change-Id: I4c8e6899fadfdfd1da82f6f453cc92e71aa9b78c
Merged-In: I4c8e6899fadfdfd1da82f6f453cc92e71aa9b78c
Exempt-From-Owner-Approval: clean cherry-pick
(cherry picked from commit c7fb5c9964)
2020-03-31 14:46:39 +00:00
Anton Hansson
b2ed9acc69 Merge "Convert sdk_library to use androidmk Dist" into rvc-dev 2020-03-30 23:25:07 +00:00
Anton Hansson
84dc13b8de Merge "Add a Tag field to dist to dist a tagged output" into rvc-dev 2020-03-30 23:17:15 +00:00
Anton Hansson
6bb8810c8e Convert sdk_library to use androidmk Dist
Reuse the generic Dist support instead of writing
custom mk rules for it. Use the new Tag support to
grab the classes.jar instead of the dexed jar.

Bug: 152618077
Test: m sdk dist
Change-Id: Id893d52cc24b66e6bd900b5062a59f3820000bcd
2020-03-30 14:22:43 +01:00
Anton Hansson
1e65f94a4b Add a Tag field to dist to dist a tagged output
Make java_library support this mode of output, to allow
callers to dist the classes.jar file rather than the dexed
jar file.

Bug: 152618077
Test: followup CL
Change-Id: I5ba6949833a0fbb95376142aec5096ff5f084c00
2020-03-30 13:55:32 +01:00
Dan Willemsen
6d5d8a6d6a Simplify message around nsjail error
We have known problems (docker; distros w/o user namespaces) which mean
that we won't be turning this into a fatal error anytime soon. Also
remove the bug report link, it's not useful to continue getting the same
reports.

Bug: 123210688
Test: treehugger
Change-Id: I271871d68150417ac938f074d3730cad4518e327
Merged-In: I271871d68150417ac938f074d3730cad4518e327
(cherry picked from commit 1871d88e4f)
2020-03-28 18:05:05 +00:00
Jooyung Han
65d8a6262c Build VNDK APEX for VNDK-Lite
For VNDK-Lite devices, which doesn't define BOARD_VNDK_VERSION, VNDK
APEX is built with only VNDK-Sp libraries with core variants.

Bug: 141908078
Bug: 152353068
Bug: 151635128
Test: TH
Change-Id: I0d08d32473368fd158818d4c2c72fc4cfad68ce6
2020-03-27 23:23:32 +09:00
Jaewoong Jung
37ca4a1e0d Add code coverage support to android_app JNI libs.
This is a cherry-pick change.

Test: Built mainline module coverage data
Bug: 152117890
Change-Id: I47bf3e5d6e78c4518729bdb52616e248156d3cec
Merged-In: I47bf3e5d6e78c4518729bdb52616e248156d3cec
2020-03-27 13:06:12 +00:00
Dan Willemsen
706d5f6730 Always keep rsp files
It's painful to debug without these.

Bug: 151160048
Test: do a build; find out -name '*.rsp'
Change-Id: I6fc25095442178c0bcbc1dea444ba51e9259c600
Merged-In: I6fc25095442178c0bcbc1dea444ba51e9259c600
2020-03-27 12:03:30 +00:00
Hsin-Yi Chen
d41fc1895b Fix the logic for selecting ABI dump paths
A library may have both VNDK variant and stubs. getRefAbiDumpFile should
differentiate its vendor and core variants.

Bug: 152277104
Test: Add dumps to platform/ and vndk/ ; make libselinux.vendor libselinux
Change-Id: Iad038cf4cd3eccc3dfbef13fab67da044498ce77
Merged-In: Iad038cf4cd3eccc3dfbef13fab67da044498ce77
(cherry picked from commit 27d235f918)
2020-03-27 16:17:40 +08:00
Jooyung Han
7406660685 Enforce apex.min_sdk_version for bundled builds
Previously, when Q-targeting apexes are bundled-built, they are built
against the latest stubs.

It was because unwinder is linked dynamically in R and APIs are provided
by libc while Q apexes should run on Q where libc doesn't provide those
APIs. To make Q apexes run on Q device, libc++ should be linked with
static unwinder. But, because libc++ with static unwinder may cause problem
on HWASAN build, Q apexes were built against the latest stubs for bundled
build.

However, Q apexes should be built against Q stubs.

Now, only for HWASAN builds, Q apexes are built against the latest stubs
(and native modules are not linked with static unwinder).

Bug: 151912436
Test: TARGET_SANITIZE=hwaddress m
      => Q apexes(media, resolv, ..) are linked with the latest stubs
      m
      => Q apexes are linked with Q stubs,
         and Q apexes' libc++ is linked with static unwinder
Change-Id: If32f1b547e6d93e3955c7521eec8aef5851f908c
2020-03-27 02:58:20 +09:00
Songchun Fan
0ed9a7d674 Merge "[soong] new field in Android.bp to request APK signing V4" into rvc-dev 2020-03-26 17:48:20 +00:00
Songchun Fan
688de9af5d [soong] new field in Android.bp to request APK signing V4
If "v4_signature: true" is set, the v4 signature file,
named [outputApkFile].idsig
will be generated along side the outputApkFile.

Test: m nothing
Test: atest PackageManagerShellCommandIncrementalTest
BUG: 149354175
Change-Id: Ie84725a15406f96f65042ea9909460e4eb34d57f
2020-03-25 17:12:20 -07:00
Jooyung Han
c3e9263d7e Pass min_sdk_version to cc __ANDROID_SDK_VERSION__
The macro is required only for apex variants regardless of useVndk.
Before the enforcement of LLNDK sdk version, the macro was not passed to
vendor variants.

Bug: 151689896
Test: TARGET_BUILD_APPS=com.android.media.swcodec m
      libbase in swcodec apex is linked with liblog#29
      (compiled with __ANDROID_SDK_VERSIO__=29)

Merged-In: I57fa4afe027eb39b98bd94d534be9ebe11713f19
Change-Id: I57fa4afe027eb39b98bd94d534be9ebe11713f19
(cherry picked from commit 24282778ee)

Exempt-From-Owner-Approval: cp from aosp
2020-03-25 23:23:26 +00:00
Jooyung Han
67a96cd7cb Enforce min_sdk_version of apex(use_vendor:true)
Even though use_vendor:true is prohibited, there is media.swcodec apex
which is still use_vendor: true and also needs to support Android10.
(min_sdk_version: 29)

Because LLNDK stubs were provided only for the current VNDK version,
media.swcodec couldn't be built against min_sdk_version: 29.

This change introduces additional versions for LLNDK stubs which are
enforced when an apex with use_vendor: true sets min_sdk_version.

To make things easier, the versions of LLNDK stubs are borrowed from its
implementation libraries.

Bug: 147450930
Bug: 149591522
Test: TARGET_BUILD_APPS=com.android.media.swcodec m
      (with min_sdk_version: 29 set)
      check if liblog/libc/libm/libdl stubs are 29
      check if 29 stubs don't have new symbols.

Merged-In: I79946cbb4da6617138a96d2b254349d3a298e77b
Change-Id: I79946cbb4da6617138a96d2b254349d3a298e77b
(cherry picked from commit 380fc3615c)
2020-03-25 10:40:41 +09:00
Jooyung Han
89124ba39b cc: fix a utility to make C macro name
Use the result of regex.ReplaceAllString()

Bug: 149591522 (not directly related to this)
Test: m (with new unit test)
Merged-In: Ifce07547ccc067f1ee5bd8467c2fb7d7f8387b8e
Change-Id: Ifce07547ccc067f1ee5bd8467c2fb7d7f8387b8e
(cherry picked from commit b04a4997b8)
2020-03-25 10:40:24 +09:00
Ulya Trafimovich
f798c3ec32 Don't append build directory to the output path twice.
Soong already uses build directory as a part of the generated output
path. Besides, trying to append it second time breaks if the build
directory is an absolute path.

Test: frameworks/rs/build_rs.py  (uses absolute build directory path)
Test: walleye-userdebug boots

Bug: 152235239
Change-Id: Ie03c9e688013b9a3e6bc859c936d89c538ded76a
2020-03-24 14:09:43 +00:00
Anton Hansson
b4cf9df628 Merge "Default droiddoc to disting the api txt if there is one" into rvc-dev 2020-03-24 13:49:32 +00:00