Skip to content

Commit

Permalink
syz-ci: use gmake instead of make on openbsd
Browse files Browse the repository at this point in the history
Update google#712
  • Loading branch information
dvyukov committed Sep 13, 2018
1 parent 61ed43a commit 19e9088
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
10 changes: 9 additions & 1 deletion pkg/instance/instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"net"
"os"
"path/filepath"
"runtime"
"strings"
"time"

Expand Down Expand Up @@ -61,7 +62,7 @@ func (env *Env) BuildSyzkaller(repo, commit string) error {
if _, err := vcs.NewSyzkallerRepo(cfg.Syzkaller).CheckoutCommit(repo, commit); err != nil {
return fmt.Errorf("failed to checkout syzkaller repo: %v", err)
}
cmd := osutil.Command("make", "target")
cmd := osutil.Command(MakeBin, "target")
cmd.Dir = cfg.Syzkaller
cmd.Env = append([]string{}, os.Environ()...)
cmd.Env = append(cmd.Env,
Expand Down Expand Up @@ -397,3 +398,10 @@ func ExecprogCmd(execprog, executor, OS, arch, sandbox string, repeat, threaded,
procs, repeatCount, threaded, collide,
faultCall, faultNth, progFile)
}

var MakeBin = func() string {
if runtime.GOOS == "openbsd" {
return "gmake"
}
return "make"
}()
7 changes: 4 additions & 3 deletions syz-ci/syzupdater.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"syscall"
"time"

"github.com/google/syzkaller/pkg/instance"
"github.com/google/syzkaller/pkg/log"
"github.com/google/syzkaller/pkg/mgrconfig"
"github.com/google/syzkaller/pkg/osutil"
Expand Down Expand Up @@ -218,21 +219,21 @@ func (upd *SyzUpdater) build(commit *vcs.Commit) error {
}
}
}
cmd := osutil.Command("make", "generate")
cmd := osutil.Command(instance.MakeBin, "generate")
cmd.Dir = upd.syzkallerDir
cmd.Env = append([]string{"GOPATH=" + upd.gopathDir}, os.Environ()...)
if _, err := osutil.Run(time.Hour, cmd); err != nil {
return fmt.Errorf("build failed: %v", err)
}
cmd = osutil.Command("make", "host", "ci")
cmd = osutil.Command(instance.MakeBin, "host", "ci")
cmd.Dir = upd.syzkallerDir
cmd.Env = append([]string{"GOPATH=" + upd.gopathDir}, os.Environ()...)
if _, err := osutil.Run(time.Hour, cmd); err != nil {
return fmt.Errorf("build failed: %v", err)
}
for target := range upd.targets {
parts := strings.Split(target, "/")
cmd = osutil.Command("make", "target")
cmd = osutil.Command(instance.MakeBin, "target")
cmd.Dir = upd.syzkallerDir
cmd.Env = append([]string{}, os.Environ()...)
cmd.Env = append(cmd.Env,
Expand Down

0 comments on commit 19e9088

Please sign in to comment.