aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/csource/build.go
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2018-07-25 10:44:45 +0200
committerDmitry Vyukov <dvyukov@google.com>2018-07-25 10:44:45 +0200
commitad155aa4289990cd08c77c0e4e5ecc4d63df6ff3 (patch)
tree3a2b62147bac29b572ba6cb6475b56d489a5ccf4 /pkg/csource/build.go
parente0c1bcbabc5e9037b9a265204dc70c5188909dbc (diff)
pkg/csource: say what compiler is missing
Diffstat (limited to 'pkg/csource/build.go')
-rw-r--r--pkg/csource/build.go5
1 files changed, 1 insertions, 4 deletions
diff --git a/pkg/csource/build.go b/pkg/csource/build.go
index 3befa092d..391d437a1 100644
--- a/pkg/csource/build.go
+++ b/pkg/csource/build.go
@@ -5,7 +5,6 @@ package csource
import (
"bytes"
- "errors"
"fmt"
"io/ioutil"
"os"
@@ -30,7 +29,7 @@ func build(target *prog.Target, src []byte, file string) (string, error) {
sysTarget := targets.Get(target.OS, target.Arch)
compiler := sysTarget.CCompiler
if _, err := exec.LookPath(compiler); err != nil {
- return "", ErrNoCompiler
+ return "", fmt.Errorf("no target compiler %v", compiler)
}
// We call the binary syz-executor because it sometimes shows in bug titles,
// and we don't want 2 different bugs for when a crash is triggered during fuzzing and during repro.
@@ -70,8 +69,6 @@ func build(target *prog.Target, src []byte, file string) (string, error) {
return bin, nil
}
-var ErrNoCompiler = errors.New("no target compiler")
-
// Format reformats C source using clang-format.
func Format(src []byte) ([]byte, error) {
stdout, stderr := new(bytes.Buffer), new(bytes.Buffer)