summaryrefslogtreecommitdiff
path: root/android/variable.go
AgeCommit message (Collapse)Author
2021-01-06Merge "Support building mixed versions of sepolicy" Inseob Kim
2021-01-06Support building mixed versions of sepolicy Inseob Kim
Now newer system policy and older vendor policy can be built together by setting following variables: - BOARD_SEPOLICY_VERS - BOARD_REQD_MASK_POLICY (copy of older system/sepolicy/reqd_mask) - BOARD_PLAT_VENDOR_POLICY (copy of older system/sepolicy/vendor) - BOARD_(SYSTEM_EXT|PRODUCT)_(PUBLIC|PRIVATE)_PREBUILT_DIRS (copy of older system_ext and product policies) Bug: 168159977 Test: try normal build and mixed build Test: boot and check selinux denials Change-Id: I20e1986cc1c877f5e3a7965e03bd8ade84fd7230
2021-01-05Add TARGET_FORCE_APEX_SYMLINK_OPTIMIZATION Jiyong Park
The APEX symlink optimization is a build-time trick to save the storage/RAM usage of APEX by replacing some files in APEX with symlinks to the files in the system partition. The optimization however is automatically turned off for 'updatable: true' APEXes because doing the optimization for them will hide the sys-health implication until when the APEXes are built unbundled (i.e. prebuilt) and thus the optimization is impossible. TARGET_FORCE_APEX_SYMLINK_OPTIMIZATION forcibly disables the safety net. When it is set to true, the symlink optimization is done regardless of the 'updatable' property. This is useful for some of the devices like Go where most APEXes (even the 'updatable: true' ones) should be effectively non-updatable. Bug: 175630508 Test: TARGET_FORCE_APEX_SYMLINK_OPTIMIZATION=true m and check that updatable APEXes have symlinks to system libs Change-Id: I26f72e5d5ebccc2d1e09c2a2f743db14937eb39a
2020-12-23Support for recovery snapshot. Jose Galmes
Bug: 171231437 Test: source build/envsetup.sh Test: ALLOW_MISSING_DEPENDENCIES=true m -j nothing Change-Id: I74636cf7f97e027a229a5ef7c776f2b7a42ead95
2020-12-18variable: Update product_variables.arc struct Satoshi Niwa
- Add whole_static_libs - Add `android:"arch_variant"` so arc struct can be used inside target.android.product_variables Test: m Bug: 171847983 Change-Id: Iaa99b007302462ef66d0d943bc16d37a6e8ecdc7
2020-12-15Merge "Revert^2 "Always turn on compatible property"" Treehugger Robot
2020-12-08Enable soong build tool to handle APEX compression Mohammad Samiul Islam
1. Soong can now detect PRODUCT_COMPRESSED_APEX flag We don't want APEX to be compressed on all devices. Only those that have explicitely set PRODUCT_COMPRESSED_APEX flag. 2. Handle "compressible" field in soong build rule On devices that supports APEX compression, all APEX will be compressed by default. If any apex does not want to be compressed, they will need to state that by setting "compressible" field to false 3. Can use apex_compression_tool to compress APEX Note we compress the APEX after it has been signed. That way, when we decompress we will get a signed APEX. 4. Place the compressed APEX in system with .capex extension This makes it easy to identify. We still preserve the original extension so that when we decompress, we can just rename by cuttif off the .capex extension. Note: with this change, we can create a system image with compressed APEX, but we cannot boot with it since platform doesn't know how to handle .capex files. Platform support will be added on follow up CLs. Bug: 172911362 Test: OVERRIDE_PRODUCT_COMPRESSED_APEX=true m (apex_test.go) Test: observed $OUT/system/apex has .capex files Change-Id: I20ac4c4ceb521924c751a6017f979b2d808fdded
2020-11-24Add java sdk library enforcement flag JaeMan Park
Add java sdk library enforcement for inter-partition library dependency, for ensuring backward-compatible libraries for inter-partition dependencies. Test: m nothing Bug: 168180538 Change-Id: I6bfac54c3499b03003a3bc6c2bb62b165b4ce5f9
2020-11-19Revert^2 "Always turn on compatible property" Inseob Kim
This reverts commit 7d13e5b964fb8ca5572e9ae191d4691dd049eeae. Reason for revert: Fixed broken targets Change-Id: Ibfa2641575346675f8210297eaebfbe7d63cf5a5
2020-11-18Merge "Revert "Always turn on compatible property"" Will Osborn
2020-11-18Revert "Always turn on compatible property" Inseob Kim
This reverts commit f6d606ebea3334bdf00148639edcc8378c3b8861. Reason for revert: broken targets on the internal branch Change-Id: I948280e2072789a2ee20e7fe4844c667f58b5182
2020-11-18Merge "Always turn on compatible property" Treehugger Robot
2020-11-17Always turn on compatible property Inseob Kim
It's mandatory for devices launching with Android P or later. Bug: 170082975 Test: m Change-Id: I22578c3b77d28abc8a09b88324ef3702d0ccafde
2020-10-29Move boot jars package check from make Paul Duffin
Adds a singleton that traverses the module variants finding the ones that are in the list (updatable and non-updatable) of boot jars and add a ninja rule to ensure that they only contain packages from an allowed list. Replaces a hack that ignored any prebuilt boot jars supplied as dex file with an equivalent one to ensure that they are still ignored. A follow up change that switches to checking dex jars will allow the hack to be removed. The boot jars check can be strict or lax. If strict then all the boot jars listed in the configuration must be found, otherwise it will only check the ones it finds. It is strict by default unless TARGET_BUILD_UNBUNDLED=true or ALLOW_MISSING_DEPENDENCIES=true. Moves the script and data file from build/make. Test: m check-boot-jars - for failing and passing cases SKIP_BOOT_JARS_CHECK=true - no check-boot-jars target created ALLOW_MISSING_DEPENDENCIES=true - not strict TARGET_BUILD_UNBUNDLED=true - not strict verified manually that apart from path differences the same files (same check sum) were checked in both old make checks and the new Soong ones EMMA_INSTRUMENT=true EMMA_INSTRUMENT_FRAMEWORK=true m check-boot-jars Bug: 171479578 Change-Id: I9d81d6650ba64fc0d48d2dab4ba5a3ba8dd03dec
2020-10-27Switch BootJars/UpdatableBootJars to ConfiguredJarList Paul Duffin
This change: * Switches BootJars/UpdatableBootJars fields of config.productVariables from []string to ConfiguredJarList. * Updates BootJars() method to simply concatenate the jars list from the BootJars/UpdatableBootJars fields. * Adds an UnmarshalJSON(..) method to ConfiguredJarList to support unmarshalling from a single string array to avoid having to change the format of the JSON file from which the configuration is loaded. * Adds some additional calls to ConfiguredJarList(..) in tests to convert from []string to ConfiguredJarList. They pass nil as the ctx argument as there is no suitable PathContext which will cause any errors to be thrown using panic. That is reasonable for hard coded values in tests. A follow up change will clean up the calls to ConfiguredJarList(..). Bug: 171479578 Test: m nothing Change-Id: I59b94dafb479ccd8f0471ed802be175af57be271
2020-10-22Vendor ramdisk modules install to correct location Yifan Hong
Install to recovery/root/first_stage_ramdisk if BOARD_MOVE_RECOVERY_RESOURCES_TO_VENDOR_BOOT, otherwise vendor-ramdisk. In addition, append /system if not InstallInRoot(). On devices with dedicated recovery partition, BOARD_MOVE_RECOVERY_RESOURCES_TO_VENDOR_BOOT is not set, and this installs to the correct place (under $OUT/vendor-ramdisk). On devices without a dedicated recovery partition: - To install a module available before switching root to /first_stage_ramdisk, e.g. a binary under /system/bin, use recovery{_available} and install the recovery variant of the module. - To install a module available after switching root to /first_stage_ramdisk, e.g. a binary under /first_stage_ramdisk/system/bin, use vendor_ramdisk{_available} and install the vendor_ramdisk variant of the module. Test: pass Bug: 156098440 Change-Id: I1af3f8889891a3e58263cda36f0680ce2b480499
2020-10-20Allow Strip in Debuggable Philip Cuadra
Allow Strip to be set in Debuggable builds. Bug: 171273461 Test: manual confirmation Change-Id: Ief259891e8e3fd19b31377e92fbbad28daa405ac
2020-10-13Merge "Zero C++ heap by default." Steven Moreland
2020-10-12Zero C++ heap by default. Steven Moreland
Let the flakes, and the crashes, and the deadlocks, and the leaks, and the undefined behavior which steals away so many nights find their numbers decimated in the homogeneous conditions we now rest our data. To give some intuition why this is not so underperformant, zeroing memory is one way of priming caches. This change is actually a no-op, because build/make/core/soong_config.mk always overrides this setting, but it reflects the spirit and future direction of this change. Bug: 131355925 Test: basic simple perf comparisons Change-Id: I8254c36373de52091839561973c9741e8f85aa09
2020-10-12Merge "android/: Rename Plat->SystemExt*SepolicyDirs" Treehugger Robot
2020-09-25Update the default platform version to S Jiyong Park
R is out. The platform codename on the main branch is now S and the API level of the platform is 30, which is R because S hasn't been finalized. Bug: N/A Test: rm -rf out; ./build/soong/soong_ui.bash --make-mode --skip-make Change-Id: I486b9639bccfe17a42681e1f84097373f8f401e7
2020-08-27Introduce BOARD_CURRENT_API_LEVEL_FOR_VENDOR_MODULES Jeongik Cha
If BOARD_CURRENT_API_LEVEL_FOR_VENDOR_MODULES has a numeric value, it replaces "current" or "system_current" with the version which the flag indicates. Bug: 163009188 Test: BOARD_CURRENT_API_LEVEL_FOR_VENDOR_MODULES=29 m, and then check if every vendor java module's sdk_version is 29 if its sdk_version was current. Change-Id: I17b49b8e02caf2d1bc57b91648d4420f3ad9fcb9
2020-08-11Remove obsolete PDK build functionality Dan Willemsen
This hasn't worked for a couple years, and continues to bitrot. Just remove it. Adds a bpfix rule so that we can eventually remove the product_variables.pdk definition, which is now always a no-op. Test: treehugger Change-Id: I830b54d419b59f6db1d4617b45e61a78234f57a7 Merged-In: I830b54d419b59f6db1d4617b45e61a78234f57a7
2020-08-10Merge "Introduce AlwaysUsePrebuiltSdks" Jeongik Cha
2020-08-07Introduce AlwaysUsePrebuiltSdks Jeongik Cha
Instead of UnbundledBuild, use AlwaysUsePrebuiltSdks to determine if java modules needs to be built against prebuilt sdks. And rename UnbundledBuildUsePrebuiltSdks to AlwaysUsePrebuiltSdks to express its behavior more correctly.(It can be orthgonal to "Unbundled") Bug: 160390776 Test: TARGET_BUILD_UNBUNDLED_IMAGE=true m vendorimage Change-Id: I0be7265c1959d8774c295372cd7a9250169f6df9
2020-08-06Add BoardKernelModuleInterfaceVersions. Yifan Hong
This is a list of KMI versions for this board. Only gki_apex modules with matching kmi_version field is enabled. Test: build GKI apexes Bug: 162888350 Change-Id: Ieb2116b79e3985ba15155a3cb8a2c340b46473c7
2020-07-29Introduce BOARD_KERNEL_BINARIES to soong Yifan Hong
Bug: 161563386 Test: use it Change-Id: I8ff429a329a9aa2a8ab6c8b4501356a84a7aead6
2020-07-20Deprecate VNDK-Lite Kiyoung Kim
Android S would not support upgrade from O-MR1 devices, so VNDK Lite configuration is no more valid. This change removes all VNDK-lite variables from soong. Bug: 158719241 Test: m -j passed Change-Id: I54093fd4ee37ceddfc33a0b216b7069372040a0c Merged-In: I54093fd4ee37ceddfc33a0b216b7069372040a0c
2020-06-22Make native_coverage clause work with ClangCoverage Colin Cross
Make uses NATIVE_COVERAGE to enable gcov coverage and CLANG_COVERAGE to enable clang coverage. NATIVE_COVERAGE is translated to the Soong Native_coverage product variable which triggers the native_coverage clause in Android.bp files. The clause also needs to be triggered for CLANG_COVERAGE. Rename the existing Native_coverage product variable to GcovCoverage, and regenerate Native_coverage when either GcovCoverage or ClangCoverage are set. Also remove NativeLineCoverage, it wasn't doing anything differently than Native_coverage. Bug: 159059537 Test: m checkbuild Change-Id: I215124a9b35a2ad50ad562079d392e3d33da11f4
2020-06-17Build against SDKs for native libs only for unbundled apps. Martin Stjernholm
Unbundled APEX modules need to access the platform variant (i.e. sdk:"") since it's there that the versioned stubs are exposed. Test: m SOONG_ALLOW_MISSING_DEPENDENCIES=true \ TARGET_BUILD_UNBUNDLED=true toybox on master-art with prebuilt Runtime (Bionic) APEX SDK. The prebuilt SDK doesn't have libc.ndk.xxx etc, which e.g. libcrypto would depend on without this CL, since it specifies sdk_version. Bug: 157549171 Change-Id: I3095e42beb2b48421bfb81be942cc2ac30405fd0
2020-06-15Introduce product variables to select Java code coverage paths in Soong. Roland Levillain
Introduce product variables `JavaCoveragePaths` and `JavaCoverageExcludePaths` (resp. populated from environment variables `JAVA_COVERAGE_PATHS` and `JAVA_COVERAGE_EXCLUDE_PATHS`). Use them to control which Java modules are candidate for instrumentation based on their source path. By default (when `JavaCoveragePaths` is empty), have all Java module be candidate for instrumentation, to preserve the existing behavior. Test: export EMMA_INSTRUMENT=true \ && export EMMA_INSTRUMENT_FRAMEWORK=true \ && export JAVA_COVERAGE_PATHS=art \ && m Bug: 158212027 Bug: 156284897 Change-Id: Ibe9c1f41ed6110867411952689c5a7ad6536f277
2020-06-15Merge "Rename native code coverage paths product variables in Soong." Roland Levillain
2020-06-11Use inclusive language in build/soong Colin Cross
Test: m checkbuild Change-Id: Id07890b7cbc2397291a658ca00e86b43c743aafc
2020-06-10Rename native code coverage paths product variables in Soong. Roland Levillain
Rename `CoveragePath` and `CoverageExcludePaths` as `NativeCoveragePath` and `NativeCoverageExcludePaths` (resp.). Also rename function `android.CoverageEnabledForPath` as `android.NativeCoverageEnabledForPath`. Test: m nothing Bug: 158212027 Change-Id: Id2c11a638e88088096420b537effa866d7667304
2020-06-08Remove TARGET_PREFER_32_BIT support. Elliott Hughes
Bug: https://issuetracker.google.com/138812821 Test: builds Change-Id: If96cccbd82ba1311165d61c947c928c6e7cd5593
2020-05-17android/: Rename Plat->SystemExt*SepolicyDirs Felix
Align with changes in system/sepolicy and build/make. Signed-off-by: Felix <google@ix5.org> Change-Id: I326962648a78e68e8cc83fdc22d8274eaecb8c8c
2020-04-29[soong] Zero and pattern initialization of heap memory. Evgenii Stepanov
Bug: 155227507 Test: build with and without MALLOC_PATTERN_FILL_CONTENTS, MALLOC_ZERO_CONTENTS Change-Id: I79a675e1b20897e8f88e89b1b2d6758e8b91f0be
2020-04-14Remove PLATFORM_VERSION_FUTURE_CODENAMES Jooyung Han
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 Exempt-From-Owner-Approval: cp from master Merged-In: I78ca88758998e440bea72ba2d56d90eea3ec99ae Change-Id: I78ca88758998e440bea72ba2d56d90eea3ec99ae (cherry picked from commit 424175d72a497aed8c2d83cdcb00131ff639c043)
2020-04-01Add product_variables.eng.optimize.enabled Felka Chang
The default build is to enable optimization for all of module. In order to have the feasibility to the owners of the modules, to create product_variables.eng.optimize.enabled let the owners to have the choice to decide whether the build enable the optimization or not. Test: atest -m # build soong Test: # follow Developing for Soong & setup GOPATH # to run the new tests in variables_test.go cd $GOPATH; \ go test android/soong/android Test: #1. change frameworks/base/packages/SystemUI/Android.bp to change product_variables.eng.optimize.enabled = false; #2. source build/setupenv.sh; #3. lunch aosp_x86-eng; make -j16 SystemUI #4. lunch aosp_x86-userdebug; make -j16 SystemUI #5. aosp_x86-eng should be bigger than aosp_x86-userdebug Bug: 130259652 Change-Id: Ie62c35458ca91d66ec65bda58d315fb971139849
2020-03-24Add platform-wide sampling PGO option Yi Kong
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 Change-Id: Ie4d1d5ffbd311ba6e268cb94a618f5272be246ef
2020-03-09Apply EnforceRROExemptedTargets in Soong Jeongik Cha
As PRODUCT_ENFORCE_RRO_EXEMPTED_TARGETS is defined in make, define it in soong accordingly Bug: 150820813 Test: m Change-Id: I309482b6ad439a7602127f68f2f7ffa856b9e192
2020-02-28Add an order-only dependency on the build number file Colin Cross
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
2020-02-13Remove execute-only support. Ivan Lozano
With kernel support being removed for execute-only memory layouts, remove support for XOM until there's kernel support again. This allows us to gain the code-size improvements from "-z noseparate-code". Bug: 147300048 Test: Compiled binaries no longer marked XOM by default. Change-Id: Ie84bdd2ca025e8b14867008291bf9ce143b5e999
2020-02-13Make PRODUCT_BOOT_JARS and PRODUCT_UPDATABLE_BOOT_JARS disjoint. Ulya Trafimovich
This is to unify boot jars with system server jars: PRODUCT_SYSTEM_SERVER_JARS and PRODUCT_UPDATABLE_SYSTEM_SERVER_JARS do not overlap. Test: aosp_walleye-userdebug boots Exempt-From-Owner-Approval: cherry-pick. Bug: 146363577 Change-Id: If001049a46f8e9d38921dabeedbd61e971ebfe73 Merged-In: If001049a46f8e9d38921dabeedbd61e971ebfe73 (cherry picked from commit ef4358e536ec3e40843759a203af3043704b7357)
2020-02-06Add product_variables.native_coverage.src Colin Cross
Test: m checkbuild Fixes: 148088129 Change-Id: I38fb22b28de1176ed880708733f7e7f76bee2e50
2020-02-06Fix product variables in defaults modules Colin Cross
Product variables structs are generated at runtime to contain only the properties that apply to the current module. Defaults modules always contained all product variable properties. Defaults modules apply their properties to the target module using proptools.PrependProperties, which prepends structs that have matching types. Filtered property structs had a different type and were dropped. Even after adding filtering to the defaults product variable properties, defaults modules may contain more property structs than the target module they are applied to, so the product variables struct for the defaults module could contain more fields than the product variables struct for the target module. Use proptools.PrependMatchingProperties when applying defaults of product variables instead, which will apply matching properties across types. Test: defaults_test.go Test: variable_test.go Change-Id: I281bdefef92053457a3b7b65383493a4e7d999df
2020-02-06Fix product variable zero value check Colin Cross
The zero value check was being done by using reflect.DeepEqual on a field from the default product variables, but this results in comparison against a random type when the product variables struct for the module has been filtered down. Luckily this will always fail false, which just removed and optimization but left the behavior correct. Use reflect.IsZero instead, which is both faster and correct. Test: variable_test.go Change-Id: Ieaaa590c2788ca39230e6695397e8ba8d1c6c103
2020-01-31Add support for LINE_COVERAGE (1/2) Kyriakos Ispoglou
This is the 1st part of the CL. It adds support to enable compilation of line coverage instrumented binaries. For more details please refer to the design doc: go/android-line-coverage-doc Bug: b/147604881 Test: Code works successfully on Taimen devices Change-Id: I07745c1438b611041ed032dd4b7788cb50130845
2020-01-31Merge "Add native_coverage to product variables" Treehugger Robot
2020-01-29Merge "Add whole_static_libs to non-svelte configs." Christopher Ferris