diff options
author | 2025-01-15 17:26:14 -0800 | |
---|---|---|
committer | 2025-01-15 18:08:55 -0800 | |
commit | cb9bd8940b73eb10e832ed7cfca89bf86ca8e8b4 (patch) | |
tree | 99c8d6d93a241a04f8021b25a30a37bdcf0f1705 | |
parent | 628d810b73dc6c2f04b1c99e00f52e978125634f (diff) |
Remove Include_make_built_files
We're not using this anytime soon, so just remove it for now.
Bug: 390269431
Test: m nothing
Change-Id: I51bbf104dceabafc08d562cfecb31a845cb88d12
-rw-r--r-- | filesystem/filesystem.go | 32 | ||||
-rw-r--r-- | filesystem/filesystem_test.go | 16 | ||||
-rw-r--r-- | scripts/Android.bp | 8 | ||||
-rwxr-xr-x | scripts/merge_directories.py | 60 |
4 files changed, 0 insertions, 116 deletions
diff --git a/filesystem/filesystem.go b/filesystem/filesystem.go index 306710c7c..7336d3535 100644 --- a/filesystem/filesystem.go +++ b/filesystem/filesystem.go @@ -173,12 +173,6 @@ type FilesystemProperties struct { // Mount point for this image. Default is "/" Mount_point *string - // If set to the name of a partition ("system", "vendor", etc), this filesystem module - // will also include the contents of the make-built staging directories. If any soong - // modules would be installed to the same location as a make module, they will overwrite - // the make version. - Include_make_built_files string - // When set, builds etc/event-log-tags file by merging logtags from all dependencies. // Default is false Build_logtags *bool @@ -668,7 +662,6 @@ func (f *filesystem) buildImageUsingBuildImage(ctx android.ModuleContext) (andro f.entries = f.copyPackagingSpecs(ctx, builder, specs, rootDir, rebasedDir) f.buildNonDepsFiles(ctx, builder, rootDir) - f.addMakeBuiltFiles(ctx, builder, rootDir) f.buildFsverityMetadataFiles(ctx, builder, specs, rootDir, rebasedDir) f.buildEventLogtagsFile(ctx, builder, rebasedDir) f.buildAconfigFlagsFiles(ctx, builder, specs, rebasedDir) @@ -928,10 +921,6 @@ func (f *filesystem) buildCpioImage(ctx android.ModuleContext, compressed bool) ctx.PropertyErrorf("file_contexts", "file_contexts is not supported for compressed cpio image.") } - if f.properties.Include_make_built_files != "" { - ctx.PropertyErrorf("include_make_built_files", "include_make_built_files is not supported for compressed cpio image.") - } - rootDir := android.PathForModuleOut(ctx, f.rootDirString()).OutputPath rebasedDir := rootDir if f.properties.Base_dir != nil { @@ -998,27 +987,6 @@ var validPartitions = []string{ "recovery", } -func (f *filesystem) addMakeBuiltFiles(ctx android.ModuleContext, builder *android.RuleBuilder, rootDir android.Path) { - partition := f.properties.Include_make_built_files - if partition == "" { - return - } - if !slices.Contains(validPartitions, partition) { - ctx.PropertyErrorf("include_make_built_files", "Expected one of %#v, found %q", validPartitions, partition) - return - } - stampFile := fmt.Sprintf("target/product/%s/obj/PACKAGING/%s_intermediates/staging_dir.stamp", ctx.Config().DeviceName(), partition) - fileListFile := fmt.Sprintf("target/product/%s/obj/PACKAGING/%s_intermediates/file_list.txt", ctx.Config().DeviceName(), partition) - stagingDir := fmt.Sprintf("target/product/%s/%s", ctx.Config().DeviceName(), partition) - - builder.Command().BuiltTool("merge_directories"). - Implicit(android.PathForArbitraryOutput(ctx, stampFile)). - Text("--ignore-duplicates"). - FlagWithInput("--file-list", android.PathForArbitraryOutput(ctx, fileListFile)). - Text(rootDir.String()). - Text(android.PathForArbitraryOutput(ctx, stagingDir).String()) -} - func (f *filesystem) buildEventLogtagsFile(ctx android.ModuleContext, builder *android.RuleBuilder, rebasedDir android.OutputPath) { if !proptools.Bool(f.properties.Build_logtags) { return diff --git a/filesystem/filesystem_test.go b/filesystem/filesystem_test.go index 47d06f669..d9bf24299 100644 --- a/filesystem/filesystem_test.go +++ b/filesystem/filesystem_test.go @@ -136,22 +136,6 @@ func TestFileSystemDeps(t *testing.T) { } } -func TestIncludeMakeBuiltFiles(t *testing.T) { - result := fixture.RunTestWithBp(t, ` - android_filesystem { - name: "myfilesystem", - include_make_built_files: "system", - } - `) - - output := result.ModuleForTests("myfilesystem", "android_common").Output("myfilesystem.img") - - stampFile := "out/target/product/test_device/obj/PACKAGING/system_intermediates/staging_dir.stamp" - fileListFile := "out/target/product/test_device/obj/PACKAGING/system_intermediates/file_list.txt" - android.AssertStringListContains(t, "deps of filesystem must include the staging dir stamp file", output.Implicits.Strings(), stampFile) - android.AssertStringListContains(t, "deps of filesystem must include the staging dir file list", output.Implicits.Strings(), fileListFile) -} - func TestFileSystemFillsLinkerConfigWithStubLibs(t *testing.T) { result := fixture.RunTestWithBp(t, ` android_system_image { diff --git a/scripts/Android.bp b/scripts/Android.bp index d39c84a0f..94163a5c2 100644 --- a/scripts/Android.bp +++ b/scripts/Android.bp @@ -293,14 +293,6 @@ sh_binary_host { } python_binary_host { - name: "merge_directories", - main: "merge_directories.py", - srcs: [ - "merge_directories.py", - ], -} - -python_binary_host { name: "merge_json", main: "merge_json.py", srcs: [ diff --git a/scripts/merge_directories.py b/scripts/merge_directories.py deleted file mode 100755 index 3f8631bab..000000000 --- a/scripts/merge_directories.py +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/env python3 -import argparse -import os -import shutil -import sys - -def main(): - parser = argparse.ArgumentParser( - description="Given a list of directories, this script will copy the contents of all of " - "them into the first directory, erroring out if any duplicate files are found." - ) - parser.add_argument( - "--ignore-duplicates", - action="store_true", - help="Don't error out on duplicate files, just skip them. The file from the earliest " - "directory listed on the command line will be the winner." - ) - parser.add_argument( - "--file-list", - help="Path to a text file containing paths relative to in_dir. Only these paths will be " - "copied out of in_dir." - ) - parser.add_argument("out_dir") - parser.add_argument("in_dir") - args = parser.parse_args() - - if not os.path.isdir(args.out_dir): - sys.exit(f"error: {args.out_dir} must be a directory") - if not os.path.isdir(args.in_dir): - sys.exit(f"error: {args.in_dir} must be a directory") - - file_list = None - if args.file_list: - with open(file_list_file, "r") as f: - file_list = f.read().strip().splitlines() - - in_dir = args.in_dir - for root, dirs, files in os.walk(in_dir): - rel_root = os.path.relpath(root, in_dir) - dst_root = os.path.join(args.out_dir, rel_root) - made_parent_dirs = False - for f in files: - src = os.path.join(root, f) - dst = os.path.join(dst_root, f) - p = os.path.normpath(os.path.join(rel_root, f)) - if file_list is not None and p not in file_list: - continue - if os.path.lexists(dst): - if args.ignore_duplicates: - continue - sys.exit(f"error: {p} exists in both {args.out_dir} and {in_dir}") - - if not made_parent_dirs: - os.makedirs(dst_root, exist_ok=True) - made_parent_dirs = True - - shutil.copy2(src, dst, follow_symlinks=False) - -if __name__ == "__main__": - main() |