Commit graph

149 commits

Author SHA1 Message Date
Colin Cross
cf371cc1f7 Replace android.WriteFile rule with android.WriteFileRule
The android.WriteFile rule takes careful escaping to produce the
right contents.  Wrap it in an android.WriteFileRule that handles
the escaping.

Test: compare all android.WriteFile outputs
Change-Id: If71a5843af47a37ca61714e1a1ebb32d08536c31
2020-11-14 16:26:00 -08:00
Nikita Ioffe
5335bc471a Propagate min_sdk_version to apexer
This way it will be correctly set in the auto-generated
AndroidManifest.xml.

Bug: 171096530
Bug: 157078772
Test: m
Change-Id: I268f08ca5dd17fa9d6763ad70cc9a3f83891a8d6
Merged-In: I268f08ca5dd17fa9d6763ad70cc9a3f83891a8d6
(cherry picked from commit 97fd49235a)
2020-10-21 14:26:44 +01:00
Jooyung Han
51ce6b0acc Merge "apex: emit file_contexts for flattened apex" 2020-10-06 03:26:14 +00:00
Jooyung Han
7f146c0da1 apex: emit file_contexts for flattened apex
Flattened APEXes are installed in /<partition>/apex/<name>, so its
file_contexts file should be amended accordingly.
For example, file_contexts of an apex "com.android.foo" with should be
modified by prepending actual install path to the path regex.

/bin/foo <sepolicy label>
=> /system/apex/com\.android\.foo/bin/foo <sepolicy label>

File_contexts file is emitted to "make" via LOCAL_FILE_CONTEXTS variable
for apex_manifest.pb module.

Make collects these files and use them to build file_contexts.bin.

Also removed global state which is used to keep the list of all
flattened apexes.

Bug: 166518492
Test: m file_contexts.bin
      check intermediate file_contexts.modules.tmp file
      in $OUT/obj/ETC/file_contexts.bin_intermediates/
Change-Id: I780370b6e576964a5c09f9477f3361f341dd576b
2020-09-23 15:43:39 +00:00
Dan Albert
4f378d75aa Convert more versions in config to ApiLevel.
The test case I removed is invalid. The codename has had its int
assigned, but the config claims it is not final.

If this ever does need to be supported it's just a matter of making
sure the Q -> 29 mapping (or whatever) in the finalized codenames map
in android/api_levels.go.

Test: treehugger
Bug: http://b/154667674
Change-Id: I4f42ec2fd4a37750519ee3937938a1c65b6bb1e8
2020-09-22 16:01:56 -07:00
Dan Albert
c8060536e8 Replace ApiStrToNum uses with ApiLevel.
Test: treehugger
Bug: http://b/154667674
Change-Id: I2954bb21c1cfdeb305f25cfb6c8711c930f6ed50
2020-09-22 15:04:48 -07:00
Xin Li
80dc4f137a Merge "Merge Android R" 2020-09-10 17:22:09 +00:00
Kousik Kumar
3e0b9c031c Merge "Check UseRBE is set before replacing any template with the RE version." 2020-09-10 09:24:17 +00:00
Xin Li
429c23c1fa Merge Android R
Bug: 168057903
Merged-In: I9d5d0da0f409bd6b131f7e0f6363be061d3045c1
Change-Id: Ie7feaf6a3d0787c750de17540969b876a4306b0a
2020-09-09 20:21:02 -07:00
Jiyong Park
41f637d653 Notice files for prebuilt_etc are included in APEX
This change fixes a bug that notice files for some module type (e.g.
prebuilt_etc) were not included in APEX. This happened because we relied
on WalkPayloadDeps which actually doesn't traverse module types that
don't implement ApexModule interface. prebuilt_etc is one such module
type. Fixing the problem by also iterating the filesInfo array which
has info about all modules that are included in the APEX.

Bug: 166575301
Test: m com.android.tzdata and inspect the built artifact.
NOTICE.html.gz is there.

