Commit graph

250 commits

Author SHA1 Message Date
Inseob Kim
d0f600a074 Add BoardPlatVendorPolicy to soong config
Bug: 205924657
Test: build
Change-Id: I89697a82c6d288576ae066f82a067383ccd57e2e
2021-12-08 22:53:02 +09:00
Jiyong Park
c99f65fa6c Reland: Add NEED_AIDL_NDK_PLATFORM_BACKEND
The config variable is used to force the generation of the AIDL
ndk_platform backend which will eventually be removed in favor of the
ndk backend. The switch is needed as an escape hatch for some devices
whose BSP (outsourced and thus hardly modifiable) depends on the
ndk_backend libraries.

Bug: 161456198
Test: m

Merged-In: Iba8633263ae649af783e94b01f5c1b5c6e042948
Change-Id: I8b73a6a1e5169c35daf333316857b3c3b110a0f7
2021-12-02 13:16:13 +09:00
Cole Faust
5588a88969 Change type of TARGET_BUILD_APPS from bool to list
TARGET_BUILD_APPS is supposed to be a list of apps to
build, so having it be a bool was incorrect. Change it
to properly reflect what it is, because the starlark
product configuration relies on soong's interpretation
of variables types.

Bug: 201700692
Test: Presubmits
Change-Id: I00109b57abbcda86077f0465f982f54b4a77a7f0
2021-11-23 19:04:11 -08:00
Ulya Trafimovich
ddec79ce54 Remove unused variable SKIP_BOOT_JARS_CHECK.
The variable is no longer used after https://r.android.com/1737753.

Bug: 189298093
Test: m
Change-Id: I6bcb6735189429551ebca697441f2a1edb5c4dfa
2021-09-30 14:00:34 +01:00
Inseob Kim
d416dae347 Add more sepolicy variables to soong_config
Bug: 33691272
Test: m selinux_policy on sc-dev
Change-Id: I3fd9994d3b7ec2204b8d1be01381f590535f2278
2021-09-15 03:04:14 +00:00
Rob Seymour
ab5492c72c Merge "Add fake host snapshot support" 2021-09-14 14:47:03 +00:00
Rob Seymour
be609fb144 Add fake host snapshot support
Map HOST_FAKE_SNAPSHOT_ENABLE to HostFakeSnapshotEnabled() method.

Bug: 194799048
Test: m HOST_FAKE_SNAPSHOT_ENABLE=true host-fake-snapshot dist -- check snapshot exists in dist

Change-Id: Idd343c3dec3cc24514a5d587b06c3b1300598b7d
2021-09-13 15:59:05 +00:00
Anton Hansson
2df8730d95 Add new make variables for extension SDK version
- PLATFORM_SDK_EXTENSION_VERSION is the sdk extension version of the
  tree
- PLATFORM_BASE_SDK_EXTENSION_VERSION is the sdk extension version that
  PLATFORM_SDK_VERSION ships with.

Also propagate PLATFORM_SDK_EXTENSION_VERSION to soong to that it can be
used in genrules.

Bug: 195281582
Test: via development/ CL in this topic
Merged-In: Ib078a922e9bd9bc6ae82ab74feaeb743703a64b8
Change-Id: Ib078a922e9bd9bc6ae82ab74feaeb743703a64b8
2021-08-27 17:42:33 +01:00
Colin Cross
178de6308c Propagate USE_HOST_MUSL to Soong
Support enabling musl in Make builds with USE_HOST_MUSL=true.  Only
modules defined in Soong will use musl, but that's almost all host
modules.

Bug: 195988762
Test: m USE_HOST_MUSL=true adb
Change-Id: Ia88f6e20b302d86f2241877b017aebe218d968cf
2021-08-25 15:07:17 -07:00
satayev
8bc189e39f Rename UpdatableBootJars to ApexBootJars.
Note that ART apex boot jars and core-icu4j are exceptions here as they
are not part of ApexBootJars. ART apex boot jars are defined in their
own variable, while core-icu4j is treated as a regular non-updatable
boot jar.

