summaryrefslogtreecommitdiff
path: root/apex/builder.go
AgeCommit message (Collapse)Author
2023-03-20Update min_sdk_version from SdkSpec to ApiLevel Spandan Das
min_sdk_version signifies device version and does not need an sdkKind to describe it fully. Update the type and cleanup existing usages. As a side benefit, we also get better error handling since users can no longer enter something like `public_30` as a valid min_sdk_version in bp files Will do a similar cleanup for targetSdkVersion and maxSdkVersion in a followup CL Test: m nothing Test: no change in ninja files (this should be a no-op) Bug: 208456999 Change-Id: Ie6ae7e267d093c5e4787e82685daaca1021d202e
2023-03-02Merge "Add apex.use_file_contexts_as_is property" Jooyung Han
2023-02-28Replace SortedStringKeys with SortedKeys Cole Faust
Now that we have generics. Bug: 193460475 Test: presubmits Change-Id: I1594fd8feb505175d5c09c03ef397e5ffd5b09cb
2023-02-28Add apex.use_file_contexts_as_is property Jooyung Han
When set true, use file_contexts file as is and do not force-label / and /apex_manifest.pb Bug: 268439003 Test: m (soong tests) Change-Id: I252eef9569deeac87bb71a3425a8eb07bab3c634
2023-02-17Fix symlinks from APEX to partitions Jiyong Park
Previously, the symlink optimization for APEXes assumed that the target of the symlinks are in the system partition. The assumption however doesn't hold always because the file that was added to the APEX might be with system_ext_specific: true or vendor: true. Bug: 265598720 Test: m nothing Change-Id: Ieb9a6769320c0ec697a88c0cae977e7d65288362
2023-02-09Revert "Revert "Remove apex.apex_name"" Jooyung Han
This reverts commit d1209a89c709af09f82c100e23a743ebdc660622. Reason for revert: apex_name was still in use in the internal/intermediate branch. Fixed(removed apex_name) in the internal branch. Change-Id: I10b8e0cfdb01dcdb6b623bddf9c04f4dac71fc90
2023-02-08Revert "Remove apex.apex_name" Marco Loaiza
This reverts commit df26332d50c9c156b13844b4dbbecb43df6e3e1c. Reason for revert: DroidMonitor-triggered revert due to breakage https://android-build.googleplex.com/builds/quarterdeck?branch=git_tm-qpr-dev-plus-aosp&target=aosp_sunfish-userdebug&lkgb=9578804&lkbb=9579062&fkbb=9578931, bug b/268301897 Change-Id: I819a416286cda63a6fa8d3d6b4343c86638b4dc9 BUG: 268301897
2023-02-08Remove apex.apex_name Jooyung Han
apex_name was used to install symbol files under /apex/<apex name>, which caused duplicate rules when there's two apexes with the same apex_name. (e.g. override_apex or multi-install apexes) Since symbol files can be looked up via ELF Build-Id, we don't have to install symbol files with the actual "apex name", but instead we can install them with soong module name. Bug: 267581665 Test: m (soong test) Change-Id: I1cbe5c86d287f180c7deef93ba85ea5552680011
2023-02-07Remove apex.multi_install_skip_symbol_files Jooyung Han
This has been a workaround to avoid duplicate build rules for multi-install apexes. The reason for duplicate errors was that apex_name was used to install symbol files. We don't need to rely on apex_name for symbol files, hence no need for the workaround. Note that symbol files for apexes are still available via the paths based on "soong module name". Bug: 267581665 Test: cuttlefish (which uses multi-apex) build & run Change-Id: Icaca667e139ef2aca32339a75b54b12a00449c2d
2023-02-07VNDK APEX doesn't use "apex_name" property Jooyung Han
VNDK APEX has been using "apex_name" property to set "name" field in apex_manifest. But setting apex_name had a side-effect of emitting duplicate rules for symbol files for VNDK APEX and its override_apex. (Please see the removed comments for more details about error) Not using "apex_name" fixes the duplicate errors. There're a few more vendor apexes with the same issue, which I will handle in follow-ups. Bug: 267581665 Test: m (soong test) && boot Change-Id: I00f617cef8af4d21880d4e8b9c0b9ab9322ba15c
2023-02-06apexer: remove --do_not_check_keyname Jooyung Han
Since fe4ff29b4d47fa8ae242fb7e084215d3afada4b5 (in system/apex), apexer doesn't check keyname (--key vs --manifest.name). So, passing --do_not_check_keyname doesn't make any sense. This is a preparation to remove (or deprecate) "apex_name" property from "apex" module. Bug: 267581665 Test: m Change-Id: I3737d1e36d305375a523a23a6bbeb2d23586e578
2023-01-27Merge "Support trimmed variant build in soong" Dennis Shen
2023-01-26Support trimmed variant build in soong Dennis Shen
variable.go: add a new product variable TrimmedApex which is controlled by environment variable PRODUCT_TRIMMED_APEX config.go: all config to check if trimmed build is turned on or not apex.go: add overridable apex module property: use_DCLA: <DCLA apex module> "use_DCLA" allows user to just use the lib list in DCLA to determine which native shared libraries to trim. This property is no-op if TrimApexEnabled is set to false. builder.go 1, if it is to produce a trimmed variant, fix the default version code by making the last variant digit to 2. this is only useful in local build. in production build, there is apex manifest injection by coastguard that determines the actual version code. 2, create a new apex rule called: "TrimmedApexRule", this rule invokes an apexer wrapper called apexer_with_trim_preprocessing which will properly trim the target libs. BUG: b/259381334 TEST: adbd banchan build for both static and trimmed variant Change-Id: I38a91cdef86a3c9185d00610ab3dd7acd07fd90a
2023-01-11Sort canned fs_config lines to facilitate comparison with Bazel-built APEXes Sasha Smundak
Bug: 237037156 Test: mixed builds regression testing Change-Id: Ifc9a7b4231c947fe85e77c56ffeb30a2d53df6c4
2023-01-03Use WriteFileRule instead of custom echo commands Cole Faust
These instances could use WriteFileRule instead of making their own shell code to write a file. Test: Presubmits Change-Id: I9c809b2164a68b4ce1c22fbbd0d7497240110b39
2022-12-08Vendor apex sets "vndkVersion" when it uses vndk libs Jooyung Han
Vendor apex with "use_vndk_as_stable:true" sets the dependency in "requireNativeLibs: ":vndk"". But this isn't enough because the APEX won't work if VNDK version mismatches. Now, when a vendor apex uses VNDK libs, "vndkVersion" is set as well in apex_manifest so that apexd can abort the installation/staging when device's VNDK version mimatches. Bug: 222620439 Test: VendorApexHostTestCases Test: built vendor apex how has "vndkVersion" field in its apex_manifest Change-Id: If03340c230efe854ab932cdf472c276f7646ad0c
2022-12-06Add option to override defaultManifestVersion Sahana Rao
Add an option to override defaultManifestVersion using environment variable. The environment variable will be used to override the apex version locally when developing a desert release feature in mainline-prod branch. Overriding the apex version in mainline-prod branch allows us to install apex built in mainline-prod branch to device running code from git_master which has a higher apex version than mainline-prod branch. Bug: b/233608815 Bug: b/196860838 Test: presubmit Test: go test -v ./build/soong/apex/ Change-Id: I8ac2aae2b6b29da7f09db6edb893e0a0f0691e51
2022-11-16Make htmlGzNotice an internal variable instead of apexBundle field. Jingwen Chen
It's not read outside of the function / action generation logic, so keep it inside the function. Test: presubmits Fixes: 190817312 Change-Id: I0626e6c86adc584abb2a251cbc7ffb1bec2c7f59
2022-10-19Install appSet using InstallFileWithExtraFilesZip Jiyong Park
This fixes a bug that only the primary output of an appSet is installed when the appSet is part of a flattened APEX. Bug: 247072627 Test: m GoogleExtServices on a device using flattened APEX. system/apex/com.android.extservices.gms/priv-app/GoogleExtServices@TM has these apks: GoogleExtServices.apk GoogleExtServices-arm64_v8a.apk GoogleExtServices-hdpi.apk GoogleExtServices-ldpi.apk GoogleExtServices-mdpi.apk GoogleExtServices-tvdpi.apk GoogleExtServices-xhdpi.apk GoogleExtServices-xxhdpi.apk GoogleExtServices-xxxhdpi.apk (before the fix, there only was GoogleExtServices.apk) Change-Id: Icbc4dd002f856a3f751badec781ad132c423ac9b
2022-09-29Put base APK when AppSet is included in APEX Jiyong Park
This change fixes a bug that base APK of an AppSet is not put into the APEX. Bug: 236299724 Test: m nothing Change-Id: I1010ec66d8551fcc1e2d9119be7ecdba22186607
2022-09-26Use PackedAdditionalOutputs when reading apk_set for canned_fs_config Jiyong Park
When an app_set module is included in an APEX, we don't use its `builtFile` which is the main APK, , but `PackedAdditionalOutputs()` which is the zip file where all APK files (main + additional) files are packed. We then unzip them into the corresponding directory inside the APEX. However, `buildFile` still has been used when constructing canned_fs_config whose content should match with what are actually included in the APEX. Fixing the bug by using `PackedAdditionalOutputs()` instead. Bug: 236299724 Test: m nothing (apex_test.go amended) Test: follow https://buganizer.corp.google.com/issues/236299724#comment34 * mkdir for-236299724 * cd for-236299724 * repo init -u https://android.googlesource.com/platform/manifest -b * master --partial-clone --clone-filter=blob:none * repo sync -c -j8 * unzip -l ~/Downloads/mainline_t_2022_jun_t1004275.zip | cut -c31- | grep | xargs rm -f * unzip ~/Downloads/mainline_t_2022_jun_t1004275.zip * source build/envsetup.sh * choosecombo 1 aosp_arm64 userdebug * m com.android.extservices.gms Change-Id: If9752c07748300dbb963568de4e879b041b0a206
2022-08-18Place native shared libs for soong build DCLA. Dennis Shen
Currently, DCLA is built in rapid. With new train build, DCLA will be directly built in soong, just like a regular module, refer to b/239679485. In old rapid built DCLA, native shared libs are placed the following way inside apex: /lib(64)?/foo.so/<sha256 foo.so>/foo.so The sha256 hash is used to differentiate different libs. To ensure the same lib placement in soong built DCLA, three changes are made: (1) in apex.go, added an apex soong module property called dynamic_common_lib_apex to indicate if this apex is a DCLA (2) in builder.go, update apexRule to call into run_apexer binary instead of apexer binary. run_apexer binary is a wrapper of apexer binary. If it is DCLA, the wrapper binary will place the native shared libs in desired location and update canned_fs_config accordingly. TEST: manuualy added this field to adbd. Local build by banchan and then inspect the payload image contensts. All libs are proprely placed. BUG: 241096765 Change-Id: I2a5e7ea75a6e9a7af1932ff7dccb9dc3a3785db9
2022-08-01Moving default version outside of apex package Alexei Nicoara
The default version needs to be used by both apex and apk updatable modules. Moving it to android package so it can be accessed without circular dependencies. Test: presubmit Bug: 231691162 Change-Id: Icafd50d0b065e89a115ae9c9b6ea55adf2730b49 Merged-In: Icafd50d0b065e89a115ae9c9b6ea55adf2730b49
2022-07-28Implement mixed builds for apex modules, take 2. Sasha Smundak
* Add ApexCqueryInfo to obtain apex artifacts used by the makefile generator and downstream modules * Refactor code common to GenerateAndroidBuildActions and ProcessBazelQueryResponse * Implement android.MixedBuildBuildable for modules * Enable mixed build for apex modules with payload_type:"image" The first take 6a2b7c40b was setting compressed APEX suffix incorrectly, and was reverted in 8a3c91494. Fixes: 239925080 239695521 232085015 Test: treehugger Change-Id: I1720f8db3c7cc773183d25a815d9b7eeaf7c73ad
2022-07-26Revert "Implement mixed builds for apex modules." Martin Stjernholm
Revert submission 2147387-mixed_builds Reason for revert: Breaks zipapex build on git_master-art-host Bug: 239925080 Reverted Changes: I9f1e03e5e:Implement mixed builds for apex modules. I13d9a0270:Add container and bundle encription key pairs to t... Change-Id: I0eaad4dd81cac16d634f4c9cec18137a38e30d47
2022-07-18Implement mixed builds for apex modules. Sasha Smundak
* Add ApexCqueryInfo to obtain apex artifacts used by the makefile generator and downstream modules * Refactor code common to GenerateAndroidBuildActions and ProcessBazelQueryResponse * Implement android.MixedBuildBuildable for modules * Enable mixed build for apex modules with payload_type:"image" Bug: 232085015 Test: treehugger Change-Id: I9f1e03e5e7a5b5dde35a5db10c253069543ac973
2022-07-12Cleaning up comment removal and version replacement Alexei Nicoara
jsonmodify is now responsible for striping the comments and replacing the placeholder version with the defaule one. Cleaning up the old code. Test: presubmit Bug: 231691643 Change-Id: I09af00199aefec09b2d5995b2923525a3a42c362
2022-07-12Cleaning up the version sed rule Alexei Nicoara
Bug: 231691643 Test: presubmit, checked itermediary jsons Change-Id: Ibcf908d9365ab41e5a19211f5a60305a0896dea5
2022-07-08Replace version 0 with the default version Alexei Nicoara
Having 0 as the default version causes problems in flattened apexes and is being parsed in protobuf as non-existing field. It will be hard to revert 100 of commits for all the modules. Changing the version in soong to mitigate time impact. Test: presubmit, checked .intermediary jsons Bug: 231691643 Change-Id: I451186d79fd9f8345fd4e28d9daadbfc59047445
2022-07-06Merge "Passing default version to zipApex as well" Treehugger Robot
2022-07-06Passing default version to zipApex as well Alexei Nicoara
Test: presubmit Bug: 231691643 Change-Id: Ic751d7ea2d23180855897702a03bf1b589d7ef80
2022-06-30Removing comment lines from apex_manifest.json Alexei Nicoara
Allowing comments in apex_manifest.json by stripping all the lines which start with // Test: presubmit Bug: 237532860 Change-Id: Iec8c9987edf19b763b2b87df7d125c006ffb217a
2022-06-10Merge "Fix strip_prefix flags to strip install paths." Treehugger Robot
2022-06-09Fix strip_prefix flags to strip install paths. Bob Badour
Bug: 235331488 Test: m droid dist Change-Id: I3cd2af5d90e46a4c983728bc9b2d941d6ffda229
2022-06-08Passing the default apex version to the apexer Alexei Nicoara
Test: presubmit Bug: 231691643 Change-Id: I900a6acde9f212bf785b0be35f422416c8b62792
2022-05-20Fix bug: allow multiple gen_notice modules. Bob Badour
Test: m cts dist reportmissinglicenses Change-Id: I07963c83eaddfe363a04871e813b56fe7f1465ad
2022-05-18Add gen_notice module. Bob Badour
Refactor notices to support notices for multiple modules. Enforce visibility and handle missing dependencies. Bug: 213388645 Change-Id: Id6a81987f087419ad37d0cce57a71e8a7c4cd6e0
2022-05-05Revert "Append APEX version instead of build ID for APK-in-APEX ..." Oriol Prieto Gasco
Revert submission 2067907-apk-in-apex Bug: 230873680 Reason for revert: Change broke aab generation b/230873680 Reverted Changes: I9cef1418c:Append APEX version instead of build ID for APK-in... Ic37eeba8b:Make apexer replace instances of version placehold... Change-Id: Ib113d56901e815435f71bf878049cdabd210503c
2022-04-21Append APEX version instead of build ID for APK-in-APEX paths. Jingwen Chen
This CL removes the build_id.mk suffix and replaces it with a hardcoded placeholder string that will be replaced with the actual version in apex_manifest.json by apexer at apex construction time. This means that as long as the apex version is incremented, the APK-in-APEX will be installed to a new directory path from the package manager's perspective. Fixes: 229574810 Bug: 229625490 Bug: 226559955 Bug: 224589412 Bug: 227417611 Bug: 228157333 Bug: 228803590 Bug: 229136249 Test: atest StrictJavaPackagesTest Test: soong tests Test: deapexer list out/dist/com.google.android.permission.apex Change-Id: I9cef1418c3fc7e0970d96995b8398f5e82f479e0
2022-04-19Only install to $OUT/apex for installable apexes Colin Cross
When coverage is enabled there are two variants of the apex, one installable and one not installable. Don't try to install files files to $OUT/apex for the non-installable variant. Bug: 217453046 Test: m NATIVE_COVERAGE_PATHS="*" NATIVE_COVERAGE_EXCLUDE_PATHS="art bionic/libc device" CLANG_COVERAGE=true USE_HOST_MUSL=true com.android.runtime Change-Id: I23e58c811ff943b9d5dec025fa619c8db835b29c
2022-04-08Flag to globally override apexes' min_sdk_version Albert Martin
Override all mainline updateable apexes' min_sdk_version to same version to get single shared native libs on DCLA. Test: Run "vendor/google/build/go/mainline_go_modules_arm.sh" and inspect built apexes Bug: 212609891 Change-Id: Ide7d3f2bc772ac6240f1c917b87285d051d6f605 Merged-In: Ide7d3f2bc772ac6240f1c917b87285d051d6f605
2022-04-04Keep dependency files out of the apk file. Bob Badour
Bug: 227682036 Test: TARGET_BUILD_VARIANT=userdebug UNBUNDLED_BUILD_SDKS_FROM_SOURCE=true vendor/google/build/mainline_modules_bundles.sh -j97 Change-Id: I1a9775af7c652191bb1ce3b97c1cb9365b469c19
2022-04-01Revert "Revert "Build notice files from license metadata."" Bob Badour
This reverts commit 77807b3c277723161a193aea2a9df1e464448c3d. Reason for revert: fix and roll forward again Change-Id: I80c796ca81ecf29df9522babe54d684a0d11b9e6
2022-04-01Revert "Build notice files from license metadata." Wei Sheng Shih
This reverts commit 43c2dcaef609c4a268bfab6c95ed924af4ead6b1. Reason for revert: suspect build break Bug: 227682036 Test: TARGET_BUILD_VARIANT=userdebug UNBUNDLED_BUILD_SDKS_FROM_SOURCE=true vendor/google/build/mainline_modules_bundles.sh -j97 Change-Id: Ibfb8b4fefc264f52f32ba661c269a9cd625d800a
2022-03-31Fix breakage: bad path join using '/' literal Bob Badour
Typo in filename s/b NOTICE.html.gz not NOTICES.html.gz Bug: 227682036 Test: TARGET_BUILD_VARIANT=userdebug UNBUNDLED_BUILD_SDKS_FROM_SOURCE=true vendor/google/build/mainline_modules_bundles.sh -j97 Change-Id: I75cc28e3ef22d975ad46f4e167071f6d82ba253d
2022-03-31Build notice files from license metadata. Bob Badour
Switch from generate-notice-files.py and mergenotice.py to htmlnotice. Bug: 151177513 Bug: 213388645 Bug: 210912771 Test: m droid dist reportmissinglicenses Change-Id: I6cac049d24f35ec358c6f341a04f4ba6161703bf
2022-03-08Skip install rules for apexes with installable: false Colin Cross
When an apex sets installable: false call SkipInstall to prevent creating the install rules, and don't report the install rules to Make. Fixes: 221261079 Test: m checkbuild Change-Id: If94759b16f79ee10ddcf8ee89603ca9e822b74f5
2022-02-24apex supports ".apex" tag Jooyung Han
Tests can embed non-compressed .apex output with the tag. Bug: 221024307 Test: soong test Change-Id: Id4a239d1897237105a064cea8c97029f5b996a98
2022-02-10Merge "Manifest Fixer Params code refactor" Gurpreet Singh
2022-02-10Manifest Fixer Params code refactor Gurpreet Singh
This CL refactors the code related to ManifestFixer parameters. The required parameters android.ModuleContext, manifest android.Path are passed separately as the parameters and the optional parameters are kept as part of the ManifestFixerParams struct. By default, the member variable of struct have the zero (nil, false, empty string) values. Hence, it is only required to pass the parameters of interest at the time of function call to ManifestFixer. Manual testing done to check the working of the code. Test: m nothing && m test_com.android.sdkext Test: manually tested the generation of AndroidManifest in the out directory with the testOnly attribute Test: atest manifest_fixer_test --host To test the existing unittests are not breaking. Change-Id: I20cb6c06c57f8fe7811050288bcb03945dc0425b