Stop using DIST_DIR in Soong
We're only using it to distribute files in case of failure, which isn't well supported currently, but can be handled for now by using the DIST_DIR environment variable during the command execution. This was at least one cause that we'd be re-running Soong during every build server build, as the DIST_DIR values are unique. Test: m dist Change-Id: Ibd5e6b6c46695350de80b745bfb6a6aa685033a0
This commit is contained in:
@@ -725,46 +725,6 @@ func PathForIntermediates(ctx PathContext, paths ...string) OutputPath {
|
||||
return PathForOutput(ctx, ".intermediates", path)
|
||||
}
|
||||
|
||||
// DistPath is a Path representing a file path rooted from the dist directory
|
||||
type DistPath struct {
|
||||
basePath
|
||||
}
|
||||
|
||||
func (p DistPath) withRel(rel string) DistPath {
|
||||
p.basePath = p.basePath.withRel(rel)
|
||||
return p
|
||||
}
|
||||
|
||||
var _ Path = DistPath{}
|
||||
|
||||
// PathForDist joins the provided paths and returns a DistPath that is
|
||||
// validated to not escape the dist dir.
|
||||
// On error, it will return a usable, but invalid DistPath, and report a ModuleError.
|
||||
func PathForDist(ctx PathContext, pathComponents ...string) DistPath {
|
||||
path, err := validatePath(pathComponents...)
|
||||
if err != nil {
|
||||
reportPathError(ctx, err)
|
||||
}
|
||||
return DistPath{basePath{path, ctx.Config(), ""}}
|
||||
}
|
||||
|
||||
func (p DistPath) writablePath() {}
|
||||
|
||||
func (p DistPath) Valid() bool {
|
||||
return p.config.productVariables.DistDir != nil && *p.config.productVariables.DistDir != ""
|
||||
}
|
||||
|
||||
func (p DistPath) String() string {
|
||||
if !p.Valid() {
|
||||
panic("Requesting an invalid path")
|
||||
}
|
||||
return filepath.Join(*p.config.productVariables.DistDir, p.path)
|
||||
}
|
||||
|
||||
func (p DistPath) RelPathString() string {
|
||||
return p.path
|
||||
}
|
||||
|
||||
// ModuleSrcPath is a Path representing a file rooted from a module's local source dir
|
||||
type ModuleSrcPath struct {
|
||||
SourcePath
|
||||
|
Reference in New Issue
Block a user