Commit graph

288 commits

Author SHA1 Message Date
Artur Satayev
334b51730a Export depsInfo into android package.
Move depsInfo into android for easier sharing with APK code.

Bug: 149622332
Test: m, diff'ing outputs for conscrypt module.
Change-Id: If0ee967d37425540e69b4ce9304229d9f2cd86bd
Merged-In: If0ee967d37425540e69b4ce9304229d9f2cd86bd
Exempt-From-Owner-Approval: cp from aosp
(cherry picked from commit 872a144dca)
2020-05-05 16:19:07 +00:00
satayev
49ad72d4ef Merge changes Ie6568cb8,Ibd521c96 am: 292e7c0721 am: a07f9df5d7
Change-Id: I4dcd1f47b080a71a97db0b10c1ebfc45b8d59bdb
2020-05-05 13:14:14 +00:00
satayev
d82f528fa3 Merge "Export depsInfo into android package." am: 57769e469b am: ed11483aa6
Change-Id: I103c2e1f0eada4b1cd516cc1a24625d680627824
2020-05-05 10:30:28 +00:00
Artur Satayev
480e25b74f Introduce min_sdk_version to deps info.
Bug: 149622332
Test: m
Change-Id: Ie6568cb8a82d5cca9a3dc91b5a068abf4b0632dc
2020-05-04 19:44:28 +01:00
Artur Satayev
a8bd113a69 Introduce flat deps info list.
Compared to full list, flat list drops dependency edges and simply
lists all transitive dependencies for a top-level apex bundle.

Bug: 149622332
Test: m, manually build flatlist

Change-Id: Ibd521c96b7aeab90b95965c1b524e0a0152aaf5a
2020-05-04 18:01:11 +01:00
Artur Satayev
872a144dca Export depsInfo into android package.
Move depsInfo into android for easier sharing with APK code.

Bug: 149622332
Test: m, diff'ing outputs for conscrypt module.
Change-Id: If0ee967d37425540e69b4ce9304229d9f2cd86bd
2020-05-04 18:01:09 +01:00
Dario Freni
ccd4f112b1 Merge "Allow building unsigned APEXs payload for testing." into rvc-dev am: 73b6c98e10
Change-Id: Ie46b70b3125b430f4586fb67ec0868acc7066dfc
2020-04-28 07:33:35 +00:00
Dario Freni
73b6c98e10 Merge "Allow building unsigned APEXs payload for testing." into rvc-dev 2020-04-28 07:13:07 +00:00
Jooyung Han
7e00c13d0e Merge "apex: file_contexts for override_apex flattened" into rvc-dev am: d5c7ad63ec
Change-Id: I75cd5ce07f79f1ea4cee8791ed8cf3c9ddd22c0d
2020-04-28 03:19:19 +00:00
Dario Freni
ca9133907f Allow building unsigned APEXs payload for testing.
Bug: 148447155
Test: built a testing apex with unsigned payload.
Merged-In: I95aa3f11ff1adc1421fcd7ed5a356ee531a0a818
Change-Id: I95aa3f11ff1adc1421fcd7ed5a356ee531a0a818
(cherry picked from commit 98410fd9d6)
2020-04-27 21:02:18 +01:00
Dario Freni
98410fd9d6 Allow building unsigned APEXs payload for testing.
Bug: 148447155
Test: built a testing apex with unsigned payload.
Change-Id: I95aa3f11ff1adc1421fcd7ed5a356ee531a0a818
2020-04-27 20:52:09 +01:00
Jooyung Han
6bfc04369b apex: file_contexts for override_apex flattened
Make-var APEX_FILE_CONTEXTS_INFOS should contain entries for
override_apex modules. Otherwise flattened override_apex modules can't
be correctly labeled.

Bug: 154031888
Test: lunch gsi_gms_arm64-userdebug
      m file_contexts.bin
      check ../file_contexts.bin_intermediates/file_contexts.concat.tmp
      if it contains entries for override_apex
Change-Id: I60fc3da1def0f5fe14cfeef32a4c2a07a65b056e
2020-04-27 22:18:19 +09:00
Paul Duffin
133608f602 Allow walkPayloadDeps visitor to control walk flow
Delegate the responsibility for determining whether the
walkPayloadDeps() should visit a child dependency to its do function.
This is needed to allow the visitor in checkApexAvailability() to avoid
checking the apex_available setting after crossing the APEX boundary.

Bug: 152878661
Bug: 153306490
Test: m droid
Merged-In: If46a2f74b6eca670befc3aeae430650e85542346
Change-Id: If46a2f74b6eca670befc3aeae430650e85542346
2020-04-22 12:51:48 +01:00
Paul Duffin
be5a5be549 Allow walkPayloadDeps visitor to control walk flow
Delegate the responsibility for determining whether the
walkPayloadDeps() should visit a child dependency to its do function.
This is needed to allow the visitor in checkApexAvailability() to avoid
checking the apex_available setting after crossing the APEX boundary.

