From bbd95df172f8712057d93109d3d145624b26f324 Mon Sep 17 00:00:00 2001 From: Anton Hansson Date: Wed, 25 Nov 2020 11:51:49 +0000 Subject: Add devices suitable for single-arch module builds Prior to this the generic_* devices were typically used for this purpose. There are a few reasons to create new specific ones: - the generic_arm64 device has a hack specifically for building multi-arch packages that we want to avoid - the generic_* devices include a bunch of emulator config that does not make sense for unbundled builds Bug: 172256440 Test: verify unbundled builds migrated from generic_* don't change Merged-In: Ia937461aa24a5d5b542f8688a1b71ac3fdeb596b Change-Id: Ia937461aa24a5d5b542f8688a1b71ac3fdeb596b --- target/board/module_arm/BoardConfig.mk | 20 ++++++++++++++++++++ target/board/module_arm/README.md | 2 ++ target/board/module_arm/device.mk | 18 ++++++++++++++++++ target/board/module_arm64/BoardConfig.mk | 25 +++++++++++++++++++++++++ target/board/module_arm64/README.md | 3 +++ target/board/module_arm64/device.mk | 19 +++++++++++++++++++ target/board/module_x86/BoardConfig.mk | 18 ++++++++++++++++++ target/board/module_x86/README.md | 2 ++ target/board/module_x86/device.mk | 18 ++++++++++++++++++ target/board/module_x86_64/BoardConfig.mk | 22 ++++++++++++++++++++++ target/board/module_x86_64/README.md | 3 +++ target/board/module_x86_64/device.mk | 19 +++++++++++++++++++ 12 files changed, 169 insertions(+) create mode 100644 target/board/module_arm/BoardConfig.mk create mode 100644 target/board/module_arm/README.md create mode 100644 target/board/module_arm/device.mk create mode 100644 target/board/module_arm64/BoardConfig.mk create mode 100644 target/board/module_arm64/README.md create mode 100644 target/board/module_arm64/device.mk create mode 100644 target/board/module_x86/BoardConfig.mk create mode 100644 target/board/module_x86/README.md create mode 100644 target/board/module_x86/device.mk create mode 100644 target/board/module_x86_64/BoardConfig.mk create mode 100644 target/board/module_x86_64/README.md create mode 100644 target/board/module_x86_64/device.mk diff --git a/target/board/module_arm/BoardConfig.mk b/target/board/module_arm/BoardConfig.mk new file mode 100644 index 0000000000..565efc8425 --- /dev/null +++ b/target/board/module_arm/BoardConfig.mk @@ -0,0 +1,20 @@ +# Copyright (C) 2020 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +TARGET_ARCH := arm +TARGET_ARCH_VARIANT := armv7-a-neon +TARGET_CPU_VARIANT := generic +TARGET_CPU_ABI := armeabi-v7a +TARGET_CPU_ABI2 := armeabi diff --git a/target/board/module_arm/README.md b/target/board/module_arm/README.md new file mode 100644 index 0000000000..b893573bd1 --- /dev/null +++ b/target/board/module_arm/README.md @@ -0,0 +1,2 @@ +This device is suitable for an unbundled module targeted specifically to an arm +device. diff --git a/target/board/module_arm/device.mk b/target/board/module_arm/device.mk new file mode 100644 index 0000000000..7cac5f8430 --- /dev/null +++ b/target/board/module_arm/device.mk @@ -0,0 +1,18 @@ +# +# Copyright (C) 2020 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +$(call inherit-product, build/make/target/product/bootclasspath.mk) +$(call inherit-product, build/make/target/product/languages_default.mk) diff --git a/target/board/module_arm64/BoardConfig.mk b/target/board/module_arm64/BoardConfig.mk new file mode 100644 index 0000000000..66e3792640 --- /dev/null +++ b/target/board/module_arm64/BoardConfig.mk @@ -0,0 +1,25 @@ +# Copyright (C) 2020 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +TARGET_ARCH := arm64 +TARGET_ARCH_VARIANT := armv8-a +TARGET_CPU_VARIANT := generic +TARGET_CPU_ABI := arm64-v8a + +TARGET_2ND_ARCH := arm +TARGET_2ND_ARCH_VARIANT := armv8-a +TARGET_2ND_CPU_ABI := armeabi-v7a +TARGET_2ND_CPU_ABI2 := armeabi +TARGET_2ND_CPU_VARIANT := generic diff --git a/target/board/module_arm64/README.md b/target/board/module_arm64/README.md new file mode 100644 index 0000000000..cb36fbf258 --- /dev/null +++ b/target/board/module_arm64/README.md @@ -0,0 +1,3 @@ +This device is suitable for an unbundled module targeted specifically to an +arm64 device. 32 bit binaries built with this product will not be suitable for a +32-bit arm device. diff --git a/target/board/module_arm64/device.mk b/target/board/module_arm64/device.mk new file mode 100644 index 0000000000..9065d4b66d --- /dev/null +++ b/target/board/module_arm64/device.mk @@ -0,0 +1,19 @@ +# +# Copyright (C) 2020 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +$(call inherit-product, build/make/target/product/bootclasspath.mk) +$(call inherit-product, build/make/target/product/core_64_bit.mk) +$(call inherit-product, build/make/target/product/languages_default.mk) diff --git a/target/board/module_x86/BoardConfig.mk b/target/board/module_x86/BoardConfig.mk new file mode 100644 index 0000000000..af3fffd067 --- /dev/null +++ b/target/board/module_x86/BoardConfig.mk @@ -0,0 +1,18 @@ +# Copyright (C) 2020 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +TARGET_CPU_ABI := x86 +TARGET_ARCH := x86 +TARGET_ARCH_VARIANT := x86 diff --git a/target/board/module_x86/README.md b/target/board/module_x86/README.md new file mode 100644 index 0000000000..10866b7c5f --- /dev/null +++ b/target/board/module_x86/README.md @@ -0,0 +1,2 @@ +This device is suitable for an unbundled module targeted specifically to an +x86 device. diff --git a/target/board/module_x86/device.mk b/target/board/module_x86/device.mk new file mode 100644 index 0000000000..7cac5f8430 --- /dev/null +++ b/target/board/module_x86/device.mk @@ -0,0 +1,18 @@ +# +# Copyright (C) 2020 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +$(call inherit-product, build/make/target/product/bootclasspath.mk) +$(call inherit-product, build/make/target/product/languages_default.mk) diff --git a/target/board/module_x86_64/BoardConfig.mk b/target/board/module_x86_64/BoardConfig.mk new file mode 100644 index 0000000000..1ada02729e --- /dev/null +++ b/target/board/module_x86_64/BoardConfig.mk @@ -0,0 +1,22 @@ +# Copyright (C) 2020 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +TARGET_CPU_ABI := x86_64 +TARGET_ARCH := x86_64 +TARGET_ARCH_VARIANT := x86_64 + +TARGET_2ND_CPU_ABI := x86 +TARGET_2ND_ARCH := x86 +TARGET_2ND_ARCH_VARIANT := x86_64 diff --git a/target/board/module_x86_64/README.md b/target/board/module_x86_64/README.md new file mode 100644 index 0000000000..3377baad2a --- /dev/null +++ b/target/board/module_x86_64/README.md @@ -0,0 +1,3 @@ +This device is suitable for an unbundled module targeted specifically to an +x86_64 device. 32 bit binaries built with this product will not be suitable for +a 32-bit x86 device. diff --git a/target/board/module_x86_64/device.mk b/target/board/module_x86_64/device.mk new file mode 100644 index 0000000000..9065d4b66d --- /dev/null +++ b/target/board/module_x86_64/device.mk @@ -0,0 +1,19 @@ +# +# Copyright (C) 2020 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +$(call inherit-product, build/make/target/product/bootclasspath.mk) +$(call inherit-product, build/make/target/product/core_64_bit.mk) +$(call inherit-product, build/make/target/product/languages_default.mk) -- cgit v1.2.3 From ba9a28bee20206be1a679c3d049883ff1ff16741 Mon Sep 17 00:00:00 2001 From: Patrice Arruda Date: Mon, 28 Sep 2020 21:52:15 +0000 Subject: Source rbesetup.sh from any location inside of a repo directory. The current rbesetup.sh has to be source from the root directory of the checked out repo since it has a relative path to the sourced build/envsetup.sh script. A function was written in rbesetup.sh script to source the rbesetup.sh script anywhere inside of a checked out repo. Added additional error checking to validate the envsetup.sh is available and not to continue sourcing the script if envsetup.sh script is not found. Fixes: b/169438960 Test: Sourced the rbesetup script from * external directory * inside of a symlink * outside of repo (sourcing fails which is correct) * root repo Change-Id: I2db66a444074adca4d4ab87b8786e9044a3646f8 Merged-In: I2db66a444074adca4d4ab87b8786e9044a3646f8 --- rbesetup.sh | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/rbesetup.sh b/rbesetup.sh index 5781f05e4c..a8cb8ed35c 100644 --- a/rbesetup.sh +++ b/rbesetup.sh @@ -1,4 +1,32 @@ -source build/envsetup.sh +function _source_env_setup_script() { + local -r ENV_SETUP_SCRIPT="build/make/envsetup.sh" + local -r TOP_DIR=$( + while [[ ! -f "${ENV_SETUP_SCRIPT}" ]] && [[ "${PWD}" != "/" ]]; do + \cd .. + done + if [[ -f "${ENV_SETUP_SCRIPT}" ]]; then + echo "$(PWD= /bin/pwd -P)" + fi + ) + + local -r FULL_PATH_ENV_SETUP_SCRIPT="${TOP_DIR}/${ENV_SETUP_SCRIPT}" + if [[ ! -f "${FULL_PATH_ENV_SETUP_SCRIPT}" ]]; then + echo "ERROR: Unable to source ${ENV_SETUP_SCRIPT}" + return 1 + fi + + # Need to change directory to the repo root so vendor scripts can be sourced + # as well. + local -r CUR_DIR=$PWD + \cd "${TOP_DIR}" + source "${FULL_PATH_ENV_SETUP_SCRIPT}" + \cd "${CUR_DIR}" +} + +# This function needs to run first as the remaining defining functions may be +# using the envsetup.sh defined functions. +_source_env_setup_script || return + # This function prefixes the given command with appropriate variables needed # for the build to be executed with RBE. function use_rbe() { @@ -25,7 +53,7 @@ function use_rbe() { # ANDROID_ENABLE_METRICS_UPLOAD. function _export_metrics_uploader() { local uploader_path="$(gettop)/vendor/google/misc/metrics_uploader_prebuilt/metrics_uploader.sh" - if [ -x "${uploader_path}" ]; then + if [[ -x "${uploader_path}" ]]; then export ANDROID_ENABLE_METRICS_UPLOAD="${uploader_path}" fi } -- cgit v1.2.3 From a92f3e0804c5c758cd4c9f685479a9ce959a3de5 Mon Sep 17 00:00:00 2001 From: Kousik Kumar Date: Tue, 24 Nov 2020 10:55:47 -0500 Subject: Use unified cas uploads / downloads This is to deduplciate uploads and downloads when running builds with RBE. Especially useful for certain Java / R8 / D8 actions that have JAR files as common inputs. Bug: b/170699893 Change-Id: I0459d4e5c89bd93e5c0c53195fdabccabec08674 Merged-In: I0459d4e5c89bd93e5c0c53195fdabccabec08674 --- rbesetup.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/rbesetup.sh b/rbesetup.sh index a8cb8ed35c..3e78a57262 100644 --- a/rbesetup.sh +++ b/rbesetup.sh @@ -63,6 +63,7 @@ function _set_rbe_vars() { unset USE_GOMA export USE_RBE="true" export RBE_CXX_EXEC_STRATEGY="remote_local_fallback" + export RBE_use_unified_cas_ops="true" export RBE_JAVAC=1 export RBE_R8=1 export RBE_D8=1 -- cgit v1.2.3 From 524428a647f67b498756f50546a5f26f5eb1a14c Mon Sep 17 00:00:00 2001 From: Kousik Kumar Date: Wed, 25 Nov 2020 12:14:16 -0500 Subject: Switch default execution strategy to racing for developer builds This is to efficiently use both local and remote resources when using RBE for Android developers. Bug: b/170699893 Change-Id: I46bc3ff9c0d8d08e8f3aaa15076eb606737355af Merged-In: I46bc3ff9c0d8d08e8f3aaa15076eb606737355af --- rbesetup.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rbesetup.sh b/rbesetup.sh index 3e78a57262..da257b9946 100644 --- a/rbesetup.sh +++ b/rbesetup.sh @@ -62,7 +62,10 @@ function _export_metrics_uploader() { function _set_rbe_vars() { unset USE_GOMA export USE_RBE="true" - export RBE_CXX_EXEC_STRATEGY="remote_local_fallback" + export RBE_CXX_EXEC_STRATEGY="racing" + export RBE_JAVAC_EXEC_STRATEGY="racing" + export RBE_R8_EXEC_STRATEGY="racing" + export RBE_D8_EXEC_STRATEGY="racing" export RBE_use_unified_cas_ops="true" export RBE_JAVAC=1 export RBE_R8=1 -- cgit v1.2.3 From 9c4665257c947d57783d6593dbd33e4c686419fc Mon Sep 17 00:00:00 2001 From: Paul Scovanner Date: Fri, 8 Jan 2021 21:53:50 +0000 Subject: Update Security String to 2021-03-05 Bug: 177091143 Change-Id: I6d6542306c51ac1682f02cbce6701688d2bdbea2 --- core/version_defaults.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/version_defaults.mk b/core/version_defaults.mk index e610490f44..9c7ac2c8f5 100644 --- a/core/version_defaults.mk +++ b/core/version_defaults.mk @@ -240,7 +240,7 @@ ifndef PLATFORM_SECURITY_PATCH # It must be of the form "YYYY-MM-DD" on production devices. # It must match one of the Android Security Patch Level strings of the Public Security Bulletins. # If there is no $PLATFORM_SECURITY_PATCH set, keep it empty. - PLATFORM_SECURITY_PATCH := 2021-02-05 + PLATFORM_SECURITY_PATCH := 2021-03-05 endif .KATI_READONLY := PLATFORM_SECURITY_PATCH -- cgit v1.2.3 From 0e3ba7d2f7cd24ce28ea7517d64c29d0ce70c73e Mon Sep 17 00:00:00 2001 From: Paul Scovanner Date: Mon, 11 Jan 2021 22:24:53 +0000 Subject: Update Security String to 2021-03-01 Bug: 177091143 Change-Id: I7cfed298cb518d150ea1f944b57504f9b4578a7b Merged-In: I6d6542306c51ac1682f02cbce6701688d2bdbea2 --- core/version_defaults.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/version_defaults.mk b/core/version_defaults.mk index 07f19ddc50..f99e80682a 100644 --- a/core/version_defaults.mk +++ b/core/version_defaults.mk @@ -181,7 +181,7 @@ ifndef PLATFORM_SECURITY_PATCH # It must be of the form "YYYY-MM-DD" on production devices. # It must match one of the Android Security Patch Level strings of the Public Security Bulletins. # If there is no $PLATFORM_SECURITY_PATCH set, keep it empty. - PLATFORM_SECURITY_PATCH := 2021-02-01 + PLATFORM_SECURITY_PATCH := 2021-03-01 endif ifndef PLATFORM_BASE_OS -- cgit v1.2.3 From c8e4513fb03c8024f8e435643b8c5090af38ff69 Mon Sep 17 00:00:00 2001 From: Ulya Trafimovich Date: Mon, 11 Jan 2021 16:42:21 +0000 Subject: Initialize DEX_PREOPT_DEFAULT based on global dexpreopt settings. Bug: 177214554 Test: lunch cf_x86_phone-userdebug && m Test: Ensure that `find out -name dexpreopt.config` lists before and after the fix are identical (for target cf_x86_phone-userdebug). Test: TARGET_PRODUCT=mainline_modules_x86_64 \ TARGET_BUILD_VARIANT=userdebug \ build/soong/soong_ui.bash --make-mode UipbUtil Merged-In: I28b38c08ad570d53dc679f9b42975545d457416e Change-Id: I28b38c08ad570d53dc679f9b42975545d457416e (cherry picked from commit e245e00d7bf0db727958f14039efc043263e2d38) --- core/dex_preopt_config.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/dex_preopt_config.mk b/core/dex_preopt_config.mk index ccf53f5229..c154f56bcf 100644 --- a/core/dex_preopt_config.mk +++ b/core/dex_preopt_config.mk @@ -1,7 +1,7 @@ DEX_PREOPT_CONFIG := $(SOONG_OUT_DIR)/dexpreopt.config # The default value for LOCAL_DEX_PREOPT -DEX_PREOPT_DEFAULT ?= true +DEX_PREOPT_DEFAULT ?= $(ENABLE_PREOPT) # The default filter for which files go into the system_other image (if it is # being used). Note that each pattern p here matches both '/

