Merge "Remove baseModuleContext.debug" into main

This commit is contained in:
Cole Faust
2023-10-17 16:38:02 +00:00
committed by Gerrit Code Review
5 changed files with 12 additions and 21 deletions

View File

@@ -789,7 +789,7 @@ func (c *config) HostToolDir() string {
} }
func (c *config) HostToolPath(ctx PathContext, tool string) Path { func (c *config) HostToolPath(ctx PathContext, tool string) Path {
path := pathForInstall(ctx, ctx.Config().BuildOS, ctx.Config().BuildArch, "bin", false, tool) path := pathForInstall(ctx, ctx.Config().BuildOS, ctx.Config().BuildArch, "bin", tool)
return path return path
} }
@@ -798,12 +798,12 @@ func (c *config) HostJNIToolPath(ctx PathContext, lib string) Path {
if runtime.GOOS == "darwin" { if runtime.GOOS == "darwin" {
ext = ".dylib" ext = ".dylib"
} }
path := pathForInstall(ctx, ctx.Config().BuildOS, ctx.Config().BuildArch, "lib64", false, lib+ext) path := pathForInstall(ctx, ctx.Config().BuildOS, ctx.Config().BuildArch, "lib64", lib+ext)
return path return path
} }
func (c *config) HostJavaToolPath(ctx PathContext, tool string) Path { func (c *config) HostJavaToolPath(ctx PathContext, tool string) Path {
path := pathForInstall(ctx, ctx.Config().BuildOS, ctx.Config().BuildArch, "framework", false, tool) path := pathForInstall(ctx, ctx.Config().BuildOS, ctx.Config().BuildArch, "framework", tool)
return path return path
} }
@@ -812,7 +812,7 @@ func (c *config) HostCcSharedLibPath(ctx PathContext, lib string) Path {
if ctx.Config().BuildArch.Multilib == "lib64" { if ctx.Config().BuildArch.Multilib == "lib64" {
libDir = "lib64" libDir = "lib64"
} }
return pathForInstall(ctx, ctx.Config().BuildOS, ctx.Config().BuildArch, libDir, false, lib+".so") return pathForInstall(ctx, ctx.Config().BuildOS, ctx.Config().BuildArch, libDir, lib+".so")
} }
// PrebuiltOS returns the name of the host OS used in prebuilts directories. // PrebuiltOS returns the name of the host OS used in prebuilts directories.

View File