Bug: 152878661
Test: m droid
Change-Id: If46a2f74b6eca670befc3aeae430650e85542346
2020-04-01 09:30:31 +01:00
Tim Joines
45feb06174 Merge "Revert "Share vdex files in the ART apex between architectures (..."" 2020-03-18 19:46:48 +00:00
Tim Joines
c1ef1bb5cc Revert "Share vdex files in the ART apex between architectures (..."
Revert submission 1254009-vdex-symlinks

Reason for revert: This causing some devices to fail to boot. See b/151836042 for details.
Reverted Changes:
Iced89071b:Expect vdex files in a target-independent director...
Ifbceb8457:Share vdex files in the ART apex between architect...

Change-Id: I5bd88f8e61d442eed921d840c90777a2750ddb16
2020-03-18 18:00:41 +00:00
Ulyana Trafimovich
5d2449efe4 Merge "Share vdex files in the ART apex between architectures (via symlinks)." 2020-03-18 13:46:06 +00:00
Jiyong Park
162e844c40 track static deps when gatherint notices for apex
This change fixes a bug that license info for statically linked
libraries are absent in the merged notice for APEX. The problem was that
we were iterating over the apexFiles list that represents actual files
(not Soong modules) that are included in the APEX. The problem is now
fixed by iterarting the all the modules that directly or indirectly
contribute to the APEX using walkPayloadDeps() function.

Bug: 149455933
Test: m
Merged-In: I38655da62b590b669ab4649815b61a5a8e314154
(cherry picked from commit 9918e1afd7)
Change-Id: I38655da62b590b669ab4649815b61a5a8e314154
2020-03-18 12:45:50 +09:00
Ulya Trafimovich
5b88fe36b5 Share vdex files in the ART apex between architectures (via symlinks).
Test: aosp_walleye-userdebug boots.

Test: Check symlinks to *.vdex files in the ART apex:
$ adb shell 'find /apex/com.android.art -name '*.vdex' | xargs ls -l'
  lrw-r--r-- 1 system system   23 1970-01-01 01:00 /apex/com.android.art/javalib/arm/boot-apache-xml.vdex -> ../boot-apache-xml.vdex
  lrw-r--r-- 1 system system   25 1970-01-01 01:00 /apex/com.android.art/javalib/arm/boot-bouncycastle.vdex -> ../boot-bouncycastle.vdex
  lrw-r--r-- 1 system system   23 1970-01-01 01:00 /apex/com.android.art/javalib/arm/boot-core-icu4j.vdex -> ../boot-core-icu4j.vdex
  lrw-r--r-- 1 system system   24 1970-01-01 01:00 /apex/com.android.art/javalib/arm/boot-core-libart.vdex -> ../boot-core-libart.vdex
  lrw-r--r-- 1 system system   19 1970-01-01 01:00 /apex/com.android.art/javalib/arm/boot-okhttp.vdex -> ../boot-okhttp.vdex
  lrw-r--r-- 1 system system   12 1970-01-01 01:00 /apex/com.android.art/javalib/arm/boot.vdex -> ../boot.vdex
  lrw-r--r-- 1 system system   23 1970-01-01 01:00 /apex/com.android.art/javalib/arm64/boot-apache-xml.vdex -> ../boot-apache-xml.vdex
  lrw-r--r-- 1 system system   25 1970-01-01 01:00 /apex/com.android.art/javalib/arm64/boot-bouncycastle.vdex -> ../boot-bouncycastle.vdex
  lrw-r--r-- 1 system system   23 1970-01-01 01:00 /apex/com.android.art/javalib/arm64/boot-core-icu4j.vdex -> ../boot-core-icu4j.vdex
  lrw-r--r-- 1 system system   24 1970-01-01 01:00 /apex/com.android.art/javalib/arm64/boot-core-libart.vdex -> ../boot-core-libart.vdex
  lrw-r--r-- 1 system system   19 1970-01-01 01:00 /apex/com.android.art/javalib/arm64/boot-okhttp.vdex -> ../boot-okhttp.vdex
  lrw-r--r-- 1 system system   12 1970-01-01 01:00 /apex/com.android.art/javalib/arm64/boot.vdex -> ../boot.vdex
  -rw-r--r-- 1 system system 1229 1970-01-01 01:00 /apex/com.android.art/javalib/boot-apache-xml.vdex
  -rw-r--r-- 1 system system 2043 1970-01-01 01:00 /apex/com.android.art/javalib/boot-bouncycastle.vdex
  -rw-r--r-- 1 system system 2883 1970-01-01 01:00 /apex/com.android.art/javalib/boot-core-icu4j.vdex
  -rw-r--r-- 1 system system  865 1970-01-01 01:00 /apex/com.android.art/javalib/boot-core-libart.vdex
  -rw-r--r-- 1 system system  395 1970-01-01 01:00 /apex/com.android.art/javalib/boot-okhttp.vdex
  -rw-r--r-- 1 system system 7125 1970-01-01 01:00 /apex/com.android.art/javalib/boot.vdex

Bug: 150934453

Change-Id: Ifbceb845749f4c218693f4118e8b35b59ff26de1
2020-03-17 13:36:06 +00:00
Jiyong Park
9918e1afd7 track static deps when gatherint notices for apex
This change fixes a bug that license info for statically linked
libraries are absent in the merged notice for APEX. The problem was that
we were iterating over the apexFiles list that represents actual files
(not Soong modules) that are included in the APEX. The problem is now
fixed by iterarting the all the modules that directly or indirectly
contribute to the APEX using walkPayloadDeps() function.

Bug: 149455933
Test: m
Change-Id: I38655da62b590b669ab4649815b61a5a8e314154
2020-03-17 19:16:40 +09:00
Baligh Uddin
cb6aa122d8 Allow for overriding container packagename for an Apex.
Test: go test ./... -test.v -run TestOverrideApex
BUG: 148198056
Merged-In: If49042a7acbf9f0dcb505664863d97805902e459
Change-Id: If49042a7acbf9f0dcb505664863d97805902e459
2020-03-16 16:41:11 -07:00
Baligh Uddin
c822818147 Merge "Allow for overriding container packagename for an Apex." 2020-03-16 23:07:31 +00:00
Baligh Uddin
5b57dbad86 Allow for overriding container packagename for an Apex.
Test: go test ./... -test.v -run TestOverrideApex
BUG: 148198056
Change-Id: If49042a7acbf9f0dcb505664863d97805902e459
2020-03-16 12:38:06 -07:00
Jooyung Han
23b0adf4ce apex: Deprecate legacy_android10_support prop
min_sdk_version = 29 implies that the module should support Android10.

Bug: 150431944
Test: m
Merged-In: Iad90a239898f59456900ae7816b90379b1b43406
Change-Id: Iad90a239898f59456900ae7816b90379b1b43406
(cherry picked from commit 5417f775e5)

Exempt-From-Owner-Approval: cp from aosp
2020-03-16 10:57:51 +00:00
Jooyung Han
5417f775e5 apex: Deprecate legacy_android10_support prop
min_sdk_version = 29 implies that the module should support Android10.

Bug: 150431944
Test: m
Change-Id: Iad90a239898f59456900ae7816b90379b1b43406
2020-03-14 16:03:24 +09:00
Dario Freni
da1aefe44e Pass apex_build_info to bundle base.zip file
Fix: 150077028
Test: manual inspection of com.android.wifi-base.zip
Merged-In: Id201a3410a46e0c88a77e6f88e5b85906c7a6c8b
Change-Id: Id201a3410a46e0c88a77e6f88e5b85906c7a6c8b
(cherry picked from commit 18423788cb)
2020-03-14 06:58:46 +00:00
Nikita Ioffe
1f4f345156 Always use "${codename}.${sha}" if UNBUNDLED_BUILD_TARGET_SDK_WITH_API_FINGERPRINT=true
Test: m checkbuild
Bug: 149733822
Change-Id: I3e1beeb721f7e87bc6adda61861fa962ec892360
Merged-In: I3e1beeb721f7e87bc6adda61861fa962ec892360
(cherry picked from commit 934c4f2acc)
2020-03-04 22:05:11 +00:00
Nikita Ioffe
307dd9f4a5 Merge "Always use "${codename}.${sha}" if UNBUNDLED_BUILD_TARGET_SDK_WITH_API_FINGERPRINT=true" into rvc-dev 2020-03-04 21:54:26 +00:00
Jiyong Park
20bacabe0b PRODUCT_MANIFEST_PACKAGE_NAME_OVERRIDES is applicable to override_apex
apex { name: "foo" }
override_apex { name: "override_foo", base:"foo" }

PRODUCT_MANIFEST_PACKAGE_NAME_OVERRIDES := foo:com.android.foo

Previously, the override was done only for the overridden package "foo",
but not for "override_foo". Fixing this issue by using ctx.ModuleName()
when finding the package name to use.

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

Bug: 150645663
Test: m
Merged-In: I2947e5c75369216a4bbce8749503236be86771c3
(cherry picked from commit a519c54dd3)
Change-Id: I2947e5c75369216a4bbce8749503236be86771c3
2020-03-04 12:03:59 +09:00
Jiyong Park
e95000a35e Merge "PRODUCT_MANIFEST_PACKAGE_NAME_OVERRIDES is applicable to override_apex" into rvc-dev 2020-03-04 02:50:48 +00:00
Nikita Ioffe
934c4f2acc Always use "${codename}.${sha}" if UNBUNDLED_BUILD_TARGET_SDK_WITH_API_FINGERPRINT=true
Test: m checkbuild
Test: DIST_DIR=/tmp/r-on-q/prod/ TARGET_BUILD_VARIANT=userdebug \
  vendor/google/build/build_mainline_modules_prod.sh -j120
Test: DIST_DIR=/tmp/r-on-q/rsha/ TARGET_BUILD_VARIANT=userdebug \
  vendor/google/build/build_mainline_modules.sh -j120
Test: checked target sdk version is correct for both builds
Bug: 149733822
Change-Id: I3e1beeb721f7e87bc6adda61861fa962ec892360
2020-03-03 12:06:30 +00:00
Jiyong Park
a519c54dd3 PRODUCT_MANIFEST_PACKAGE_NAME_OVERRIDES is applicable to override_apex
apex { name: "foo" }
override_apex { name: "override_foo", base:"foo" }

PRODUCT_MANIFEST_PACKAGE_NAME_OVERRIDES := foo:com.android.foo

Previously, the override was done only for the overridden package "foo",
but not for "override_foo". Fixing this issue by using ctx.ModuleName()
when finding the package name to use.

Bug: 150645663
Test: m
Change-Id: I2947e5c75369216a4bbce8749503236be86771c3
2020-03-03 11:45:41 +09:00
Dario Freni
18423788cb Pass apex_build_info to bundle base.zip file
Fix: 150077028
Test: manual inspection of com.android.wifi-base.zip
Change-Id: Id201a3410a46e0c88a77e6f88e5b85906c7a6c8b
2020-03-02 22:31:01 +00:00
Jiyong Park
af8998cba6 bundle config contains (path,manifest) pairs of embedded APKs
If an APEX contains APKs and the manifest package name of the APKs are
overridden (either via override_android_app
orPRODUCT_MANIFEST_PACKAGE_NAME_OVERRIDES), that the path to the APK
(relative in the APEX) and the overridden manifest package name is
recorded in the bundle config file.

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

Bug: 148002117
Test: m

Merged-In: Ibb90bcefb77fa6b2dad77cb2facc6079de9ab154
(cherry picked from commit cfaa1643e8)
Change-Id: Ibb90bcefb77fa6b2dad77cb2facc6079de9ab154
2020-03-01 03:59:11 +00:00
Jiyong Park
d93e1b1e66 bundle config for apexes are auto-generated
bundle config file for apexes are auto-generated. It is included in the
<apex>-base.zip file, which is expected to be extracted and then fed
into the bundletool.

This change is in preparation for the upcoming change to include
information about embedded apks in the bundle confir file.

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

Bug: 148002117
Test: m

Merged-In: If25d75e0f62036dc777faf8593ed8eb9a74950b0
(cherry picked from commit bd15961043)
Change-Id: If25d75e0f62036dc777faf8593ed8eb9a74950b0
2020-03-01 03:56:51 +00:00
Jiyong Park
cfaa1643e8 bundle config contains (path,manifest) pairs of embedded APKs
If an APEX contains APKs and the manifest package name of the APKs are
overridden (either via override_android_app
orPRODUCT_MANIFEST_PACKAGE_NAME_OVERRIDES), that the path to the APK
(relative in the APEX) and the overridden manifest package name is
recorded in the bundle config file.

Bug: 148002117
Test: m

Change-Id: Ibb90bcefb77fa6b2dad77cb2facc6079de9ab154
2020-02-29 09:07:46 +09:00
Jiyong Park
bd15961043 bundle config for apexes are auto-generated
bundle config file for apexes are auto-generated. It is included in the
<apex>-base.zip file, which is expected to be extracted and then fed
into the bundletool.

This change is in preparation for the upcoming change to include
information about embedded apks in the bundle confir file.

Bug: 148002117
Test: m

Change-Id: If25d75e0f62036dc777faf8593ed8eb9a74950b0
2020-02-29 09:07:08 +09:00
Jooyung Han
643adc4896 Add "jni_libs" property to apex module
Which is the list of JNI libraries that are embeded inside the apex.
jni_libs is handled just like native_shared_libs except that it is
stored in apex_manifest.

When linkerconfig finds an apex with JNI libs, it exposes the namespace
for the apex as visible so that libnativeloader can link the namespace
to the corresponding classloader-namespace.

Bug: 149363889
Test: m nothing(runs soong test)
Change-Id: I52ebe38b44545e6e8853e34a3404a235c858112a
2020-02-27 13:50:06 +09:00
Bob Badour
40017be1c3 Merge "Unless overridden include LICENSE files in notices." 2020-02-26 20:37:22 +00:00
Nikita Ioffe
5d600c9169 For legacy10 APEXes default target_sdk_version and min_sdk_version to 29
Test: m com.android.conscrypt
Bug: 149733822
Change-Id: Ia863b5701716ef4022b470ee758368ea4fffb1d4
Merged-In: Ia863b5701716ef4022b470ee758368ea4fffb1d4
(cherry picked from commit db10c13bdf)
2020-02-22 17:33:28 +00:00
Bob Badour
a75b057e17 Unless overridden include LICENSE files in notices.
As a second step to removing the go/android3p instructions to copy or
to link NOTICE to LICENSE, include LICENSE files in the notices, which
will allow deleting all of the copied/linked NOTICE files.

The change causes a few additions to the system image notice files.

Test: manually built and compared before and after notices
Change-Id: Ia7bc58e2eba7bed5e63934881b5298201a93bc3e
2020-02-21 20:40:43 +00:00
Automerger Merge Worker
f9c738d084 Allow for setting a logging_parent for an Apex. am: 004d717158 am: f4fa3fe81e am: 833162725c
Change-Id: Ifa85d785453e5e363b4b374ce0ea1d12963cafbb
2020-02-21 18:05:12 +00:00
Baligh Uddin
004d717158 Allow for setting a logging_parent for an Apex.
Test: go test ./... -test.v -run TestOverrideApex
BUG: 148198056
Change-Id: Ib3749e59f5e31903f2dbe75f86534738147a55ec
2020-02-21 16:59:26 +00:00
Nikita Ioffe
db10c13bdf For Q APEXes default target_sdk_version and min_sdk_version to 29
This will allow installing Q launched APEXes built from master on Q
devices.

Test: m com.android.conscrypt
Test: see another CL in topic
Test: lunch blueline-userdebug
Test: TARGET_BUILD_APPS=com.android.resolv m
Test: installed on Q blueline, verified installation succeeded
Bug: 149733822
Change-Id: Ia863b5701716ef4022b470ee758368ea4fffb1d4
2020-02-20 13:34:01 +00:00
Jiyong Park
2bb26d3fad Merge "<apex_name>-deps-info correctly tracks dependencies" 2020-02-12 00:47:21 +00:00
Jiyong Park
bd63a108a0 <apexname>-installed-file.txt shows symlinks
Bug: 147605944
Test: m and inspect the generated txt files
Change-Id: I26ecaf66a531478d22fb4611bb4ea19e92ef132e
2020-02-08 17:18:03 +09:00
Jiyong Park
678c881a4f <apex_name>-deps-info correctly tracks dependencies
The APEX dependency is more correctly tracked. Previously, the
dependency was tracked while we gather modules that will be installed to
an APEX. This actually was incorrect because we skipped many dependency
types that we don't need to follow to gather the modules list, such as
the headers dependency.

Now, the dependency is tracked directly when a module is mutated for an
APEX. In other words, if a module is mutated for an apex X, then the
module will appear in the X-deps-into.txt file.

This change also changes the format of the txt file. It now clearly
shows why a module is included in the APEX by showing the list of
modules that depend on the module.

Bug: 146323213
Test: m
Change-Id: I0a70cf9cce56e36565f9d55683fdaace8748a081
2020-02-07 18:53:12 +09:00
Jiyong Park
a594801999 Don't use apexName where apexBundleName is expected
With I63f8a1de463011c6e0b97f5f6eee83103e22bc30, a flattened APEX is
installed to /system/apex/<apexBundleName> not /system/apex/<apexName>.
The change was to be in sync with the non-flattened APEXes that are
installed to /system/apex/<apexBundleName>.apex.

apexName is from the 'name' property while apexBundleName is from the
'apex_name' property. The two names are mostly the same, but can be
different, notably for the ART and the VNDK APEXes. e,g apexName =
com.android.art, apexBundleName = com.android.art.release.

However, there was a bug in the fix; we haven't updated the path for the
flattened APEXes in other places: filecontexts and symlinks. As a
result, the files for the APEXes where apexName is different from
apexBundleName were incorrectly labeled and caused a boot loop.

Fixing the bug.

Bug: 140136207
Bug: 149013536
Test: m
Test: OVERRIDE_TARGET_FLATTEN_APEX=true m; then inspect the built
system.img to verify that
/system/apex/com.android.vndk.current/lib/libcrypto.so is correctly
labeled as system_lib_file.

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

Merged-In: I4aaf674a5daeabab5ed6e7025c5389821ee9a013
(cherry picked from commit be95e6b245)
Change-Id: I4aaf674a5daeabab5ed6e7025c5389821ee9a013
2020-02-07 13:20:13 +09:00
Treehugger Robot
70b0162472 Merge "Fix rebuilding with whitelisted_files" 2020-01-29 01:54:06 +00:00
Dan Willemsen
81e43c5994 Fix rebuilding with whitelisted_files
All commands must produce their output files, or they'll trigger
rebuilds the next build.

Test: m com.android.apex.cts.shim.v3; repeat; "ninja: nothing to do"
Change-Id: If30e9d90ce3efc0689cd04ac62cc8207f3a38dd5
2020-01-28 15:40:19 -08:00
Jiyong Park
19972c7935 License info for APEXes are correctly gathered
This change fixes a bug that license info for non-flattened APEXes are
not captured in /system/etc/NOTICE.xml.gz file. For non-flatted APEXes,
we have been creating NOTICE.html.gz file by concatenating all the
license infos of the modules that contributes to the APEX and embedding
the file into the asset directory of the APEX. Then at runtime, the info
is shown through the "Google Play System Update Licenses" UI. However,
this was problematic because the UI only shows license info for the
Google-signed APEXes, leaving OEM-signed APEXes (a.k.a. optional
modules).

The problem is now fixed by associating a merged license file with each
APEX and exporting them to Make, so that the merged license files are
included in the partition level /system/etc/NOTICE.xml.gz file
regardless of whether the APEX is a Google-signed one or not.

This also fixes a bug that license info entries are created for the
runtime paths /apex/<apex_name>/<path_to_a_file>, which is not necessary
as they are already included in the license info of the containing APEX.

Bug: N/A
Test: Go to Settings->About Phone->Legal information and check
that a) /system/apex/*.apex files are shown and b) /apex/<apex_name>/*
files are not shown

Change-Id: I2c25c803b6a4c39b24bb3f724502699382fab50c
2020-01-28 17:20:45 +00:00
Baligh Uddin
cf0bba7a30 Merge "Revert "Revert "Allow codename.fingerprint format for minSdkVersion""" 2020-01-25 04:12:30 +00:00
Baligh Uddin
f62013736a Revert "Revert "Allow codename.fingerprint format for minSdkVersion""
This reverts commit 230e241f58.

Reason for revert: This is a revert of a revert.  Downstream problem has been fixed and have been validated locally and via Forrest build.

Change-Id: I89c51d25b3adb818ea44a983d0ac681a88790d8c
2020-01-24 23:15:44 +00:00
Pete Gillin
230e241f58 Revert "Allow codename.fingerprint format for minSdkVersion"
This reverts commit 014a85712d.

Reason for revert: Caused vendor/google/build/build_mainline_modules.sh to fail with `Error: minSdkVersion (10000) is greater than maxSdkVersion (30)`.

Bug: 130541924
Change-Id: Ifa233bf40a674481d21b61ee816c5fdde8201080
2020-01-21 13:44:50 +00:00
Baligh Uddin
014a85712d Allow codename.fingerprint format for minSdkVersion
Use codename.fingerprint format for minSdkVersion if it is unset
in the manifest and
UNBUNDLED_BUILD_TARGET_SDK_WITH_API_FINGERPRINT=true.

Using a utility function in sdk.go to check whether to apply
api.fingerprint.

BUG: 130541924
Change-Id: I748a25c419033bf54b63171d334644fcd0ecc78f
2020-01-20 07:46:12 -08:00
Jiyong Park
7cd10e3908 Reland "use symlink for bundled APEX"
This reverts commit 31c65d4fe4.

Bug: 144533348

Test: checkout master-art-host and run
ALLOW_MISSING_DEPENDENCIES=true DIST_DIR=out/dist /art/tools/dist_linux_bionic.sh -j80 com.android.art.host
the result is successful

Change-Id: Ica11eec9b64867088b16720a41c6d83905976ec5
2020-01-20 15:13:31 +09:00
Treehugger Robot
9c121cd7f3 Merge "Include the hashtree in Q-launched modules." 2020-01-16 12:27:47 +00:00
Treehugger Robot
8122cf6d09 Merge "List of installed files for each APEX is dist'ed" 2020-01-16 06:38:11 +00:00
Dario Freni
e354690448 Include the hashtree in Q-launched modules.
For post-Q modules, we can avoid building the hashtree also in the
unbundled build case, since the device will regenerate the hashtree
locally. This CL simplifies the logic so that the build rules apply
regardless of the build being bundled or unbundled -- after all, bundled
build are only really valid for development purposes.

Fix: 147600151
Test: unit test;
m com.android.conscrypt and manual inspection of apexer invocation
(option no_hashtree not present)
m com.android.neuralnetworks and manual inspection of apexer invocation
(option no_hashtree present)

Change-Id: Ib4cc6149d3beac5df7e23a65a3b7ee6b0d68e395
2020-01-14 23:59:02 +00:00
Jiyong Park
83dc74b770 Reland^2 "m <apex_name>-deps-info prints the internal/external deps of the APEX"
This reverts commit 7cb4d378e7.

Test: m
Test: ALLOW_MISSING_DEPENDENCIES=true DIST_DIR=out/dist ./art/tools/dist_linux_bionic.sh -j80 com.android.art.host
(in the master-art-host branch)

Change-Id: I9beca73aafdf42f03bfa19cf1634b2641dac417b
2020-01-14 18:40:56 +09:00
Jiyong Park
7cb4d378e7 Revert "Reland "m <apex_name>-deps-info prints the internal/external deps of the APEX"""
This reverts commit 956305c61c.

Reason for revert: broke master-art-host branch
Exempt-From-Owner-Approval: reverting a bad change

Change-Id: Id7faed4ee85328c7c65847a3543ea9e67a3d50b3
2020-01-14 08:58:02 +00:00
Jiyong Park
3a1602e7f2 List of installed files for each APEX is dist'ed
For each APEX, <apexname>-installed-files.txt is dist'ed to show the
list of files and their sizes that are included in the APEX.

Bug: 147605944
Test: m dist and examine the txt files

Change-Id: I565479523e51280fc88d5fbf8ea3f48ac0ae9fee
2020-01-14 15:20:57 +09:00
Jiyong Park
956305c61c Reland "m <apex_name>-deps-info prints the internal/external deps of the APEX""
This reverts commit 4513f703f9.

Bug: 1190898
Test: m
Test: EMMA_INSTRUMENT=true EMMA_INSTRUMENT_FRAMEWORK=true NATIVE_COVERAGE=true  m dist

Change-Id: I50fdccabb43e4751694db83ee451d388657257e0
2020-01-09 18:42:27 +09:00
Jiyong Park
8ea6bc4a05 Merge "Revert "m <apex_name>-deps-info prints the internal/external deps of the APEX"" 2020-01-09 02:20:42 +00:00
Jiyong Park
4513f703f9 Revert "m <apex_name>-deps-info prints the internal/external deps of the APEX"
This reverts commit 114ff53f5e.

Reason for revert: broke cf_x86_phone-userdebug_coverage 

Change-Id: I7221fd0b0baee5407a7322240c170aef8e549e4d
2020-01-09 02:05:18 +00:00
Treehugger Robot
573326a8ce Merge "m <apex_name>-deps-info prints the internal/external deps of the APEX" 2020-01-09 00:44:13 +00:00
Dario Freni
f4b13d4103 Merge "Add --include_build_info flag to apexer invocation." 2020-01-03 17:50:47 +00:00
Nikita Ioffe
b4b44c0be2 Whitelist system/apex/shim/build to use test_only_no_hashtree property
It will be used to build a shim apex with zeroed hashtree for use in CTS
tests.

Test: builds
Bug: 145670581
Change-Id: I6f84850fefb3b58a1c2e8328242920d64a61e733
2020-01-02 23:01:39 +00:00
Dario Freni
0f4ae078be Add --include_build_info flag to apexer invocation.
Bug: 144477678
Test: verified that apex_build_info.pb is populated and included in the
final apex.
Change-Id: Iecbc2a68a82595eee32aaa26d11a7253daf89f69
2020-01-02 19:45:31 +00:00
Jiyong Park
114ff53f5e m <apex_name>-deps-info prints the internal/external deps of the APEX
We need to have a way to see the list of modules that directly or
indirectly contribute to an APEX. People find it difficult to determine
whether a module is included in which APEXes because APEX tracks
indirect dependencies as well as direct dependencies. Therefore, just
looking at Android.bp for the APEX itself doesn't give the answer.

This change adds a new make target <apex_name>-deps-info, which
generates out/soong/<apex_name>-deps-info.txt file that shows the
internal and external dependencies of the said APEX.
Here, internal means the dependencies are actually part of the
APEX, while external means the dependencies are still external to the
APEX.

Bug: 146323213
Test: m (apex_test amended)
Change-Id: I33d1ccf5d1ca335d71cd6ced0f5f66b8c3886d13
2020-01-02 09:41:30 +09:00
Nikita Ioffe
5c3869a7db Remove apex_pubkey from the bundle module
It's not yet supported by bundletool and blocks other testing (see
attached bug).

This is a partial revert of
https://android-review.googlesource.com/c/platform/build/soong/+/1183459/

Test: out/dist/mainline_modules_arm64/com.android.tzdata-base.zip
Test: checked content doesn't have apex_pubkey
Bug: 146460014
Change-Id: I268caa9f9736ba1913145a1ce1065f6f5179a6db
2019-12-18 17:40:21 +00:00
Jooyung Han
405c7ab959 Merge "Override package name for VNDK APEX" 2019-12-18 01:10:36 +00:00
Jooyung Han
27151d93b6 Override package name for VNDK APEX
com.android.vndk.v<VER> is overridden with
com.google.android.vndk.v<VERE>.

Test: m com.android.vndk.current
    && aapt2 dump badging ../system/apex/com.android.vndk.current.apex
Change-Id: I623d7a144418d7198f0bbf09c5dc983ed1a631c6
Merged-In: I623d7a144418d7198f0bbf09c5dc983ed1a631c6
(cherry picked from commit 0ed1b1b169)
2019-12-17 15:22:21 +00:00
Jooyung Han
f121a657c9 Fix apex to override certificate
The rules for apex certificate:
1. <unspecified>: use <default app cerficicate>
2. name: use <default app cerficiate dir>/<name>(.x509.pem|.pk8)
3. :module: use specified by <module>

Certificates can be overridden by PRODUCT_CERTIFICATE_OVERRIDES.

Currently, 1) and 2) aren't overridden by PRODUCT_CERTIFICATE_OVERRIDES,
which should be.

Bug: n/a
Test: m (apex_test.go amended)
Change-Id: Icbdf4979613ef10127ecc02f3debd6a798460532
2019-12-17 15:20:50 +09:00
Jiyong Park
1833ceff09 fix: LOCAL_PATH for modules included in APEX is wrong
This change fixes a bug that LOCAL_PATH for modules included in an APEX
is set to the path of the APEX bundle, not to the path of the embedded
module. For example, LOCAL_PATH of libconscrypt included in
com.android.adbd was set to /system/core/adb instead of
/external/boringssl. This caused a problem that NOTICE file in
/external/boringssl is not tagged to libconscrypt, but the NOTICE file
for adbd is.

Fixing the problem by recording the module directories of the included
modules and emitting it in LOCAL_PATH.

Bug: 145347092
Test: Settings -> About Phone -> Legal Information -> Third-party
license. The license for /apex/com.android.adbd/lib64/libconscrypt.so is
OpenSSL.

Change-Id: I76f1830d5a10af63fa74dcc2a42730ffabb8c4ed
2019-12-16 10:53:44 +09:00
Treehugger Robot
ac68248051 Merge "Add "legacy_android10_support" to "apex"" 2019-12-14 02:07:16 +00:00
Treehugger Robot
90872f1c9c Merge "add apex_pubkey and apex_manifest.pb to the bundle module" 2019-12-13 03:16:31 +00:00
Jooyung Han
214bf37311 Add "legacy_android10_support" to "apex"
APEXes with "legacy_android10_support" will have apex_manifest.json for
compatibility as well as apex_manifest.pb.

Bug: 143951586
Test: m (soong tests)
Change-Id: I019252aee5a9423f4b180ba1026e6e99c9961437
2019-12-13 08:47:16 +09:00
Treehugger Robot
32fc94d097 Merge "Add property to apex soong modules to generate an APEX without hashtree" 2019-12-11 01:51:48 +00:00
Nikita Ioffe
c72b5dd10a Add property to apex soong modules to generate an APEX without hashtree
This will help testing on-device hashtree generation.

Test: see other CL in topic
Bug: 145670581
Change-Id: I96b1b2392302aed8a6e80ed52de2d057a532a288
2019-12-10 11:24:53 +00:00
Treehugger Robot
455e3a089d Merge "Move/dedupe some host path functions in package_ctx.go." 2019-12-09 23:20:16 +00:00
Martin Stjernholm
7260d066ea Move/dedupe some host path functions in package_ctx.go.
These functions don't need a PackageContext object.

Test: m
Bug: 145934348
Change-Id: Ia1da2c76cbad292f9ca79617199b2b5b6b265568
2019-12-09 22:04:21 +00:00
Jiyong Park
53ae334130 add apex_pubkey and apex_manifest.pb to the bundle module
The two were missing.

Bug: 145678884
Test: m out/dist/mainline_modules_arm64/com.android.tzdata-base.zip and
inspect the content

Change-Id: I7e244561f59e5adce56b6a64f363a413faa106f2
2019-12-08 02:06:24 +09:00
Jiyong Park
317645e84c Overridden APEX doesn't contribute to the file contexts
This change fixes the problem that when an apex module is overridden by
another override_apex, the <apex_name>-file_contexts are duplicated when
creating the system-level file-contexts.

Fixing this by not emitting the file_context info for the overridden
apex.

In doing so, OverridableModule interface was extended to have
GetOverriddenBy() method which can be used to test whether a module is
an overridden one or not.

Bug: 144338929
Test: m (apex_test amended)
Test: add "override_apex {name:"com.googlge.android.tzdata",
Change-Id: I5e9401c32899bb9987c90cba4185f571dc1a87f0
base:"com.android.tzdata"}" and the build is successful
2019-12-05 13:25:39 +09:00
Jiyong Park
f653b05d55 Refactor the routine for creating apexFile
This change is to make it easier to add new fields to the struct.
transitiveDep field is added to distinguish apexFiles coming from
transitive dependencies of the APEX. We will later use the info to
reduce the size of bundled APEXes by replacing the transitive deps with
symlinks to the corresponding files in the system partition outside of
the APEX.

Bug: 144533348
Test: m

Change-Id: I283859f2f2f1b5cfb3025569f168ba8569b22bb9
2019-11-30 14:49:13 +09:00
Jaewoong Jung
1670ca0d8b Fix Make modules name conflict for override_apex
When an override_apex named Foo overrides an apex module named Bar, the
Make modules from Foo have Foo as their suffix. Previously the suffix
was Bar for both of the overriding and the overridden APEXes, causing
name conflicts in the Make side.

Bug: 144338929
Test: apex_test.go
Change-Id: I1396910ab294ba5f5e0585af6d37f1eab9460250
2019-11-23 16:20:50 +09:00
Jooyung Han
54aca7b3f3 Make 'file_contexts' prop as android:"path"
For platform APEXes, file_contexts should point a file under
/system/sepolicy.

Bug: 144732805
Test: m
Change-Id: Ib2d5db715bbebc80a6178d1c42e387b268cc4a0d
2019-11-21 22:05:06 +09:00
Jiyong Park
09d77522fe split apex.go
apex.go is too big. Separate the build rule and android.mk generation
logic into builder.go and androidmk.go, respectively. prebuilt_apex is
moved to prebuilt.go as well.

No refactoring has been made other than the splitting.

Test: m
Change-Id: I839ab0a1ba2b70ce82d98ac1fa8e3534808b5fd3
2019-11-18 16:37:06 +09:00