aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/vcs/linux.go
diff options
context:
space:
mode:
authorSpace Meyer <meyerpatrick@google.com>2022-08-25 14:10:27 +0000
committerAleksandr Nogikh <wp32pw@gmail.com>2022-09-01 10:42:40 +0200
commit3f79a9101d6ae91acf7edde3727992988bb01ae1 (patch)
tree02fffb61eeecc65328969e918d718cbaba5265e5 /pkg/vcs/linux.go
parent8ed3d47016fdf9afc7672bd6fddcf4a7250b6d12 (diff)
pkg/vcs: fetch linux upstream stable before bisections
Diffstat (limited to 'pkg/vcs/linux.go')
-rw-r--r--pkg/vcs/linux.go19
1 files changed, 17 insertions, 2 deletions
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)