From 3f79a9101d6ae91acf7edde3727992988bb01ae1 Mon Sep 17 00:00:00 2001 From: Space Meyer Date: Thu, 25 Aug 2022 14:10:27 +0000 Subject: pkg/vcs: fetch linux upstream stable before bisections --- pkg/vcs/linux.go | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'pkg/vcs/linux.go') diff --git a/pkg/vcs/linux.go b/pkg/vcs/linux.go index a44729233..d2371ca5c 100644 --- a/pkg/vcs/linux.go +++ b/pkg/vcs/linux.go @@ -23,6 +23,7 @@ import ( type linux struct { *git + vmType string } var ( @@ -30,12 +31,14 @@ var ( _ ConfigMinimizer = new(linux) ) -func newLinux(dir string, opts []RepoOpt) *linux { +func newLinux(dir string, opts []RepoOpt, vmType string) *linux { ignoreCC := map[string]bool{ "stable@vger.kernel.org": true, } + return &linux{ - git: newGit(dir, ignoreCC, opts), + git: newGit(dir, ignoreCC, opts), + vmType: vmType, } } @@ -248,6 +251,18 @@ func linuxAlterConfigs(cf *kconfig.ConfigFile, tags map[string]bool) { } } +func (ctx *linux) PrepareBisect() error { + if ctx.vmType != "gvisor" { + // Some linux repos we fuzz don't import the upstream release git tags. We need tags + // to decide which compiler versions to use. Let's fetch upstream for its tags. + err := ctx.git.fetchRemote("https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git") + if err != nil { + return fmt.Errorf("fetching upstream linux failed: %w", err) + } + } + return nil +} + func (ctx *linux) Bisect(bad, good string, dt debugtracer.DebugTracer, pred func() (BisectResult, error)) ([]*Commit, error) { commits, err := ctx.git.Bisect(bad, good, dt, pred) -- cgit mrf-deployment