Change-Id: Iceb055b60184aef2a3e65e44680304853eb79a53
2020-09-09 13:19:56 +09:00
Ramy Medhat
16f23a4038 Check UseRBE is set before replacing any template with the RE version.
Test: presubmit
Change-Id: I6df58b4e700f0d231367af2710672d731d20a736
2020-09-03 01:29:49 -04:00
Xin Li
65cb5c69ea Merge Android R (rvc-dev-plus-aosp-without-vendor@6692709)
Bug: 166295507
Merged-In: Ifca7b65f4e27bf14cdc30f72f790b0de90130bae
Change-Id: I3a39be5f0b8736de4822c6a14072c78d4e4ad89d
2020-08-29 01:17:45 -07:00
Nikita Ioffe
a0254b5289 Merge "Add F2FS support for APEX build system" 2020-08-28 21:55:24 +00:00
Theotime Combes
4ba38c1a3f Add F2FS support for APEX build system
Add the new property payload_fs_type in apex module type. Either 'f2fs'
or 'ext4'. Default 'ext4'.

Test: m

Bug: 158453869
Change-Id: I36f373251bd597e11acb62af75437a87e2a531ec
Merged-In: I36f373251bd597e11acb62af75437a87e2a531ec
2020-08-28 12:03:00 +00:00
Jooyung Han
b9007609f6 apex: dedup jni_libs when generating apex_manifest
When we package both 32/62, there could be two instances of the same
library. We need to dedup the list of jni_libs.

Bug: n/a
Test: m com.android.cronet (which uses jni_libs)
      check apex_manifest.pb
Change-Id: I9a9f42f0f5219ab7bc50d945b54113b5d823b7f3
2020-08-28 16:33:16 +09:00
Colin Cross
08dca38eb0 Build transitive lint reports for apex modules
Build and export transitive lint report zips for apex modules.

Bug: 153485543
Test: m TARGET_BUILD_APPS=com.google.android.wifi lint-check dist
Change-Id: I5a1805440452301a7e2c4ca91482b989638b54fb
2020-07-22 20:16:14 -07:00
Liz Kammer
0a51aa2c98 Use RelativeInstallPath for DataPaths in apex
The RelativeInstallPath is currently unused for apexes; however, as it
stands, relative install paths would be handled differently for
flattened and unflattened apexes.

Test: go java test
Test m nothing

Change-Id: Iad9350642cad27c4f745cea6e5fc9e11e7b06ee4
2020-07-21 13:29:37 -07:00
Chris Parsons
216e10a0f6 Install data_libs using relative_install_path property
Test: Added to data_libs tests
Test: Manually verified with bionic-unit-tests
Test: Treehugger
Change-Id: I28a8e08e3409f1e7c7bb72f4351310b57f35f513
2020-07-20 13:59:24 -04:00
Colin Cross
56b330f8e7 Merge "Use unzip -DD" am: b7cea24fe3 am: cae5903677
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1361337

Change-Id: I68b97b33bd19206dfd96aca36bf4575a0bca5459
2020-07-13 06:21:07 +00:00
Colin Cross
d783bbbace Use unzip -DD
We put reproducible timestamps in zip files so that the artifacts
are consistent, but that leads to old timestamps in the output
directory if they are unzipped as part of the build.  Use
unzip -DD when unzipping to update the timestamps.

Bug: 161015009
Test: touch -d 2020-01-01 ref; find $OUT/system -not -newer ref
Change-Id: I70407a627cb070e24be510faa6a774e3d9eae3a8
2020-07-12 05:37:46 +00:00
Treehugger Robot
ab22ca31e9 Merge "apex: add / in file_contexts as system_file" am: fae9e0cf9a am: 062e9afe7e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1351465

Change-Id: I9b4e3f4340b937df93be56867e557e53bb86fa30
2020-07-02 04:41:34 +00:00
Jooyung Han
2dfd54d07e apex: add / in file_contexts as system_file
apex_manifest.pb is added to payload.img by the build system and is
supposed to be read by apexd during activation.

So, / and /apex_manifest.pb should be labeled as "system_file" so
that apexd can read it regardless of how file_contexts is defined.

580eb4fe38 adds /apex_manifest.pb and this
change adds / as well to file_contexts.

Bug: 159767275
Test: add an apex with file_contexts with everything as vendor_file
      apexd should activate the apex.
Change-Id: I827fa3af49ca7f20f3f82fcb16868f60d94d9531
2020-06-29 14:54:22 +09:00
Jooyung Han
7b5284bf33 Merge "apex: add apex_manifest.pb in file_contexts" am: dd85fd89b0 am: 5b811c02e2
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1348942

