Lines Matching +full:build +full:- +full:rules
1 ---
7 permalink: /getting-started/new-project-guide/bazel/
8 ---
13 - TOC
15 ---
19 The process of integrating a project using the [Bazel](https://bazel.build/)
20 build system with OSS-Fuzz is very similar to the general
21 [Setting up a new project]({{ site.baseurl }}/getting-started/new-project-guide/)
26 For Bazel-based projects, we recommend using the
30 [multiple sanitizer and fuzzing engine configurations][rules-fuzzing-usage].
34 The fuzzing rules provide out-of-the-box support for building and packaging fuzz
35 test artifacts in the OSS-Fuzz format. Each `//path/to:fuzz_test` fuzz test
38 in the OSS-Fuzz environment variables, and (b) generates an archive containing
40 OSS-Fuzz provides a standard tool to automatically process these targets,
41 substantially simplifying the `build.sh` script (see below).
43 [rules-fuzzing-usage]: https://github.com/bazelbuild/rules_fuzzing#using-the-rules-in-your-project
48 `rules_fuzzing` library with OSS-Fuzz. You can also see a complete example in the
49 [`bazel-rules-fuzzing-test`](https://github.com/google/oss-fuzz/tree/master/projects/bazel-rules-fu…
52 The structure of the project directory in the OSS-Fuzz repository does not
53 differ for Bazel-based projects. The project files have the following specific
60 Since the OSS-Fuzz target builds the fuzz test using the instrumentation and
61 engine specified in the OSS-Fuzz environment variables, all the engine and
63 supported by the fuzzing rules.
67 There is no need to install Bazel in your Docker image. The OSS-Fuzz builder
72 [`.bazelversion`](https://docs.bazel.build/versions/master/updating-bazel.html)
75 ### build.sh
77 Your `build.sh` script essentially needs to perform three steps: (1) selecting
78 which fuzz tests to build, (2) building their OSS-Fuzz package targets in the
79 right configuration, and (3) copying the build artifacts to the `${OUT}/`
82 OSS-Fuzz provides a
83 [`bazel_build_fuzz_tests`](https://github.com/google/oss-fuzz/blob/master/infra/base-images/base-bu…
85 build script only needs to invoke this command with no arguments.
90 * `BAZEL_EXTRA_BUILD_FLAGS` are extra build flags passed on the Bazel command
95 `"no-oss-fuzz"`.
97 the fuzz tests to build, if the tag-based approach is not sufficient.