Bug: 191127295
Test: atest CtsClasspathsTestCases
Change-Id: I5f5feb7344941d0154f384e3c06279d49b490768
2021-07-21 14:14:44 +01:00
satayev
65e68bb263 Rename PRODUCT_UPDATABLE_BOOT_JARS to PRODUCT_APEX_BOOT_JARS.
Regardless of an "updatable" property of individual, list all apex boot
jars in the same variable. This is less confusing for devs, especially
since they shouldn't care about things like boot images.

Bug: 191127295
Test: atest CtsClasspathsTestCases
Change-Id: I0a559db462d1e1f67003ac54d1e27a89110d802a
Merged-In: I0a559db462d1e1f67003ac54d1e27a89110d802a
2021-07-20 15:46:53 +01:00
Jeongik Cha
b26bf58e12 dexpreopt.config should be created even though unbundled image is built
Bug: 188179858
Test: compare dexpreopt_config.zip files from
 1. TARGET_BUILD_UNBUNDLED_IMAGE=true m dexpreopt_config_zip
 2. m dexpreopt_config_zip
(note that m clean should run between steps)

Change-Id: I92623b59e4fcac397c7fed3d7ab1070fe5281027
2021-07-14 18:52:01 +09:00
Anton Hansson
106e11cfe7 Fix soong_config handling of CompressedApex
add_json_bool treats non-empty variable as "true" by default (which is
conventional in make). Fix treatment of PRODUCT_COMPRESSED_APEX to
support the value false.

Bug: 185537646
Test: OVERRIDE_PRODUCT_COMPRESSED_APEX=false m nothing && \
      grep CompressedApex out/soong/soong.variables
Change-Id: I0562a375be377ab67a1d064e37aff5970c4ac8dd
2021-04-16 10:09:58 +01:00
Hridya Valsaraju
b39ec7084a Add a build flag to turn on debugfs restrictions
Starting with Android R launched devices, debugfs cannot be mounted in
production builds. In order to avoid accidental debugfs dependencies
from creeping in during development with userdebug/eng builds, this
patch introduces a build flag that can be set by vendors to enforce
additional debugfs restrictions for userdebug/eng builds. The same flag
will be used to enable sepolicy neverallow statements to prevent new
permissions added for debugfs access.

Bug: 184381659
Test: make with/without PRODUCT_SET_DEBUGFS_RESTRICTIONS
Change-Id: I9aff974da7ddce9bf1a7ec54153b161527b12062
2021-04-07 16:47:59 -07:00
Yi-Yo Chiang
875442fde4 Remove obsolete var PRODUCT_CHECK_ELF_FILES
After aosp/1184262 is submitted, PRODUCT_CHECK_ELF_FILES is deprecated
and nobody is using this variable anymore.

Bug: 149715904
Test: Presubmit; Should be noop
Change-Id: Iaf4a6ae1fe4062684a9699b7ef999030ff483e16
2021-03-29 18:35:51 +08:00
Treehugger Robot
9ae28a750a Merge "Add filter to some boolean variables" 2021-03-24 23:20:53 +00:00
Inseob Kim
ce0671f057 Merge "Add WithDexpreopt soong variable" 2021-03-24 06:20:03 +00:00
Inseob Kim
3dfb8b8d7a Add filter to some boolean variables
add_json_bool converts non-empty string to true, and empty string to
false. But some of boolean variables are meant to be set either "true"
or "false". In that case "false" may lead to a mismatch. This adds
filter to boolean variables which are directly compared to "true", like

    ifeq ($(VAR),true)

