go.tools/dashboard/builder: only download gcc once for gccgo buildTool.

Downloading the GCC repo takes a lot of time and everything works fine if we just store it in the buildRoot and reuse it.

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/13583045
This commit is contained in:
Chris Manghane 2013-09-24 16:08:25 -07:00
parent dfaa5cc0c1
commit b25f3012f3
1 changed files with 12 additions and 6 deletions

View File

@ -126,23 +126,29 @@ func (env *goEnv) setup(repo *Repo, workpath, hash string, envv []string) (strin
type gccgoEnv struct{}
// setup for a gccgoEnv clones the gofrontend repo to workpath/go at the hash
// and clones the latest GCC branch to workpath/gcc. The gccgo sources are
// and clones the latest GCC branch to repo.Path/gcc. The gccgo sources are
// replaced with the updated sources in the gofrontend repo and gcc gets
// gets configured and built in workpath/gcc-objdir. The path to
// workpath/gcc-objdir is returned.
func (env *gccgoEnv) setup(repo *Repo, workpath, hash string, envv []string) (string, error) {
gofrontendpath := filepath.Join(workpath, "gofrontend")
gccpath := filepath.Join(workpath, "gcc")
gccpath := filepath.Join(repo.Path, "gcc")
// get a handle to SVN vcs.Cmd for pulling down GCC.
svn := vcs.ByCmd("svn")
// only pull down gcc if we don't have a local copy.
if _, err := os.Stat(gccpath); err != nil {
if err := timeout(*cmdTimeout, func() error {
// pull down a working copy of GCC.
return svn.Create(gccpath, *gccPath)
}); err != nil {
return "", err
}
}
if err := svn.Download(gccpath); err != nil {
return "", err
}
// clone gofrontend repo at specified revision
if _, err := repo.Clone(gofrontendpath, hash); err != nil {