@@ -380,7 +380,6 @@ type BaseModuleContext interface {
Device() bool Device() bool
Darwin() bool Darwin() bool
Windows() bool Windows() bool
Debug() bool
PrimaryArch() bool PrimaryArch() bool
} }
@@ -2675,7 +2674,6 @@ type baseModuleContext struct {
target Target target Target
multiTargets []Target multiTargets []Target
targetPrimary bool targetPrimary bool
debug bool
walkPath []Module walkPath []Module
tagPath []blueprint.DependencyTag tagPath []blueprint.DependencyTag
@@ -3306,10 +3304,6 @@ func (b *baseModuleContext) Windows() bool {
return b.os == Windows return b.os == Windows
} }
func (b *baseModuleContext) Debug() bool {
return b.debug
}
func (b *baseModuleContext) PrimaryArch() bool { func (b *baseModuleContext) PrimaryArch() bool {
if len(b.config.Targets[b.target.Os]) <= 1 { if len(b.config.Targets[b.target.Os]) <= 1 {
return true return true

View File

@@ -480,7 +480,7 @@ func (p OutputPaths) Strings() []string {
// PathForGoBinary returns the path to the installed location of a bootstrap_go_binary module. // PathForGoBinary returns the path to the installed location of a bootstrap_go_binary module.
func PathForGoBinary(ctx PathContext, goBinary bootstrap.GoBinaryTool) Path { func PathForGoBinary(ctx PathContext, goBinary bootstrap.GoBinaryTool) Path {
goBinaryInstallDir := pathForInstall(ctx, ctx.Config().BuildOS, ctx.Config().BuildArch, "bin", false) goBinaryInstallDir := pathForInstall(ctx, ctx.Config().BuildOS, ctx.Config().BuildArch, "bin")
rel := Rel(ctx, goBinaryInstallDir.String(), goBinary.InstallPath()) rel := Rel(ctx, goBinaryInstallDir.String(), goBinary.InstallPath())
return goBinaryInstallDir.Join(ctx, rel) return goBinaryInstallDir.Join(ctx, rel)
} }
@@ -1684,19 +1684,19 @@ func (p InstallPath) ToMakePath() InstallPath {
func PathForModuleInstall(ctx ModuleInstallPathContext, pathComponents ...string) InstallPath { func PathForModuleInstall(ctx ModuleInstallPathContext, pathComponents ...string) InstallPath {
os, arch := osAndArch(ctx) os, arch := osAndArch(ctx)
partition := modulePartition(ctx, os) partition := modulePartition(ctx, os)
return pathForInstall(ctx, os, arch, partition, ctx.Debug(), pathComponents...) return pathForInstall(ctx, os, arch, partition, pathComponents...)
} }
// PathForHostDexInstall returns an InstallPath representing the install path for the // PathForHostDexInstall returns an InstallPath representing the install path for the
// module appended with paths... // module appended with paths...
func PathForHostDexInstall(ctx ModuleInstallPathContext, pathComponents ...string) InstallPath { func PathForHostDexInstall(ctx ModuleInstallPathContext, pathComponents ...string) InstallPath {
return pathForInstall(ctx, ctx.Config().BuildOS, ctx.Config().BuildArch, "", ctx.Debug(), pathComponents...) return pathForInstall(ctx, ctx.Config().BuildOS, ctx.Config().BuildArch, "", pathComponents...)
} }
// PathForModuleInPartitionInstall is similar to PathForModuleInstall but partition is provided by the caller // PathForModuleInPartitionInstall is similar to PathForModuleInstall but partition is provided by the caller
func PathForModuleInPartitionInstall(ctx ModuleInstallPathContext, partition string, pathComponents ...string) InstallPath { func PathForModuleInPartitionInstall(ctx ModuleInstallPathContext, partition string, pathComponents ...string) InstallPath {
os, arch := osAndArch(ctx) os, arch := osAndArch(ctx)
return pathForInstall(ctx, os, arch, partition, ctx.Debug(), pathComponents...) return pathForInstall(ctx, os, arch, partition, pathComponents...)
} }
func osAndArch(ctx ModuleInstallPathContext) (OsType, ArchType) { func osAndArch(ctx ModuleInstallPathContext) (OsType, ArchType) {
@@ -1712,7 +1712,7 @@ func osAndArch(ctx ModuleInstallPathContext) (OsType, ArchType) {
return os, arch return os, arch
} }
func pathForInstall(ctx PathContext, os OsType, arch ArchType, partition string, debug bool, func pathForInstall(ctx PathContext, os OsType, arch ArchType, partition string,
pathComponents ...string) InstallPath { pathComponents ...string) InstallPath {
var partitionPaths []string var partitionPaths []string
@@ -1742,9 +1742,6 @@ func pathForInstall(ctx PathContext, os OsType, arch ArchType, partition string,
} }
partitionPaths = []string{"host", osName + "-" + archName, partition} partitionPaths = []string{"host", osName + "-" + archName, partition}
} }
if debug {
partitionPaths = append([]string{"debug"}, partitionPaths...)
}
partitionPath, err := validatePath(partitionPaths...) partitionPath, err := validatePath(partitionPaths...)
if err != nil { if err != nil {

View File

@@ -871,7 +871,7 @@ func (c *RuleBuilderCommand) PathForOutput(path WritablePath) string {
func sboxPathForToolRel(ctx BuilderContext, path Path) string { func sboxPathForToolRel(ctx BuilderContext, path Path) string {
// Errors will be handled in RuleBuilder.Build where we have a context to report them // Errors will be handled in RuleBuilder.Build where we have a context to report them
toolDir := pathForInstall(ctx, ctx.Config().BuildOS, ctx.Config().BuildArch, "", false) toolDir := pathForInstall(ctx, ctx.Config().BuildOS, ctx.Config().BuildArch, "")
relOutSoong, isRelOutSoong, _ := maybeRelErr(toolDir.String(), path.String()) relOutSoong, isRelOutSoong, _ := maybeRelErr(toolDir.String(), path.String())
if isRelOutSoong { if isRelOutSoong {
// The tool is in the Soong output directory, it will be copied to __SBOX_OUT_DIR__/tools/out // The tool is in the Soong output directory, it will be copied to __SBOX_OUT_DIR__/tools/out

View File

@@ -60,7 +60,7 @@ func robolectricTestSuite(ctx SingletonContext, files map[string]InstallPaths) W
for _, module := range SortedKeys(files) { for _, module := range SortedKeys(files) {
installedPaths = append(installedPaths, files[module]...) installedPaths = append(installedPaths, files[module]...)
} }
testCasesDir := pathForInstall(ctx, ctx.Config().BuildOS, X86, "testcases", false) testCasesDir := pathForInstall(ctx, ctx.Config().BuildOS, X86, "testcases")
outputFile := PathForOutput(ctx, "packaging", "robolectric-tests.zip") outputFile := PathForOutput(ctx, "packaging", "robolectric-tests.zip")
rule := NewRuleBuilder(pctx, ctx) rule := NewRuleBuilder(pctx, ctx)
@@ -69,7 +69,7 @@ func robolectricTestSuite(ctx SingletonContext, files map[string]InstallPaths) W
FlagWithArg("-P ", "host/testcases"). FlagWithArg("-P ", "host/testcases").
FlagWithArg("-C ", testCasesDir.String()). FlagWithArg("-C ", testCasesDir.String()).
FlagWithRspFileInputList("-r ", outputFile.ReplaceExtension(ctx, "rsp"), installedPaths.Paths()). FlagWithRspFileInputList("-r ", outputFile.ReplaceExtension(ctx, "rsp"), installedPaths.Paths()).
Flag("-sha256") Flag("-sha256")
rule.Build("robolectric_tests_zip", "robolectric-tests.zip") rule.Build("robolectric_tests_zip", "robolectric-tests.zip")
return outputFile return outputFile