Bug: 183483152
Test: build
Change-Id: I0dc4a05293a3233ae4958335781a19e6445a3799
2021-03-24 14:20:33 +09:00
Inseob Kim
84a8be3c52 Add WithDexpreopt soong variable
Test: m selinux_policy on sc-arc
Change-Id: Ieae24f65d74179d0604040a95f8aff4b027a2949
2021-03-23 23:21:24 +00:00
Inseob Kim
35f63019c9 Fix SepolicySplit soong variable
It should be "filtered" by "true" because all non-empty values become
true when using add_json_bool.

Test: m selinux_policy on sc-arc
Change-Id: I35d5881d83746230793cf8ced76885607e82334a
2021-03-23 20:47:39 +09:00
Inseob Kim
232f6ac676 Add PlatformSepolicyVersion to soong_config
PlatformSepolicyVersion and BoardSepolicyVers haven't assigned correctly
so far. Below is the reason why it hasn't been discovered yet.

DeviceConfig.PlatformSepolicyVersion() was added to support mixed
sepolicy build (setting BOARD_SEPOLICY_VERS and building vendor sepolicy
with old plat policy files). Soong compares PlatformSepolicyVersion()
and BoardSepolicyVers(), and used old vendor sources if both are
different. Back then, the only place where such logic played a role was
selinux contexts. Test codes were running as intended: after setting
BOARD_SEPOLICY_VERS the context files were built against old policies.

But there were two mistakes:

1) PlatformSepolicyVersion() was not added to soong_config.mk, so it was
always empty.
2) BOARD_SEPOLICY_VERS was set to default in system/sepolicy/Android.mk,
which was processed after soong_config. So if BOARD_SEPOLICY_VERS was
not set in BoardConfig.mk, BoardSepolicyVers() was empty, not
PLATFORM_SEPOLICY_VERSION.

And there were no issues as Soong only checked equality.

To fix the issue correctly, this commit adds the variable
PlatformSepolicyVersion, and then handles BoardSepolicyVers correctly by
returning PlatformSepolicyVersion if it's empty.

Test: set BOARD_SEPOLICY_VERS and see vendor_file_contexts changes
Change-Id: I4e306ec1f5225094a39f0c8d94f5e7683d70d60e
2021-03-22 22:34:40 +09:00
Inseob Kim
a3ae471485 Add sepolicy related variables
Bug: 33691272
Test: build
Change-Id: Ifbcd2c49d6ecf6d7e69d6b95bace168eccd17f13
2021-03-17 18:04:56 +09:00
Justin DeMartino
f15053ee39 Allow extending of the list of directories to be scanned for VSDK
Bug: 180925851
Test: m nothing, manually
Change-Id: I499f084f04e45eb719882be97e3a581ff868cc98
2021-03-12 19:38:14 +00:00
Jeongik Cha
c5da20e886 Deprecate PRODUCT_ENFORCE_RRO_EXEMPTED_TARGETS
There is no module relying on PRODUCT_ENFORCE_RRO_EXEMPTED_TARGETS

Test: m
Bug: 150820813
Change-Id: I461ab2654513a3b921bec5d46c39d474b6324ca2
2021-02-19 21:49:59 +09:00
Treehugger Robot
32b84909a1 Merge changes from topic "vendor_property_enforce"
* changes:
  Set BUILD_BROKEN_VENDOR_PROPERTY_NAMESPACE for goldfish
  Add BUILD_BROKEN_VENDOR_PROPERTY_NAMESPACE to BoardConfig
  Add PRODUCT_SHIPPING_API_LEVEL to productVariables
2021-02-17 07:12:30 +00:00
Jose Galmes
7185c6c500 Implement directed recovery snapshot.
Bug: 177451657
Test: m -j nothing
Change-Id: I902afe71e7577c1c41371f1422512170edf6e492
2021-02-09 07:41:40 -08:00
Ioannis Ilkos
8e568c52ab Remove Use_lmkd_stats_log from build
Use_lmkd_stats_log used to control LMKD_LOG_STATS when compiling lmkd.