' and /system/

'. -- cgit v1.2.3 From c0423c8dae0e571e90d06cdced6c70a67d91cbf5 Mon Sep 17 00:00:00 2001 From: Anton Hansson Date: Wed, 13 Jan 2021 09:32:48 +0000 Subject: Use 64 bit binder in module builds Add a new BoardConfigModuleCommon for settings of this sort. Bug: 176840868 Test: forrest module coverage build Change-Id: Ie62261ecc0f0967f677a890a382fa1da060f7ff2 --- target/board/BoardConfigModuleCommon.mk | 6 ++++++ target/board/module_arm/BoardConfig.mk | 2 ++ target/board/module_arm64/BoardConfig.mk | 2 ++ target/board/module_x86/BoardConfig.mk | 2 ++ target/board/module_x86_64/BoardConfig.mk | 2 ++ 5 files changed, 14 insertions(+) create mode 100644 target/board/BoardConfigModuleCommon.mk diff --git a/target/board/BoardConfigModuleCommon.mk b/target/board/BoardConfigModuleCommon.mk new file mode 100644 index 0000000000..24c01a58ef --- /dev/null +++ b/target/board/BoardConfigModuleCommon.mk @@ -0,0 +1,6 @@ +# BoardConfigModuleCommon.mk +# +# Common compile-time settings for module builds. + +# Required for all module devices. +TARGET_USES_64_BIT_BINDER := true diff --git a/target/board/module_arm/BoardConfig.mk b/target/board/module_arm/BoardConfig.mk index 565efc8425..3f35c060e1 100644 --- a/target/board/module_arm/BoardConfig.mk +++ b/target/board/module_arm/BoardConfig.mk @@ -13,6 +13,8 @@ # limitations under the License. # +include build/make/target/board/BoardConfigModuleCommon.mk + TARGET_ARCH := arm TARGET_ARCH_VARIANT := armv7-a-neon TARGET_CPU_VARIANT := generic diff --git a/target/board/module_arm64/BoardConfig.mk b/target/board/module_arm64/BoardConfig.mk index 66e3792640..3700056da3 100644 --- a/target/board/module_arm64/BoardConfig.mk +++ b/target/board/module_arm64/BoardConfig.mk @@ -13,6 +13,8 @@ # limitations under the License. # +include build/make/target/board/BoardConfigModuleCommon.mk + TARGET_ARCH := arm64 TARGET_ARCH_VARIANT := armv8-a TARGET_CPU_VARIANT := generic diff --git a/target/board/module_x86/BoardConfig.mk b/target/board/module_x86/BoardConfig.mk index af3fffd067..a93ac9779c 100644 --- a/target/board/module_x86/BoardConfig.mk +++ b/target/board/module_x86/BoardConfig.mk @@ -13,6 +13,8 @@ # limitations under the License. # +include build/make/target/board/BoardConfigModuleCommon.mk + TARGET_CPU_ABI := x86 TARGET_ARCH := x86 TARGET_ARCH_VARIANT := x86 diff --git a/target/board/module_x86_64/BoardConfig.mk b/target/board/module_x86_64/BoardConfig.mk index 1ada02729e..1ed3be0ba6 100644 --- a/target/board/module_x86_64/BoardConfig.mk +++ b/target/board/module_x86_64/BoardConfig.mk @@ -13,6 +13,8 @@ # limitations under the License. # +include build/make/target/board/BoardConfigModuleCommon.mk + TARGET_CPU_ABI := x86_64 TARGET_ARCH := x86_64 TARGET_ARCH_VARIANT := x86_64 -- cgit v1.2.3