Skip to content

Commit

Permalink
Merge tag 'android-15.0.0_r6' into staging/lineage-22.0_merge-android…
Browse files Browse the repository at this point in the history
…-15.0.0_r6

Android 15.0.0 Release 6 (AP4A.241205.013)

# -----BEGIN PGP SIGNATURE-----
#
# iF0EABECAB0WIQRDQNE1cO+UXoOBCWTorT+BmrEOeAUCZ1IssQAKCRDorT+BmrEO
# eBrKAJ9FmL5mDOHG8U+CMKbPhMhF6MfpaQCdERo5ad5GLy9WXkX8q7C7Xy03FVs=
# =dG9F
# -----END PGP SIGNATURE-----
# gpg: Signature made Fri Dec  6 00:44:01 2024 EET
# gpg:                using DSA key 4340D13570EF945E83810964E8AD3F819AB10E78
# gpg: Good signature from "The Android Open Source Project <[email protected]>" [marginal]
# gpg: [email protected]: Verified 2457 signatures in the past
#      3 years.  Encrypted 4 messages in the past 2 years.
# gpg: WARNING: This key is not certified with sufficiently trusted signatures!
# gpg:          It is not certain that the signature belongs to the owner.
# Primary key fingerprint: 4340 D135 70EF 945E 8381  0964 E8AD 3F81 9AB1 0E78

# By Android Build Coastguard Worker (138) and others
# Via Automerger Merge Worker (847) and others
* tag 'android-15.0.0_r6': (472 commits)
  Version bump to AP4A.241205.013 [core/build_id.mk]
  Version bump to AP4A.241205.012 [core/build_id.mk]
  Version bump to AP4A.241205.011 [core/build_id.mk]
  Version bump to AP4A.241205.010 [core/build_id.mk]
  Version bump to AP4A.241205.009 [core/build_id.mk]
  Version bump to AP4A.241205.004.X1 [core/build_id.mk]
  Revert^3 "Use -target-feature for MTE"
  Version bump to AP4A.241205.007 [core/build_id.mk]
  Version bump to AP4A.241205.006 [core/build_id.mk]
  Version bump to AP4A.241205.005.X1 [core/build_id.mk]
  Version bump to AP4A.241205.005 [core/build_id.mk]
  Version bump to AP4A.241205.004.E1 [core/build_id.mk]
  Version bump to AP4A.241205.004.W1 [core/build_id.mk]
  Version bump to AP4A.241205.004 [core/build_id.mk]
  Version bump to AP4A.241205.003 [core/build_id.mk]
  Version bump to AP4A.241205.002 [core/build_id.mk]
  Version bump to AP4A.241205.001 [core/build_id.mk]
  Version bump to AP4A.240925.023 [core/build_id.mk]
  Version bump to AP4A.240925.022 [core/build_id.mk]
  Version bump to AP4A.240925.021 [core/build_id.mk]
  ...

 Conflicts:
	core/Makefile
	core/android_soong_config_vars.mk
	core/build_id.mk
	core/config.mk
	core/soong_config.mk
	core/soong_extra_config.mk
	core/sysprop.mk
	target/product/base_product.mk
	target/product/base_vendor.mk

Change-Id: I53f95787079151ab3286df9e72ac53a17a86a863
  • Loading branch information
mikeNG committed Dec 10, 2024
2 parents a618737 + 6407875 commit 73d1630
Show file tree
Hide file tree
Showing 234 changed files with 10,757 additions and 2,357 deletions.
11 changes: 3 additions & 8 deletions Changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,9 @@ within a product configuration .mk file, board config .mk file, or buildspec.mk.
The path set when running builds now makes the `python` executable point to python 3,
whereas on previous versions it pointed to python 2. If you still have python 2 scripts,
you can change the shebang line to use `python2` explicitly. This only applies for
scripts run directly from makefiles, or from soong genrules. This behavior can be
temporarily overridden by setting the `BUILD_BROKEN_PYTHON_IS_PYTHON2` environment
variable to `true`. It's only an environment variable and not a product config variable
because product config sometimes calls python code.