Change-Id: I558889c69e09e79455b75c4399826fcaab9101fc
2020-06-25 06:54:28 +00:00
Jooyung Han
dd85fd89b0 Merge "apex: add apex_manifest.pb in file_contexts" 2020-06-25 06:21:40 +00:00
Jooyung Han
14135e4c26 Merge "apex/apk: enforce min_sdk_version of all deps" am: 14a08f5b28 am: afdc5239b8
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1287253

Change-Id: I63074e39f5f319789920e55802d4f7934b556e0a
2020-06-25 01:47:24 +00:00
Jooyung Han
580eb4fe38 apex: add apex_manifest.pb in file_contexts
apex_manifest.pb is added to payload.img by the build system and is
supposed to be read by apexd during activation.

So, it should be labeled as "system_file" so that apexd can read it
regardless of how file_contexts is defined.

Bug: 159767275
Test: add an apex with file_contexts with everything as vendor_file
      apexd should activate the apex.
Change-Id: Ie34eb7ad905828976152d67a7dfabf0add0a5de4
2020-06-24 23:00:32 +09:00
Jooyung Han
749dc69af1 apex/apk: enforce min_sdk_version of all deps
Enforce min_sdk_version for every payload dependency of updatable
APEX/APKs.

android.CheckMinSdkVersion() calls ApexModule.ShouldSupportSdkVersion
for every transitive dependency from APEX/APK modules to see if it
meets the min_sdk_version requirements.

The common implementation for apex/android_app is provided in
android/apex.go.

Bug: 145796956
Bug: 152655956
Bug: 153333044
Test: m nothing
Change-Id: I4a947dc94026df7cebd552b6e8ccdb4cc1f67170
2020-06-24 02:00:33 +09:00
Jooyung Han
b365f35fef Merge "apex: make allowed_files prop overridable" into rvc-dev am: d166f79278
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/11931025

Change-Id: I2600c560d596446af255b117abfc07dc1d1f1860
2020-06-22 17:20:52 +00:00
Jooyung Han
938b593887 apex: make allowed_files prop overridable
Because override_apex can modify the contents of the base apex,
allowed_files (which describes the contents) should be overridable.

Bug: 159503079
Bug: 159392784
Bug: 158169437
Test: m (soong test added)
Merged-In: I12744b0465dc3cfc90a66643867e65b4092cd0f7
Change-Id: I12744b0465dc3cfc90a66643867e65b4092cd0f7
(cherry picked from commit faa5399b3f)
2020-06-23 02:10:46 +09:00
Jooyung Han
faa5399b3f apex: make allowed_files prop overridable
Because override_apex can modify the contents of the base apex,
allowed_files (which describes the contents) should be overridable.

Bug: 159503079
Bug: 159392784
Bug: 158169437
Test: m (soong test added)
Change-Id: I12744b0465dc3cfc90a66643867e65b4092cd0f7
2020-06-20 12:56:49 +09:00
Colin Cross
cbd62d07d4 Use inclusive language in Android.bp files
Test: m checkbuild
Change-Id: Id9efbd99be54b191193eae1c5672230ca54cf1d2
Merged-In: Id9efbd99be54b191193eae1c5672230ca54cf1d2
2020-06-16 23:36:51 +00:00
Colin Cross
e8f7f90496 Merge changes from topics "soong-inclusive-language", "soong_inclusive_language2" into rvc-dev am: f4a5492ec9
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/11859399

Change-Id: I1b009faacad99fcbfbf6cd06193f033ea37f6040
2020-06-16 03:43:15 +00:00
Colin Cross
a44a6b27f9 Use inclusive language in Android.bp files
Bug: 158889297
Test: m checkbuild
Change-Id: Id9efbd99be54b191193eae1c5672230ca54cf1d2
2020-06-15 09:46:32 -07:00
Colin Cross
95f7b34e8e Use inclusive language in build/soong
Bug: 158889297
Test: m checkbuild
Change-Id: Id07890b7cbc2397291a658ca00e86b43c743aafc
Merged-In: Id07890b7cbc2397291a658ca00e86b43c743aafc
(cherry picked from commit 440e0d0542)
2020-06-15 09:46:31 -07:00
Colin Cross
973d6813cd manual merge of 2ef16cfcd4 to rvc-dev-plus-aosp
Test: I solemnly swear I tested this conflict resolution.
Bug: None
Change-Id: I768c3fe568fee764cb0b533e73a3fef719adf30c
2020-06-12 17:49:09 -07:00
Colin Cross
440e0d0542 Use inclusive language in build/soong
Test: m checkbuild
Change-Id: Id07890b7cbc2397291a658ca00e86b43c743aafc
2020-06-11 15:33:16 -07:00
Sasha Smundak
c4f0ff1d6c Cherrypick aosp/1318079 and aosp/1324841
Allow apex module to have android_app_set as its constituent.
Fix android_app_set documentation

