Handle absolute source paths correctly.
Can happen if OUT_DIR is set on an absolute path. Test: env RBE_remote_disabled=true OUT_DIR=/home_2/tmp/out m Bug: 169048540 Fixes: 169048540 Change-Id: Ia6b91b13142d84e54d0dee8b4e04a91ad2cecc36
This commit is contained in:
@@ -14,6 +14,8 @@
|
||||
|
||||
package android
|
||||
|
||||
import "path/filepath"
|
||||
|
||||
func init() {
|
||||
RegisterModuleType("prebuilt_build_tool", prebuiltBuildToolFactory)
|
||||
}
|
||||
@@ -58,13 +60,18 @@ func (t *prebuiltBuildTool) GenerateAndroidBuildActions(ctx ModuleContext) {
|
||||
installedPath := PathForModuleOut(ctx, t.ModuleBase.Name())
|
||||
deps := PathsForModuleSrc(ctx, t.properties.Deps)
|
||||
|
||||
var fromPath = sourcePath.String()
|
||||
if !filepath.IsAbs(fromPath) {
|
||||
fromPath = "$$PWD/" + fromPath
|
||||
}
|
||||
|
||||
ctx.Build(pctx, BuildParams{
|
||||
Rule: Symlink,
|
||||
Output: installedPath,
|
||||
Input: sourcePath,
|
||||
Implicits: deps,
|
||||
Args: map[string]string{
|
||||
"fromPath": "$$PWD/" + sourcePath.String(),
|
||||
"fromPath": fromPath,
|
||||
},
|
||||
})
|
||||
|
||||
|
Reference in New Issue
Block a user