sys: check in generated files

We used to have all generated files checked in.
Later we removed them (now users are supposed to
run make to generate them). This causes several
problems:

 - go get does not work as it tries to build everything
   straight away (go get -d works, but users are confused)
 - users don't run make and complain that build is broken
 - users don't re-run make after updates and complain that
   build is broken
 - hard to integrate into other build system (even if they
   support building Go, they don't support running sysgen
   out-of-the-box)

Fixes #216
This commit is contained in:
Dmitry Vyukov 2017-06-13 15:55:31 +02:00
parent b94b250a78
commit 3751542e1e
7 changed files with 74144 additions and 6 deletions

4
.gitignore vendored
View File

@ -4,7 +4,3 @@
workdir*
bin/
sys/sys_amd64.go
sys/sys_arm64.go
sys/sys_ppc64le.go
executor/syscalls.h

View File

@ -9,7 +9,6 @@ endif
.PHONY: all format clean manager fuzzer executor execprog mutate prog2c stress extract generate repro
all:
$(MAKE) generate
go install ./syz-manager ./syz-fuzzer
$(MAKE) manager
$(MAKE) fuzzer

4542
executor/syscalls.h Normal file

File diff suppressed because it is too large Load Diff

23259
sys/sys_amd64.go Normal file

File diff suppressed because one or more lines are too long

23173
sys/sys_arm64.go Normal file

File diff suppressed because one or more lines are too long

23163
sys/sys_ppc64le.go Normal file

File diff suppressed because one or more lines are too long

View File

@ -8,6 +8,7 @@ import (
"bytes"
"flag"
"fmt"
"go/format"
"io"
"io/ioutil"
"os"
@ -810,7 +811,12 @@ func isIdentifier(s string) bool {
return true
}
func writeSource(file string, src []byte) {
func writeSource(file string, data []byte) {
src, err := format.Source(data)
if err != nil {
fmt.Printf("%s\n", data)
failf("failed to format output: %v", err)
}
if oldSrc, err := ioutil.ReadFile(file); err == nil && bytes.Equal(src, oldSrc) {
return
}