Fixes: 157166068
Test: treehugger & manual
Change-Id: I9f91f1b761286f489d175eb0772f78f702e8a2d6
Merged-In: I9f91f1b761286f489d175eb0772f78f702e8a2d6
Merged-In: Id9b296d9301902deb463b299413491bc66d58944
2020-06-05 15:39:38 -07:00
Anton Hansson
4ecb0d6bb0 Merge "Use Stem where output file name is expected in APEX" into rvc-dev 2020-06-05 10:05:50 +00:00
Treehugger Robot
dba1360d03 Merge "Allow apex module to have android_app_set as its constituent." am: a5c94e1409 am: 342b4810a7
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1318079

Change-Id: If27ef9b94e59620abcf2ef1179f51c2e5ca9b10f
2020-06-05 06:22:41 +00:00
Sasha Smundak
18d98bc3e0 Allow apex module to have android_app_set as its constituent.
Fixes: 157166068
Test: treehugger & manual
Change-Id: I9f91f1b761286f489d175eb0772f78f702e8a2d6
2020-06-04 20:25:53 -07:00
Jiyong Park
7a12fd11ee Merge "Use Stem where output file name is expected in APEX" am: 0e666433cd am: 611703096e
Change-Id: I94d8f5541deea86310ad3b249b670c61623f3b96
2020-06-01 01:02:03 +00:00
Jiyong Park
0e666433cd Merge "Use Stem where output file name is expected in APEX" 2020-06-01 00:35:48 +00:00
Kousik Kumar
6619d28c15 Merge "Add support for remote-execution / caching of signapk actions" into rvc-dev 2020-05-31 01:10:18 +00:00
Kousik Kumar
15e9d0dbf8 Add support for remote-execution / caching of signapk actions
Test: "RBE_SIGNAPK=true RBE_SIGNAPK_EXEC_STRATEGY=remote ... use_rbe m" on crosshatch-userdebug and
signapk targets worked
Bug: b/156765091

Change-Id: I4b8c21320c2f38914ef39d3d8f036d885fab4e72
Merged-In: I4b8c21320c2f38914ef39d3d8f036d885fab4e72
2020-05-30 19:58:58 +00:00
Jiyong Park
cbe50c7073 Use Stem where output file name is expected in APEX
Bug: 157638999
Test: m
Merged-In: I4a4892bc2941cf1301d210fc3107c02f0e7b13b7
(cherry picked from commit f1493cc0f2)
Change-Id: I4a4892bc2941cf1301d210fc3107c02f0e7b13b7
2020-05-30 21:15:24 +09:00
Jiyong Park
402ace6c25 Notice file embededd in APEX is deterministic
Exempt-From-Owner-Approval: cherry-pick from AOSP

Bug: 157724521
Test: m
Merged-In: I25f6cd9dd0679af6acfc2594314d11fa53ae2151
(cherry picked from commit 33c7736936)
Change-Id: I25f6cd9dd0679af6acfc2594314d11fa53ae2151
2020-05-30 12:11:16 +00:00
Treehugger Robot
94d161a3c7 Merge "Notice file embededd in APEX is deterministic" am: 9980c6e111 am: bd7f948507
Change-Id: I2cf22542513eff83fefef1503954015ffd3be6a9
2020-05-30 08:30:11 +00:00
Jiyong Park
f1493cc0f2 Use Stem where output file name is expected in APEX
Bug: 157638999
Test: m
Change-Id: I4a4892bc2941cf1301d210fc3107c02f0e7b13b7
2020-05-30 13:26:55 +09:00
Jiyong Park
33c7736936 Notice file embededd in APEX is deterministic
Bug: 157724521
Test: m
Change-Id: I25f6cd9dd0679af6acfc2594314d11fa53ae2151
2020-05-29 22:00:16 +09:00
Kousik Kumar
0f5e5c724e Merge "Add support for remote-execution / caching of signapk actions" am: 8f37ec82d9 am: f52d6420ea
Change-Id: I3c51e0ff23903ba101d2029a632f99fc8342c2d9
2020-05-28 19:06:40 +00:00