Skip to content

Commit

Permalink
[dev.cc] cmd/dist: build new5a etc during bootstrap
Browse files Browse the repository at this point in the history
The change to the bootstrap import conversion is
for the a.y files, which use import dot.

While we're editing the tool list, add "cmd/dist".
Right now 'go install cmd/dist' installs to $GOROOT/bin/dist.
(A new bug since cmd/dist has been rewritten in Go.
When cmd/dist was a C program, go install cmd/dist just didn't work.)

Change-Id: I362208dcfb4ae64c987f60b95dc946829fa506d8
Reviewed-on: https://go-review.googlesource.com/3144
Reviewed-by: Ian Lance Taylor <[email protected]>
Reviewed-by: Rob Pike <[email protected]>
  • Loading branch information
rsc committed Jan 21, 2015
1 parent 4ca2fc4 commit f4d2d71
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/cmd/dist/buildtool.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,16 @@ import (
// which are commands, and entries beginning with internal/, which are
// packages supporting the commands.
var bootstrapDirs = []string{
"internal/asm",
"internal/obj",
"internal/obj/arm",
"internal/obj/i386",
"internal/obj/ppc64",
"internal/obj/x86",
"new5a",
"new6a",
"new8a",
"new9a",
"objwriter",
}

Expand Down Expand Up @@ -112,7 +117,8 @@ func bootstrapFixImports(text, srcFile string) string {
inBlock = false
continue
}
if strings.HasPrefix(line, "import \"") || inBlock && strings.HasPrefix(line, "\t\"") {
if strings.HasPrefix(line, `import "`) || strings.HasPrefix(line, `import . "`) ||
inBlock && (strings.HasPrefix(line, "\t\"") || strings.HasPrefix(line, "\t. \"")) {
lines[i] = strings.Replace(line, `"cmd/internal/`, `"bootstrap/internal/`, -1)
}
}
Expand Down
1 change: 1 addition & 0 deletions src/cmd/go/pkg.go
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,7 @@ var goTools = map[string]targetDir{
"cmd/addr2line": toTool,
"cmd/api": toTool,
"cmd/cgo": toTool,
"cmd/dist": toTool,
"cmd/fix": toTool,
"cmd/link": toTool,
"cmd/new5a": toTool,
Expand Down

0 comments on commit f4d2d71

Please sign in to comment.