bazel

package
v0.10.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 25, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PathFromLabel added in v0.9.0

func PathFromLabel(label string, flags []string) (string, error)

PathFromLabel turns a bazel label into a valid path, which can for example be used to create the fuzz test's corpus directory. Flags which should be passed to the `bazel query` command can be passed via the flags argument (to avoid bazel discarding the analysis cache).

Types

type Builder

type Builder struct {
	*BuilderOptions
}

func NewBuilder

func NewBuilder(opts *BuilderOptions) (*Builder, error)

func (*Builder) BuildForBundle

func (b *Builder) BuildForBundle(engine string, sanitizers []string, fuzzTests []string) ([]*build.Result, error)

func (*Builder) BuildForRun

func (b *Builder) BuildForRun(fuzzTests []string) ([]*build.Result, error)

BuildForRun builds the specified fuzz tests with bazel. It expects labels of targets of the cc_fuzz_test rule provided by rules_fuzzing: https://github.com/bazelbuild/rules_fuzzing/blob/master/docs/cc-fuzzing-rules.md#cc_fuzz_test

TODO: Unfortunately, the cc_fuzz_test rule currently doesn't support combining sanitizers, so we can't build with both ASan and UBSan. Therefore, we only build with ASan and plan to upstream support for combining sanitizers.

type BuilderOptions

type BuilderOptions struct {
	ProjectDir string
	Engine     string
	NumJobs    uint
	Stdout     io.Writer
	Stderr     io.Writer
	TempDir    string
	Verbose    bool
}

func (*BuilderOptions) Validate

func (opts *BuilderOptions) Validate() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL