You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: infra/experimental/chronos/README.md
+65Lines changed: 65 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,70 @@
1
1
# Chronos: rebuilding OSS-Fuzz harnesses using cached builds
2
2
3
+
Chronos is a utility tooling to enable fast re-building of OSS-Fuzz projects
4
+
and analysis of projects' testing infrastructure. This is used by projects,
5
+
e.g. [OSS-Fuzz-gen](https://github.com/google/oss-fuzz-gen) to help speed up
6
+
valuation processes during fuzzing harness generation.
7
+
8
+
Chronos is focused on two features, rebuilding projects fast and running the tests of a given project.
9
+
10
+
## Rebuilding projects fast
11
+
12
+
Chronos enables rebuilding projects efficiently in contexts where only a small patch
13
+
needs to be evalualted in the target. This is achieved by running a replay build script
14
+
in the build container, similarly to how a regular `build_fuzzers` command would run, but
15
+
with the caveat that the replay build script only performs a subset of the operations
16
+
of the original `build.sh`.
17
+
18
+
The replay build scripts are constructed in two ways: manually or automatically.
19
+
20
+
### Automated rebuilds
21
+
22
+
Chronos support automated rebuilding by:
23
+
24
+
1. Calling into a `replay_build.sh` script during the building inside the container [here](https://github.com/google/oss-fuzz/blob/206656447b213fb04901d15122692d8dd4d45312/infra/base-images/base-builder/compile#L292-L296)
25
+
2. The `replay_build.sh` calls into `make_build_replayable.py`: [here](https://github.com/google/oss-fuzz/blob/master/infra/base-images/base-builder/replay_build.sh)
26
+
3.`make_build_replayable.py` adjusts the build environment to wrap around common commands, to avoid performing a complete run of `build.sh`: [here](https://github.com/google/oss-fuzz/blob/master/infra/base-images/base-builder/make_build_replayable.py).
27
+
28
+
### Manually provided replay builds
29
+
30
+
`replay_build.sh` above, is simply just a wrapper script around `build.sh` that aims to enable
31
+
fast rebuilding of the project. This `replay_build.sh` can, however, be overwritten in the Dockerfile
32
+
of the project's builder image. Examples of this is [php](https://github.com/google/oss-fuzz/blob/206656447b213fb04901d15122692d8dd4d45312/projects/php/replay_build.sh#L1) and [ffmpeg](https://github.com/google/oss-fuzz/blob/master/projects/ffmpeg/replay_build.sh#L1).
33
+
34
+
Providing a manual `replay_build.sh` is likely more efficient at build time and can help speed up the process. Automated replay build scripts can also be erroneous.
35
+
36
+
37
+
### Testing the validity of a replay build
38
+
39
+
The Chronos manager can use the `manager.py` to validate the validity of a
If the above command fails for the relevant project, then the replay build feature
47
+
does not work for the given project.
48
+
49
+
## Running tests of a project
50
+
51
+
The second part of Chronos is a feature to enable running the tests of a given
52
+
project. This is done by way of a script `run_tests.sh`. Samples of
53
+
this script include [jsonnet](https://github.com/google/oss-fuzz/blob/master/projects/jsonnet/run_tests.sh#L1) and [tinyobjloader](https://github.com/google/oss-fuzz/blob/master/projects/tinyobjloader/run_tests.sh#L1).
54
+
55
+
56
+
### Testing the validity of run_tests.sh
57
+
58
+
The Chronos manager can use the `manager.py` to validate the validity of a
0 commit comments