However, for newer Android releases, we mandate that lmkd informs statsd of process kills (change id I8cb123b9488fbc6e88863c2f0e75f1422bcd282e)
After aosp/1555318 we compile lmkd with statsd by default, so this setting is a noop.

Change-Id: I91bd08198fe2275fb8aca77ae5ea637df360d416
Test: build
Bug: 177985094
2021-02-08 11:17:55 +00:00
Inseob Kim
43f4ef0221 Add BUILD_BROKEN_VENDOR_PROPERTY_NAMESPACE to BoardConfig
Bug: 175526482
Test: m vendor_property_contexts after making violations
Change-Id: I81512fefbe952ecaf31fd4b5d276fd32c6253c7f
2021-02-03 18:17:49 +09:00
Inseob Kim
a0884b90ae Add PRODUCT_SHIPPING_API_LEVEL to productVariables
Bug: 175526482
Test: m selinux_policy
Change-Id: I10195730e47398bdb455d554a1cb7d6b7ac28634
2021-02-03 16:23:42 +09:00
Bill Peckham
ddf8f61ce5 Merge "Enable prebuilt hiddenapi CSV files." 2021-01-20 17:43:48 +00:00
Inseob Kim
890f84fe71 Merge "Implement directed vendor snapshot" 2021-01-20 01:17:23 +00:00
Bill Peckham
e3cf60911a Enable prebuilt hiddenapi CSV files.
By enabling these hiddenapi CSV files to be prebuilt, it
becomes possible to create a split build that supports
the hiddenapi encode dex step, but doesn't contain all
of the java sources needed to generate the CSV files.

Bug: 175048716
Test: m nothing
Test: new TestHiddenAPISingletonWithPrebuiltCsvFile
Test: local build without prebuilt hiddenapi
Test: local build with prebuilt hiddenapi
Change-Id: Ia38c5016d2aeba54aa537a5ce601898d46330730
2021-01-16 22:07:40 +00:00
Evgenii Stepanov
10b4d0ad5d Include/exclude paths for memtag sanitizer.
Bug: b/135772972
Test: none
Change-Id: Ib198c359b92b82573cb66fd6d993aece0e9ff7d9
2021-01-11 21:15:21 -08:00
Peter Collingbourne
fcd9ccf4a1 Remove ANDROID_EXPERIMENTAL_MTE.
Now that the feature guarded by this flag has landed in Linux 5.10
we no longer need the flag, so we can remove it.

Bug: 135772972
Change-Id: I02fa50848cbd0486c23c8a229bb8f1ab5dd5a56f
2021-01-11 10:55:51 -08:00
Jose "Pepe" Galmes
bee0c588a8 Merge "Support for recovery snapshot." 2021-01-06 21:17:54 +00:00
Inseob Kim
d8cc1352b5 Implement directed vendor snapshot
Vendors can now generate only needed modules by setting the following
Makefile variables:

- DIRECTED_VENDOR_SNAPSHOT: set to true
- VENDOR_SNAPSHOT_MODULES: list of snapshot candidates

e.g.

DIRECTED_VENDOR_SNAPSHOT := true
VENDOR_SNAPSHOT_MODULES := toybox_vendor sh_vendor libbase libcutils ...

Bug: 157967325
Test: m dist vendor-snapshot after setting those in BoardConfig.mk
Change-Id: Iea1ddbe78e143316fb6cb5027de90b9c83252f80
2021-01-06 23:10:41 +09:00
Inseob Kim
5cbfbf4ca7 Merge "Support building mixed versions of sepolicy" 2021-01-06 05:07:05 +00:00
Inseob Kim
fb7c801b67 Support building mixed versions of sepolicy
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: I4e2890c96cab69e60c83c60f8c396cfe049ec05b
2021-01-06 10:41:45 +09:00
Jiyong Park
cddea9b426 Add TARGET_FORCE_APEX_SYMLINK_OPTIMIZATION
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: I261fd4ab2dd8e62ff435306b11168121cbcf662a
2021-01-05 21:03:30 +09:00
Jose Galmes
5cd2547df9 Support for recovery snapshot.
Bug: 171231437
Test: source build/envsetup.sh
Test: ALLOW_MISSING_DEPENDENCIES=true m -j nothing
Change-Id: I6dbcf21ee26c53cd3ac573d118a99d68161aa2c7
2020-12-21 08:32:44 -08:00
Anton Hansson
e47d6e4a8c Merge "Add make support for Aml_abis and Ndk_abis options" 2020-12-16 11:38:49 +00:00
Anton Hansson
5e05b8ef31 Add make support for Aml_abis and Ndk_abis options
Add a new TARGET_ARCH_SUITE which, when set to 'mainline_sdk' or 'ndk',
sets `Aml_abis: true` in soong.variables.