In addition, `python_*` soong modules no longer allow python 2. This can be temporarily
overridden by setting the `BUILD_BROKEN_USES_SOONG_PYTHON2_MODULES` product configuration
variable to `true`.
scripts run directly from makefiles, or from soong genrules.

In addition, `python_*` soong modules no longer allow python 2.

Python 2 is slated for complete removal in V.

Expand Down
3 changes: 3 additions & 0 deletions CleanSpec.mk
Original file line number Diff line number Diff line change
Expand Up @@ -791,6 +791,9 @@ $(call add-clean-step, find $(OUT_DIR) -type f -name "*.jar" -print0 | xargs -0
$(call add-clean-step, rm -f $(PRODUCT_OUT)/dexpreopt_config/dexpreopt.config)
$(call add-clean-step, rm -f $(PRODUCT_OUT)/dexpreopt_config/dexpreopt_soong.config)

# Clear out Soong .intermediates directory regarding removal of hashed subdir
$(call add-clean-step, rm -rf $(OUT_DIR)/soong/.intermediates)

# ************************************************
# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
# ************************************************
26 changes: 26 additions & 0 deletions ci/Android.bp
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,37 @@ python_test_host {
},
}

python_test_host {
name: "optimized_targets_test",
main: "optimized_targets_test.py",
pkg_path: "testdata",
srcs: [
"optimized_targets_test.py",
],
libs: [
"build_test_suites",
"pyfakefs",
],
test_options: {
unit_test: true,
},
data: [
":py3-cmd",
],
version: {
py3: {
embedded_launcher: true,
},
},
}

python_library_host {
name: "build_test_suites",
srcs: [
"build_test_suites.py",
"optimized_targets.py",
"test_mapping_module_retriever.py",
"build_context.py",
],
}

Expand Down
64 changes: 64 additions & 0 deletions ci/build_context.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Copyright 2024, 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.

"""Container class for build context with utility functions."""

import re


class BuildContext:

def __init__(self, build_context_dict: dict[str, any]):
self.enabled_build_features = set()
for opt in build_context_dict.get('enabledBuildFeatures', []):
self.enabled_build_features.add(opt.get('name'))
self.test_infos = set()
for test_info_dict in build_context_dict.get('testContext', dict()).get(
'testInfos', []
):
self.test_infos.add(self.TestInfo(test_info_dict))

def build_target_used(self, target: str) -> bool:
return any(test.build_target_used(target) for test in self.test_infos)

class TestInfo:

_DOWNLOAD_OPTS = {
'test-config-only-zip',
'test-zip-file-filter',
'extra-host-shared-lib-zip',
'sandbox-tests-zips',
'additional-files-filter',
'cts-package-name',
}

def __init__(self, test_info_dict: dict[str, any]):
self.is_test_mapping = False
self.test_mapping_test_groups = set()
self.file_download_options = set()
for opt in test_info_dict.get('extraOptions', []):
key = opt.get('key')
if key == 'test-mapping-test-group':
self.is_test_mapping = True
self.test_mapping_test_groups.update(opt.get('values', set()))

if key in self._DOWNLOAD_OPTS:
self.file_download_options.update(opt.get('values', set()))

def build_target_used(self, target: str) -> bool:
# For all of a targets' outputs, check if any of the regexes used by tests
# to download artifacts would match it. If any of them do then this target
# is necessary.
regex = r'\b(%s)\b' % re.escape(target)
return any(re.search(regex, opt) for opt in self.file_download_options)
25 changes: 25 additions & 0 deletions ci/build_metadata
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#/bin/bash

# Copyright 2024, 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.

set -ex

export TARGET_PRODUCT=aosp_arm64
export TARGET_RELEASE=trunk_staging
export TARGET_BUILD_VARIANT=eng

