dashboard/builder: add -gccopts flag; use shallow clones for gccgo

Change-Id: I3a48e2f664996bf99bb8a7f850d876731dd80808
Reviewed-on: https://go-review.googlesource.com/1253
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Chris Manghane 2014-12-09 09:04:19 -08:00
Родитель 0936d0445c
Коммит 3eb48c092d
2 изменённых файлов: 34 добавлений и 6 удалений

Просмотреть файл

@ -153,7 +153,32 @@ func (env *gccgoEnv) setup(repo *Repo, workpath, hash string, envv []string) (st
if _, err := os.Stat(gccpath); err != nil {
if err := timeout(*cmdTimeout, func() error {
// pull down a working copy of GCC.
return git.Create(gccpath, *gccPath)
cloneCmd := []string{
"clone",
// This is just a guess since there are ~6000 commits to
// GCC per year. It's likely there will be enough history
// to cross-reference the Gofrontend commit against GCC.
// The disadvantage would be if the commit being built is more than
// a year old; in this case, the user should make a clone that has
// the full history.
"--depth", "6000",
// We only care about the master branch.
"--branch", "master", "--single-branch",
*gccPath,
}
// Clone Kind Clone Time(Dry run) Clone Size
// ---------------------------------------------------------------
// Full Clone 10 - 15 min 2.2 GiB
// Master Branch 2 - 3 min 1.5 GiB
// Full Clone(shallow) 1 min 900 MiB
// Master Branch(shallow) 40 sec 900 MiB
//
// The shallow clones have the same size, which is expected,
// but the full shallow clone will only have 6000 commits
// spread across all branches. There are ~50 branches.
return run(exec.Command("git", cloneCmd...), runEnv(envv), allOutput(os.Stdout), runDir(repo.Path))
}); err != nil {
return "", err
}
@ -240,7 +265,7 @@ func (env *gccgoEnv) setup(repo *Repo, workpath, hash string, envv []string) (st
}
// build gcc
if err := run(exec.Command("make"), runTimeout(*buildTimeout), runEnv(envv), runDir(gccobjdir)); err != nil {
if err := run(exec.Command("make", *gccOpts), runTimeout(*buildTimeout), runEnv(envv), runDir(gccobjdir)); err != nil {
return "", fmt.Errorf("Failed to build GCC: %s", err)
}

Просмотреть файл

@ -55,6 +55,7 @@ var (
buildTool = flag.String("tool", "go", "Tool to build.")
gcPath = flag.String("gcpath", "code.google.com/p/go", "Path to download gc from")
gccPath = flag.String("gccpath", "https://github.com/mirrors/gcc.git", "Path to download gcc from")
gccOpts = flag.String("gccopts", "", "Command-line options to pass to `make` when building gccgo")
benchPath = flag.String("benchpath", "golang.org/x/benchmarks/bench", "Path to download benchmarks from")
failAll = flag.Bool("fail", false, "fail all builds")
parallel = flag.Bool("parallel", false, "Build multiple targets in parallel")
@ -429,10 +430,12 @@ func (b *Builder) buildHash(hash string) error {
return fmt.Errorf("recordResult: %s", err)
}
// build sub-repositories
goRoot := filepath.Join(workpath, *buildTool)
goPath := workpath
b.buildSubrepos(goRoot, goPath, hash)
if *buildTool == "go" {
// build sub-repositories
goRoot := filepath.Join(workpath, *buildTool)
goPath := workpath
b.buildSubrepos(goRoot, goPath, hash)
}
return nil
}