From fee270187d49304460e1db46c0a29fd0e97a832c Mon Sep 17 00:00:00 2001 From: Cole Faust Date: Fri, 13 Dec 2024 14:10:31 -0800 Subject: Make BuildLinkerConfig run in its own action We should probably do this change for more parts of the filesystem RuleBuilder. Moving the linker config action out of the filesystem rulebuilder allows it to run in parallel with opther actions, and not rerun every time the filesystem is rebuilt. Bug: 384091387 Test: Presubmits Change-Id: Ic7305c555260fb5d9900c6c709b6c81dc0708d2b --- filesystem/filesystem_test.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'filesystem/filesystem_test.go') diff --git a/filesystem/filesystem_test.go b/filesystem/filesystem_test.go index 2dcb23d3f..33cddf87d 100644 --- a/filesystem/filesystem_test.go +++ b/filesystem/filesystem_test.go @@ -16,7 +16,6 @@ package filesystem import ( "os" - "strings" "testing" "android/soong/android" @@ -181,11 +180,9 @@ func TestFileSystemFillsLinkerConfigWithStubLibs(t *testing.T) { `) module := result.ModuleForTests("myfilesystem", "android_common") - output := module.Output("out/soong/.intermediates/myfilesystem/android_common/myfilesystem/system/etc/linker.config.pb") + output := module.Output("out/soong/.intermediates/myfilesystem/android_common/linker.config.pb") - fullCommand := output.RuleParams.Command - startIndex := strings.Index(fullCommand, "conv_linker_config") - linkerConfigCommand := fullCommand[startIndex:] + linkerConfigCommand := output.RuleParams.Command android.AssertStringDoesContain(t, "linker.config.pb should have libfoo", linkerConfigCommand, "libfoo.so") @@ -735,7 +732,7 @@ cc_library { } `) - linkerConfigCmd := result.ModuleForTests("myfilesystem", "android_common").Rule("build_filesystem_image").RuleParams.Command + linkerConfigCmd := result.ModuleForTests("myfilesystem", "android_common").Output("out/soong/.intermediates/myfilesystem/android_common/linker.config.pb").RuleParams.Command android.AssertStringDoesContain(t, "Could not find linker.config.json file in cmd", linkerConfigCmd, "conv_linker_config proto --force -s linker.config.json") android.AssertStringDoesContain(t, "Could not find stub in `provideLibs`", linkerConfigCmd, "--key provideLibs --value libfoo_has_stubs.so") } -- cgit v1.2.3-59-g8ed1b