This is required to enable removing the custom soong.variables that
are being maintained for the ndk and mainline sdk builds.

Bug: 174315599
Test: TARGET_ARCH_SUITE=mainline-sdk m nothing; inspect soong.variables
      (ditto for ndk)
Change-Id: Ib651a637457310270840d721cdccf50bede3ee58
2020-12-15 12:46:46 +00:00
Treehugger Robot
dec924e081 Merge "Revert^2 "Always turn on compatible property"" 2020-12-15 12:00:10 +00:00
Mohammad Islam
0a246e5e31 Merge "Add a product flag that will enable compressed APEX on device" 2020-12-09 14:34:42 +00:00
Mohammad Samiul Islam
c87781a020 Add a product flag that will enable compressed APEX on device
The product flag is only defined in this CL. No device has been
configured to use this flag yet.

The flag is overridable using environment variable. This way, developers
can enable APEX compression on various targets.

Bug: 137802149
Test: build/soong/soong_ui.bash --dumpvar-mode PRODUCT_COMPRESSED_APEX #false
Test: export OVERRIDE_PRODUCT_COMPRESSED_APEX \
  build/soong/soong_ui.bash --dumpvar-mode PRODUCT_COMPRESSED_APEX #true
Change-Id: I10e4909258cee9b4670bc3f10ff3a0ad5013c864
2020-12-03 14:58:47 +00:00
JaeMan Park
38e3f08248 Merge "Add java sdk library enforcement flag" 2020-12-02 04:39:08 +00:00
Jingwen Chen
341928ecc5 Remove SOONG, SOONG_BUILD_NINJA, SOONG_IN_MAKE and SOONG_BOOTSTRAP.
These variables appear to be unused since Nougat, when Soong was
invoked through Make. This is no longer the case, since soong_build is
now invoked through soong_ui.

https://cs.android.com/android/platform/superproject/+/android-7.1.2_r36:build/core/soong.mk

Test: TH presubmit
Change-Id: I1cfe63144d559fa0da0e54474ed1e36fb3fa0555
2020-11-23 02:06:57 -05:00
Inseob Kim
2e88158571 Revert^2 "Always turn on compatible property"
This reverts commit facfb54ee4.

Reason for revert: Fixed broken targets

Change-Id: Ia713b08cf15fd356494984964a1e61eaa9991266
2020-11-19 09:48:49 +00:00
Inseob Kim
facfb54ee4 Revert "Always turn on compatible property"
This reverts commit 9994e96c7d.

Reason for revert: broken targets on the internal branch

Change-Id: Ic440fb1ca6ae5774a1d51e8fe1f3724426511841
2020-11-18 11:04:17 +00:00
Inseob Kim
9994e96c7d Always turn on compatible property
It's mandatory for devices launching with Android P or later.
Some makefiles still depend on PRODUCT_COMPATIBLE_PROPERTY, so rather
than aggressively removing all codes, this forces
PRODUCT_COMPATIBLE_PROPERTY to be true.

Bug: 170082975
Test: m
Change-Id: I49dab8d573c21781e6295a8581a5ad2944e165d7
2020-11-17 10:00:40 +00:00