Skip to content

rustsmith/rustsmith

Repository files navigation

License Release CI Version FOSSA Status

RustSmith: A randomized program generator for Rust

RustSmith is a fuzzer built for the Rust programming language with the purpose of fuzzing the Rust compiler (rustc) and find compiler crashes and mis-compilations within the compiler. This repo contains the source code of the generator along with information on how to install and use it.

Table of Contents:

Getting Started

To get started with RustSmith, there are a couple of options as shown below:

Recommended Method

To download and install RustSmith, the recommended method is to simply download the "RustSmith Executable" from the latest release from the "Releases" panel on the right.

RustSmith can then be invoked as below:

    ./rustsmith --help

Docker

Docker can also be used in the following way using the latest docker image:

docker run --rm ghcr.io/rustsmith/rustsmith --help

Running RustSmith using the JAR File

Alternatively, the JAR file in the releases can be downloaded and used instead. RustSmith would then be invoked as:

    java -jar RustSmith-1.0-SNAPSHOT-all.jar

Building from Source

To build RustSmith from source, an installation of Java 15 is required. More information for installing OpenJDK 15 can be found on the OpenJDK Website.

Building and executing RustSmith can then be done as follows:

    git clone git@github.com:rustsmith/rustsmith.git
    cd rustsmith
    ./gradlew build

This will create both the standalone executable under ./run/rustsmith and the packaged JAR file under ./build/libs/RustSmith-1.0-SNAPSHOT-all.jar which can then be executed as described above.

Usage

Usage: rustsmith [OPTIONS]

Options:
  -n, -count INT    No. of files to generate
  -p, -print        Print out program only
  -f, -fail-fast    Use fail fast approach
  -s, -seed INT     Optional Seed
  --directory TEXT  Directory to save files
  -h, --help        Show this message and exit

Documentation

Documentation is available at: https://rustsmith.github.io/docs !

Contributing

Contributions are all welcome! If you would like to contribute, please see the corresponding guidelines. By contributing, you are agreeing to our code of conduct.

License

FOSSA Status