From c9ec59c72a1fe9a0b1ee0d5b064f298dca1da150 Mon Sep 17 00:00:00 2001 From: Ulya Trafimovich Date: Thu, 25 Nov 2021 12:41:47 +0000 Subject: [PATCH] Sort PRODUCT_APEX_BOOT_JARS automatically. This is a follow-up CL for https://r.android.com/1900565. This is needed because product makefiles may need to add their own APEX boot jars, and they cannot insert them in the correct alphabetical order on the list. So it needs to be sorted automatically. Do this after processing all product makefiles and populating the variable, but before passing it to Soong. Bug: 207474880 Test: lunch aosp_cf_x86_64_phone-userdebug && launch_cvd # cuttlefish device boots successfully Change-Id: I86b58ef8aeac595e401d872f59a2936a67bedeec --- core/product_config.mk | 9 +++++---- target/product/default_art_config.mk | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/core/product_config.mk b/core/product_config.mk index cf92924dfc..ae0efe2ff8 100644 --- a/core/product_config.mk +++ b/core/product_config.mk @@ -320,10 +320,11 @@ PRODUCT_SYSTEM_SERVER_JARS += $(PRODUCT_SYSTEM_SERVER_JARS_EXTRA) PRODUCT_SYSTEM_SERVER_JARS := $(call qualify-platform-jars,$(PRODUCT_SYSTEM_SERVER_JARS)) -# Sort APEX system server jars. We use deterministic alphabetical order when -# constructing SYSTEMSERVERCLASSPATH definition on device after a Mainline -# update. Enforce it in the build system as well to avoid recompiling everything -# after an update due a change in SYSTEMSERVERCLASSPATH order. +# Sort APEX boot and system server jars. We use deterministic alphabetical order +# when constructing BOOTCLASSPATH and SYSTEMSERVERCLASSPATH definition on device +# after an update. Enforce it in the build system as well to avoid recompiling +# everything after an update due a change in the order. +PRODUCT_APEX_BOOT_JARS := $(sort $(PRODUCT_APEX_BOOT_JARS)) PRODUCT_APEX_SYSTEM_SERVER_JARS := $(sort $(PRODUCT_APEX_SYSTEM_SERVER_JARS)) ifndef PRODUCT_SYSTEM_NAME diff --git a/target/product/default_art_config.mk b/target/product/default_art_config.mk index 5e2021870d..e988d0067b 100644 --- a/target/product/default_art_config.mk +++ b/target/product/default_art_config.mk @@ -65,7 +65,7 @@ PRODUCT_APEX_BOOT_JARS := \ com.android.tethering:framework-tethering \ com.android.wifi:framework-wifi -# APEX system server jars. The list will be sorted automatically. +# APEX system server jars. Keep the list sorted by module names and then library names. PRODUCT_APEX_SYSTEM_SERVER_JARS := \ com.android.appsearch:service-appsearch \ com.android.art:service-art \