Revert "Add out/partitions_were_clean_at_start_of_build.txt"
Revert submission 2773149-partition_file_list_check Reason for revert: b/305103467, b/305103783, b/305103468 Reverted changes: /q/submissionid:2773149-partition_file_list_check Change-Id: I4116fe908cc914f41dc1bf7e950acb32bc546995
This commit is contained in:
committed by
Gerrit Code Review
parent
39ec9276a7
commit
e842a6c874
@@ -298,8 +298,6 @@ func Build(ctx Context, config Config) {
|
|||||||
runMakeProductConfig(ctx, config)
|
runMakeProductConfig(ctx, config)
|
||||||
}
|
}
|
||||||
|
|
||||||
checkForCleanPartitions(ctx, config)
|
|
||||||
|
|
||||||
// Everything below here depends on product config.
|
// Everything below here depends on product config.
|
||||||
|
|
||||||
if inList("installclean", config.Arguments()) ||
|
if inList("installclean", config.Arguments()) ||
|
||||||
|
@@ -218,50 +218,6 @@ func installCleanIfNecessary(ctx Context, config Config) {
|
|||||||
writeConfig()
|
writeConfig()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Writes out/partitions_were_clean_at_start_of_build.txt.
|
|
||||||
// This file will contain "true" if there were no partition staging directories at the start of
|
|
||||||
// the build (most likely from having just run `m installclean`) and "false" otherwise.
|
|
||||||
// It's used to make a test that the staging directories are correct. That test can only be
|
|
||||||
// correctly run directly after `m installclean`, and this is how we check for that.
|
|
||||||
func checkForCleanPartitions(ctx Context, config Config) {
|
|
||||||
productOutPath := config.ProductOut()
|
|
||||||
productOut := func(path string) string {
|
|
||||||
return filepath.Join(productOutPath, path)
|
|
||||||
}
|
|
||||||
|
|
||||||
notExists := func(path string) bool {
|
|
||||||
_, err := os.Stat(path)
|
|
||||||
return os.IsNotExist(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
clean := notExists(productOut("ramdisk")) &&
|
|
||||||
notExists(productOut("ramdisk_16k")) &&
|
|
||||||
notExists(productOut("debug_ramdisk")) &&
|
|
||||||
notExists(productOut("vendor_ramdisk")) &&
|
|
||||||
notExists(productOut("vendor_debug_ramdisk")) &&
|
|
||||||
notExists(productOut("vendor_kernel_ramdisk")) &&
|
|
||||||
notExists(productOut("test_harness_ramdisk")) &&
|
|
||||||
notExists(productOut("data")) &&
|
|
||||||
notExists(productOut("recovery")) &&
|
|
||||||
notExists(productOut("root")) &&
|
|
||||||
notExists(productOut("system")) &&
|
|
||||||
notExists(productOut("system_dlkm")) &&
|
|
||||||
notExists(productOut("system_other")) &&
|
|
||||||
notExists(productOut("vendor")) &&
|
|
||||||
notExists(productOut("vendor_dlkm")) &&
|
|
||||||
notExists(productOut("product")) &&
|
|
||||||
notExists(productOut("system_ext")) &&
|
|
||||||
notExists(productOut("oem")) &&
|
|
||||||
notExists(productOut("breakpad")) &&
|
|
||||||
notExists(productOut("cache")) &&
|
|
||||||
notExists(productOut("coverage")) &&
|
|
||||||
notExists(productOut("installer")) &&
|
|
||||||
notExists(productOut("odm")) &&
|
|
||||||
notExists(productOut("odm_dlkm"))
|
|
||||||
|
|
||||||
writeValueIfChanged(ctx, config, config.OutDir(), "partitions_were_clean_at_start_of_build.txt", fmt.Sprintf("%t\n", clean))
|
|
||||||
}
|
|
||||||
|
|
||||||
// cleanOldFiles takes an input file (with all paths relative to basePath), and removes files from
|
// cleanOldFiles takes an input file (with all paths relative to basePath), and removes files from
|
||||||
// the filesystem if they were removed from the input file since the last execution.
|
// the filesystem if they were removed from the input file since the last execution.
|
||||||
func cleanOldFiles(ctx Context, basePath, newFile string) {
|
func cleanOldFiles(ctx Context, basePath, newFile string) {
|
||||||
|
@@ -102,8 +102,6 @@ func runKati(ctx Context, config Config, extraSuffix string, args []string, envF
|
|||||||
"--use_ninja_phony_output",
|
"--use_ninja_phony_output",
|
||||||
// Support declaring symlink outputs in AOSP Ninja.
|
// Support declaring symlink outputs in AOSP Ninja.
|
||||||
"--use_ninja_symlink_outputs",
|
"--use_ninja_symlink_outputs",
|
||||||
// Support ninja validation actions with .KATI_VALIDATIONS: https://ninja-build.org/manual.html#validations
|
|
||||||
"--use_ninja_validations",
|
|
||||||
// Regenerate the Ninja file if environment inputs have changed. e.g.
|
// Regenerate the Ninja file if environment inputs have changed. e.g.
|
||||||
// CLI flags, .mk file timestamps, env vars, $(wildcard ..) and some
|
// CLI flags, .mk file timestamps, env vars, $(wildcard ..) and some
|
||||||
// $(shell ..) results.
|
// $(shell ..) results.
|
||||||
|
@@ -103,10 +103,8 @@ func testForDanglingRules(ctx Context, config Config) {
|
|||||||
// treated as an source file.
|
// treated as an source file.
|
||||||
dexpreoptConfigFilePath := filepath.Join(outDir, "soong", "dexpreopt.config")
|
dexpreoptConfigFilePath := filepath.Join(outDir, "soong", "dexpreopt.config")
|
||||||
|
|
||||||
// These files are written by soong_ui at the beginning of every build.
|
// out/build_date.txt is considered a "source file"
|
||||||
// Ninja considers them "source files"
|
|
||||||
buildDatetimeFilePath := filepath.Join(outDir, "build_date.txt")
|
buildDatetimeFilePath := filepath.Join(outDir, "build_date.txt")
|
||||||
cleanPartitionsFilePath := filepath.Join(outDir, "partitions_were_clean_at_start_of_build.txt")
|
|
||||||
|
|
||||||
// bpglob is built explicitly using Microfactory
|
// bpglob is built explicitly using Microfactory
|
||||||
bpglob := filepath.Join(config.SoongOutDir(), "bpglob")
|
bpglob := filepath.Join(config.SoongOutDir(), "bpglob")
|
||||||
@@ -124,7 +122,6 @@ func testForDanglingRules(ctx Context, config Config) {
|
|||||||
line == variablesFilePath ||
|
line == variablesFilePath ||
|
||||||
line == dexpreoptConfigFilePath ||
|
line == dexpreoptConfigFilePath ||
|
||||||
line == buildDatetimeFilePath ||
|
line == buildDatetimeFilePath ||
|
||||||
line == cleanPartitionsFilePath ||
|
|
||||||
line == bpglob {
|
line == bpglob {
|
||||||
// Leaf node is in one of Soong's bootstrap directories, which do not have
|
// Leaf node is in one of Soong's bootstrap directories, which do not have
|
||||||
// full build rules in the primary build.ninja file.
|
// full build rules in the primary build.ninja file.
|
||||||
|
Reference in New Issue
Block a user