build/soong/bin/m dist \
all_teams

47 changes: 37 additions & 10 deletions ci/build_test_suites.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@
import subprocess
import sys
from typing import Callable
from build_context import BuildContext
import optimized_targets


REQUIRED_ENV_VARS = frozenset(['TARGET_PRODUCT', 'TARGET_RELEASE', 'TOP'])
SOONG_UI_EXE_REL_PATH = 'build/soong/soong_ui.bash'
LOG_PATH = 'logs/build_test_suites.log'


class Error(Exception):
Expand All @@ -53,7 +55,7 @@ class BuildPlanner:

def __init__(
self,
build_context: dict[str, any],
build_context: BuildContext,
args: argparse.Namespace,
target_optimizations: dict[str, optimized_targets.OptimizedBuildTarget],
):
Expand All @@ -63,12 +65,17 @@ def __init__(

def create_build_plan(self):

if 'optimized_build' not in self.build_context['enabled_build_features']:
if 'optimized_build' not in self.build_context.enabled_build_features:
return BuildPlan(set(self.args.extra_targets), set())

build_targets = set()
packaging_functions = set()
packaging_commands_getters = []
for target in self.args.extra_targets:
if self._unused_target_exclusion_enabled(
target
) and not self.build_context.build_target_used(target):
continue

target_optimizer_getter = self.target_optimizations.get(target, None)
if not target_optimizer_getter:
build_targets.add(target)
Expand All @@ -78,15 +85,23 @@ def create_build_plan(self):
target, self.build_context, self.args
)
build_targets.update(target_optimizer.get_build_targets())
packaging_functions.add(target_optimizer.package_outputs)
packaging_commands_getters.append(
target_optimizer.get_package_outputs_commands
)

return BuildPlan(build_targets, packaging_functions)
return BuildPlan(build_targets, packaging_commands_getters)

def _unused_target_exclusion_enabled(self, target: str) -> bool:
return (
f'{target}_unused_exclusion'
in self.build_context.enabled_build_features
)


@dataclass(frozen=True)
class BuildPlan:
build_targets: set[str]
packaging_functions: set[Callable[..., None]]
packaging_commands_getters: list[Callable[[], list[list[str]]]]


def build_test_suites(argv: list[str]) -> int:
Expand All @@ -100,7 +115,7 @@ def build_test_suites(argv: list[str]) -> int:
"""
args = parse_args(argv)
check_required_env()
build_context = load_build_context()
build_context = BuildContext(load_build_context())
build_planner = BuildPlanner(
build_context, args, optimized_targets.OPTIMIZED_BUILD_TARGETS
)
Expand Down Expand Up @@ -154,7 +169,7 @@ def load_build_context():


def empty_build_context():
return {'enabled_build_features': []}
return {'enabledBuildFeatures': []}


def execute_build_plan(build_plan: BuildPlan):
Expand All @@ -168,8 +183,12 @@ def execute_build_plan(build_plan: BuildPlan):
except subprocess.CalledProcessError as e:
raise BuildFailureError(e.returncode) from e

for packaging_function in build_plan.packaging_functions:
packaging_function()
for packaging_commands_getter in build_plan.packaging_commands_getters:
try:
for packaging_command in packaging_commands_getter():
run_command(packaging_command)
except subprocess.CalledProcessError as e:
raise BuildFailureError(e.returncode) from e


def get_top() -> pathlib.Path:
Expand All @@ -181,4 +200,12 @@ def run_command(args: list[str], stdout=None):


def main(argv):
dist_dir = os.environ.get('DIST_DIR')
if dist_dir:
log_file = pathlib.Path(dist_dir) / LOG_PATH
logging.basicConfig(
level=logging.DEBUG,
format='%(asctime)s %(levelname)s %(message)s',
filename=log_file,
)
sys.exit(build_test_suites(argv))
Loading

0 comments on commit 73d1630

Please sign in to comment.