Define step-0 for vintf finalization

Define `vintf` state that have completed vintf finalization only.
Only if FINAL_STATE is 'unfinalized' run the vintf finalization
process to finalize vintf.
The new step-0 only runs the vintf finalization.

Ignore-AOSP-First: trunk-stable changes (b/304316873)

Bug: 318883690
Test: build-step-0.sh && build/soong/soong_ui.bash \
    --make-mode TARGET_PRODUCT=cf_x86_64_phone TARGET_RELEASE=fina_0 \
    TARGET_BUILD_VARIANT=userdebug droid dist
Change-Id: If3525f38204fa546744b9ccf8dc9e63711823abd
This commit is contained in:
Justin Yun
2024-01-31 16:56:10 +09:00
parent 8d72201be9
commit 7c28c2327d
9 changed files with 77 additions and 11 deletions

View File

@@ -6,11 +6,13 @@ This folder contains automation and CI scripts for [finalizing](https://go/andro
1. [Finalize VINTF](./finalize-vintf-resources.sh). Prepare the branch for VINTF release.
1. [Finalize SDK](./finalize-sdk-resources.sh). Prepare the branch for SDK release. SDK contains Android Java APIs and other stable APIs. Commonly referred as a 1st step.
1. [Finalize Android](./finalize-sdk-rel.sh). Mark branch as "REL", i.e. prepares for Android release. Any signed build containing these changes will be considered an official Android Release. Referred as a 2nd finalization step.
1. [Finalize SDK and submit](./step-1.sh). Do Finalize VINTF and Finalize SDK step, create CLs, organize them into topic and send to Gerrit.
1. [Finalize VINTF and submit](./step-0.sh). Do Finalize VINTF step, create CLs, organize them into topic and send to Gerrit.
1. [Finalize SDK and submit](./step-1.sh). Do Finalize SDK step, create CLs, organize them into topic and send to Gerrit.
1. [Finalize Android and submit](./step-2.sh). Do [Finalize Android](./finalize-sdk-rel.sh) step, create CLs, organize them into topic and send to Gerrit.
## CI:
Performed in build targets in Finalization branches.
1. [Finalization Step 0, git_main-fina-0-release](https://android-build.corp.google.com/build_explorer/branch/git_main-fina-0-release). Test Finalize VINTF.
1. [Finalization Step 1, git_main-fina-1-release](https://android-build.corp.google.com/build_explorer/branch/git_main-fina-1-release). Test Finalize VINTF, Finalize SDK.
1. [Finalization Step 2, git_main-fina-2-release](https://android-build.corp.google.com/build_explorer/branch/git_main-fina-2-release). Test Finalize VINTF, Finalize SDK, and [2nd step/Finalize Android](./finalize-sdk-rel.sh). Use [local finalization](./localonly-steps.sh) to build and copy presubmits.
1. [Local finalization steps](./localonly-steps.sh) are done only during local testing or in the CI lab. Normally these steps use artifacts from other builds.

View File

@@ -0,0 +1,17 @@
#!/bin/bash
# Copyright 2024 Google Inc. All rights reserved.
set -ex
function finalize_main_step0() {
local top="$(dirname "$0")"/../../../..
source $top/build/make/tools/finalization/environment.sh
if [ "$FINAL_STATE" = "unfinalized" ] ; then
# VINTF finalization
source $top/build/make/tools/finalization/finalize-vintf-resources.sh
fi;
}
finalize_main_step0

View File

@@ -7,12 +7,16 @@ function finalize_main_step12() {
source $top/build/make/tools/finalization/environment.sh
if [ "$FINAL_STATE" = "unfinalized" ] ; then
# SDK codename -> int
# VINTF finalization
source $top/build/make/tools/finalization/finalize-vintf-resources.sh
fi;
if [ "$FINAL_STATE" = "unfinalized" ] || [ "$FINAL_STATE" = "vintf" ] ; then
# SDK codename -> int
source $top/build/make/tools/finalization/finalize-sdk-resources.sh
fi;
if [ "$FINAL_STATE" = "unfinalized" ] || [ "$FINAL_STATE" = "sdk" ] ; then
if [ "$FINAL_STATE" = "unfinalized" ] || [ "$FINAL_STATE" = "vintf" ] || [ "$FINAL_STATE" = "sdk" ] ; then
# ADB, Platform/Mainline SDKs build and move to prebuilts
source $top/build/make/tools/finalization/localonly-steps.sh

View File

@@ -7,8 +7,12 @@ function finalize_main_step1() {
source $top/build/make/tools/finalization/environment.sh
if [ "$FINAL_STATE" = "unfinalized" ] ; then
# Build finalization artifacts.
# VINTF finalization
source $top/build/make/tools/finalization/finalize-vintf-resources.sh
fi;
if [ "$FINAL_STATE" = "unfinalized" ] || [ "$FINAL_STATE" = "vintf" ] ; then
# Build finalization artifacts.
source $top/build/make/tools/finalization/finalize-sdk-resources.sh
fi;
}

View File

@@ -19,11 +19,14 @@ export FINAL_MAINLINE_EXTENSION='58'
# Options:
# 'unfinalized' - branch is in development state,
# 'sdk' - SDK/API is finalized
# 'vintf' - VINTF is finalized
# 'sdk' - VINTF and SDK/API are finalized
# 'rel' - branch is finalized, switched to REL
export FINAL_STATE='unfinalized'
export BUILD_FROM_SOURCE_STUB=true
# FINAL versions for VINTF
export FINAL_BOARD_API_LEVEL=$(TARGET_RELEASE=fina_1 $top/build/soong/soong_ui.bash --dumpvar-mode RELEASE_BOARD_API_LEVEL)
# TODO(b/323985297): The version must match with that from the release configuration.
# Instead of hardcoding the version here, read it from a release configuration.
export FINAL_BOARD_API_LEVEL='202404'

View File

@@ -14,7 +14,7 @@ function finalize_vintf_resources() {
create_new_compat_matrix
# pre-finalization build target (trunk)
local aidl_m="$top/build/soong/soong_ui.bash --make-mode TARGET_PRODUCT=aosp_arm64 TARGET_RELEASE=trunk TARGET_BUILD_VARIANT=userdebug DIST_DIR=out/dist"
local aidl_m="$top/build/soong/soong_ui.bash --make-mode TARGET_PRODUCT=aosp_arm64 TARGET_RELEASE=fina_0 TARGET_BUILD_VARIANT=userdebug DIST_DIR=out/dist"
AIDL_TRANSITIVE_FREEZE=true $aidl_m aidl-freeze-api
}
@@ -42,7 +42,7 @@ function create_new_compat_matrix() {
fi
# build the targets required before touching the Android.bp/Android.mk files
local build_cmd="$top/build/soong/soong_ui.bash --make-mode TARGET_PRODUCT=aosp_arm64 TARGET_RELEASE=trunk TARGET_BUILD_VARIANT=userdebug DIST_DIR=out/dist"
local build_cmd="$top/build/soong/soong_ui.bash --make-mode TARGET_PRODUCT=aosp_arm64 TARGET_RELEASE=fina_0 TARGET_BUILD_VARIANT=userdebug DIST_DIR=out/dist"
$build_cmd bpfmt
$build_cmd bpmodify
$build_cmd queryview

37
tools/finalization/step-0.sh Executable file
View File

@@ -0,0 +1,37 @@
#!/bin/bash
# Copyright 2024 Google Inc. All rights reserved.
# Script to perform a 0th step of Android Finalization: VINTF finalization, create CLs and upload to Gerrit.
set -ex
function commit_step_0_changes() {
set +e
repo forall -c '\
if [[ $(git status --short) ]]; then
repo start "VINTF-$FINAL_BOARD_API_LEVEL-Finalization" ;
git add -A . ;
git commit -m "Vendor API level $FINAL_BOARD_API_LEVEL is now frozen" \
-m "Ignore-AOSP-First: VINTF $FINAL_BOARD_API_LEVEL Finalization
Bug: $FINAL_BUG_ID
Test: build";
repo upload --cbr --no-verify -o nokeycheck -t -y . ;
fi'
}
function finalize_step_0_main() {
local top="$(dirname "$0")"/../../../..
source $top/build/make/tools/finalization/environment.sh
local m="$top/build/soong/soong_ui.bash --make-mode TARGET_RELEASE=next TARGET_PRODUCT=aosp_arm64 TARGET_BUILD_VARIANT=userdebug"
source $top/build/make/tools/finalization/finalize-vintf-resources.sh
# move all changes to finalization branch/topic and upload to gerrit
commit_step_0_changes
# build to confirm everything is OK
AIDL_FROZEN_REL=true $m
}
finalize_step_0_main

View File

@@ -21,9 +21,8 @@ function finalize_step_1_main() {
local top="$(dirname "$0")"/../../../..
source $top/build/make/tools/finalization/environment.sh
local m="$top/build/soong/soong_ui.bash --make-mode TARGET_PRODUCT=aosp_arm64 TARGET_BUILD_VARIANT=userdebug"
local m="$top/build/soong/soong_ui.bash --make-mode TARGET_RELEASE=next TARGET_PRODUCT=aosp_arm64 TARGET_BUILD_VARIANT=userdebug"
source $top/build/make/tools/finalization/finalize-vintf-resources.sh
source $top/build/make/tools/finalization/finalize-sdk-resources.sh
# move all changes to finalization branch/topic and upload to gerrit

View File

@@ -19,7 +19,7 @@ function finalize_step_2_main() {
local top="$(dirname "$0")"/../../../..
source $top/build/make/tools/finalization/environment.sh
local m="$top/build/soong/soong_ui.bash --make-mode TARGET_PRODUCT=aosp_arm64 TARGET_BUILD_VARIANT=userdebug"
local m="$top/build/soong/soong_ui.bash --make-mode TARGET_RELEASE=next TARGET_PRODUCT=aosp_arm64 TARGET_BUILD_VARIANT=userdebug"
# prebuilts etc
source $top/build/make/tools/finalization/finalize-sdk-rel.sh