From a0ab45384de78795aa9f778e33ae162710e0b14b Mon Sep 17 00:00:00 2001 From: Anton Hansson Date: Mon, 25 Apr 2022 16:29:15 +0100 Subject: [PATCH 1/3] Remove notice file for sdk system image The system image itself is being removed from the sdk zip, so remove the NOTICE file for it at the same time. Bug: 205008975 Test: m sdk sdk_repo dist Merged-In: Ib75b3e5919cd203e58e03efc1cb0a378283b0c34 Change-Id: Ib75b3e5919cd203e58e03efc1cb0a378283b0c34 --- core/Makefile | 4 ---- 1 file changed, 4 deletions(-) diff --git a/core/Makefile b/core/Makefile index 93b3e03af7..d9b4654b9d 100644 --- a/core/Makefile +++ b/core/Makefile @@ -1571,7 +1571,6 @@ ifndef TARGET_BUILD_APPS # TODO These intermediate NOTICE.txt/NOTICE.html files should go into # TARGET_OUT_NOTICE_FILES now that the notice files are gathered from # the src subdirectory. -target_notice_file_txt := $(TARGET_OUT_INTERMEDIATES)/NOTICE.txt kernel_notice_file := $(TARGET_OUT_NOTICE_FILES)/src/kernel.txt winpthreads_notice_file := $(TARGET_OUT_NOTICE_FILES)/src/winpthreads.txt @@ -6825,7 +6824,6 @@ sdk_atree_files += $(atree_dir)/sdk.atree endif deps := \ - $(target_notice_file_txt) \ $(OUT_DOCS)/offline-sdk-timestamp \ $(SDK_METADATA_FILES) \ $(SYMBOLS_ZIP) \ @@ -6882,8 +6880,6 @@ $(INTERNAL_SDK_TARGET): $(deps) -v "TARGET_CPU_ABI=$(TARGET_CPU_ABI)" \ -v "DLL_EXTENSION=$(HOST_SHLIB_SUFFIX)" \ -o $(PRIVATE_DIR) && \ - cp -f $(target_notice_file_txt) \ - $(PRIVATE_DIR)/system-images/android-$(PLATFORM_VERSION)/$(TARGET_CPU_ABI)/NOTICE.txt && \ HOST_OUT_EXECUTABLES=$(HOST_OUT_EXECUTABLES) HOST_OS=$(HOST_OS) \ development/build/tools/sdk_clean.sh $(PRIVATE_DIR) && \ chmod -R ug+rwX $(PRIVATE_DIR) && \ From 09fc47b6ce39c0913a8df8cfe009314b766e4274 Mon Sep 17 00:00:00 2001 From: Anton Hansson Date: Thu, 12 May 2022 08:45:29 +0000 Subject: [PATCH 2/3] Remove unused dependencies from sdk goals The SDK no longer includes system images, so no longer needs to depend on targets that are only relevant for the system images. Remove all the explicit dependencies that end up depending on "everything" but are not included in the sdk zip. Two positive side-effects: - fewer unused things get built (now ~32k targets, down from ~108k) - apexes no longer get built, eliminating the risk of mismatch between module sdk prebuilts and source-built AOSP apexes. There are some potential risks with this CL: - because we no longer forcefully rebuild everything, if there are bugs in dependencies of exising files in the SDK, incremental builds may not rebuild them. - some files that get built into the SDK may be being built as a side-effect of other files included in the SDK, so removing one file may cause another to not get built. The solution to that is to add the file not getting built to ALL_SDK_FILES. Bug: 205008975 Test: m sdk sdk_repo dist && diff sdk.zip before/after (identical) Merged-In: I97284864f66aa88556fbe16864f45b04be97634e Change-Id: I97284864f66aa88556fbe16864f45b04be97634e --- core/Makefile | 26 +------------------------- core/main.mk | 4 ---- 2 files changed, 1 insertion(+), 29 deletions(-) diff --git a/core/Makefile b/core/Makefile index d9b4654b9d..de9fd52c12 100644 --- a/core/Makefile +++ b/core/Makefile @@ -842,10 +842,6 @@ $(INSTALLED_FILES_FILE_ROOT) : $(INTERNAL_ROOT_FILES) $(FILESLIST) $(FILESLIST_U $(call declare-0p-target,$(INSTALLED_FILES_FILE_ROOT)) $(call declare-0p-target,$(INSTALLED_FILES_JSON_ROOT)) -ifeq ($(HOST_OS),linux) -$(call dist-for-goals, sdk sdk_addon, $(INSTALLED_FILES_FILE_ROOT)) -endif - #------------------------------------------------------------------ # dtb ifdef BOARD_INCLUDE_DTB_IN_BOOTIMG @@ -877,9 +873,6 @@ $(INSTALLED_FILES_FILE_RAMDISK) : $(INTERNAL_RAMDISK_FILES) $(FILESLIST) $(FILES $(eval $(call declare-0p-target,$(INSTALLED_FILES_FILE_RAMDISK))) $(eval $(call declare-0p-target,$(INSTALLED_FILES_JSON_RAMDISK))) -ifeq ($(HOST_OS),linux) -$(call dist-for-goals, sdk sdk_addon, $(INSTALLED_FILES_FILE_RAMDISK)) -endif BUILT_RAMDISK_TARGET := $(PRODUCT_OUT)/ramdisk.img ifeq ($(BOARD_RAMDISK_USE_LZ4),true) @@ -3108,10 +3101,6 @@ $(eval $(call declare-0p-target,$(INSTALLED_FILES_JSON))) .PHONY: installed-file-list installed-file-list: $(INSTALLED_FILES_FILE) -ifeq ($(HOST_OS),linux) -$(call dist-for-goals, sdk sdk_addon, $(INSTALLED_FILES_FILE)) -endif - systemimage_intermediates := \ $(call intermediates-dir-for,PACKAGING,systemimage) BUILT_SYSTEMIMAGE := $(systemimage_intermediates)/system.img @@ -6798,8 +6787,6 @@ ATREE_FILES := # if we don't have a real list, then use "everything" ifeq ($(strip $(ATREE_FILES)),) ATREE_FILES := \ - $(ALL_DEFAULT_INSTALLED_MODULES) \ - $(INSTALLED_RAMDISK_TARGET) \ $(ALL_DOCS) \ $(ALL_SDK_FILES) endif @@ -6826,18 +6813,7 @@ endif deps := \ $(OUT_DOCS)/offline-sdk-timestamp \ $(SDK_METADATA_FILES) \ - $(SYMBOLS_ZIP) \ - $(COVERAGE_ZIP) \ - $(APPCOMPAT_ZIP) \ - $(INSTALLED_SYSTEMIMAGE_TARGET) \ - $(INSTALLED_QEMU_SYSTEMIMAGE) \ - $(INSTALLED_QEMU_RAMDISKIMAGE) \ - $(INSTALLED_QEMU_VENDORIMAGE) \ - $(QEMU_VERIFIED_BOOT_PARAMS) \ - $(INSTALLED_USERDATAIMAGE_TARGET) \ - $(INSTALLED_RAMDISK_TARGET) \ - $(INSTALLED_SDK_BUILD_PROP_TARGET) \ - $(INSTALLED_BUILD_PROP_TARGET) \ + $(INSTALLED_SDK_BUILD_PROP_TARGET) \ $(ATREE_FILES) \ $(sdk_atree_files) \ $(HOST_OUT_EXECUTABLES)/atree \ diff --git a/core/main.mk b/core/main.mk index e0efdad61e..c63c6dfde9 100644 --- a/core/main.mk +++ b/core/main.mk @@ -1936,10 +1936,6 @@ ALL_SDK_TARGETS := $(INTERNAL_SDK_TARGET) sdk: $(ALL_SDK_TARGETS) $(call dist-for-goals,sdk, \ $(ALL_SDK_TARGETS) \ - $(SYMBOLS_ZIP) \ - $(SYMBOLS_MAPPING) \ - $(COVERAGE_ZIP) \ - $(APPCOMPAT_ZIP) \ $(INSTALLED_BUILD_PROP_TARGET) \ ) endif From 28f089d9b0c8f61e865a9e0e6131b7a42db43ab1 Mon Sep 17 00:00:00 2001 From: Anton Hansson Date: Thu, 12 May 2022 18:41:40 +0000 Subject: [PATCH 3/3] Slim down the sdk product The sdk_phone_armv7 product is designed to build system images, which adds unnecessary dependencies and enables unnecessary checks (such as verifying dexpreopt artifacts). Bug: 205008975 Test: m sdk sdk_repo dist && diff android-sdk.zip (only build.prop diffs) Merged-In: I940655c39a3ae58839521416abafaf461df44921 Change-Id: I940655c39a3ae58839521416abafaf461df44921 --- target/product/sdk.mk | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/target/product/sdk.mk b/target/product/sdk.mk index 96d8cc94e1..fa7e1ad381 100644 --- a/target/product/sdk.mk +++ b/target/product/sdk.mk @@ -14,8 +14,11 @@ # limitations under the License. # -# Don't modify this file - It's just an alias! +# This is a simple product that uses configures the minimum amount +# needed to build the SDK (without the emulator). -$(call inherit-product, $(SRC_TARGET_DIR)/product/sdk_phone_armv7.mk) +$(call inherit-product, $(SRC_TARGET_DIR)/product/languages_default.mk) PRODUCT_NAME := sdk +PRODUCT_BRAND := Android +PRODUCT_DEVICE := mainline_x86