Skip to content

Commit

Permalink
Force absolute paths in builders (#1664)
Browse files Browse the repository at this point in the history
  • Loading branch information
Xjs authored and jayconrod committed Aug 16, 2018
1 parent 1e88fb4 commit 0b98d55
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions go/tools/builders/compile.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ func buildImportcfgFile(archives []archive, stdImports []string, installSuffix,
if !ok {
return "", errors.New("GOROOT not set")
}
goroot = abs(goroot)
for _, imp := range stdImports {
path := filepath.Join(goroot, "pkg", installSuffix, filepath.FromSlash(imp))
fmt.Fprintf(buf, "packagefile %s=%s.a\n", imp, path)
Expand Down
2 changes: 1 addition & 1 deletion go/tools/builders/link.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ func buildImportcfgFile(archives []archive, packageList, installSuffix, dir stri
if !ok {
return "", errors.New("GOROOT not set")
}
prefix := filepath.Join(goroot, "pkg", installSuffix)
prefix := abs(filepath.Join(goroot, "pkg", installSuffix))
packageListFile, err := os.Open(packageList)
if err != nil {
return "", err
Expand Down

0 comments on commit 0b98d55

Please sign in to comment.