Installing CI Fuzz CLI
Table of contents
Installation
You can get the latest release here or by running our install script:
sh -c "$(curl -fsSL https://raw.githubusercontent.com/CodeIntelligenceTesting/cifuzz/main/install.sh)"
If you are using Windows you can download the latest release and execute it.
Do not forget to add the installation’s bin
directory to your PATH
.
By default, CI Fuzz CLI gets installed in your home directory under cifuzz
. You can customize the installation directory with ./cifuzz_installer -i /target/dir
.
Installation Directories
Linux/MacOS
When running the installer as a non-root user, files are installed to:
~/.local/share/cifuzz
(default) or$XDG_DATA_HOME/cifuzz
if$XDG_DATA_HOME
is set.
A symlink to the cifuzz
executable is created in ~/.local/bin/cifuzz
.
When running the installer as root, files are installed to /opt/code-intelligence/cifuzz
and a symlink to the cifuzz
executable if created in /usr/local/bin/cifuzz
.
Windows
All files are installed to %APPDATA%/cifuzz
with the executable located in %APPDATA%/cifuzz/bin
.
Prerequisites
Depending on your language / build system of choice cifuzz has different prerequisites:
C/C++ (with CMake)
Ubuntu / Debian sudo apt install cmake clang llvm
Arch
sudo pacman -S cmake clang llvm
macOS
brew install cmake llvm lcov
Windows
At least Visual Studio 2022 version 17 is required.
choco install cmake llvm
C/C++ (with Bazel)
- Bazel >= 5.3.2
- Java JDK >= 8 (e.g. OpenJDK or Zulu) is needed for Bazel's coverage feature.
- LLVM >= 11
- lcov
sudo apt install clang llvm lcov
sudo curl -L https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-linux-amd64 -o /usr/local/bin/bazel
sudo chmod +x /usr/local/bin/bazel
Arch
sudo pacman -S clang llvm lcov
sudo curl -L https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-linux-amd64 -o /usr/local/bin/bazel
sudo chmod +x /usr/local/bin/bazel
macOS
brew install llvm lcov openjdk bazelisk
Windows
At least Visual Studio 2022 version 17 is required.
choco install cmake llvm microsoft-openjdk bazelisk
Java with Maven
Ubuntu / Debian sudo apt install default-jdk maven
Arch
sudo pacman -S jdk-openjdk maven
macOS
brew install openjdk maven
Windows
choco install microsoft-openjdk maven
Java with Gradle
Ubuntu / Debian sudo apt install default-jdk gradle
Arch
sudo pacman -S jdk-openjdk gradle
macOS
brew install openjdk gradle
Windows
choco install microsoft-openjdk gradle
How to uninstall cifuzz
Linux / macOS
Version < 0.7.0
If you installed cifuzz into the default directory as root:
sudo rm -rf ~/cifuzz /usr/local/share/cifuzz
If you installed cifuzz as a non-root user:
rm -rf ~/cifuzz ~/.cmake/packages/cifuzz
If you installed into a custom installation directory you have to remove that one instead.
Version >= 0.7.0
From version 0.7.0 the default installation directory has changed.
If you installed cifuzz as root:
sudo rm -rf /opt/code-intelligence/cifuzz /usr/local/bin/cifuzz /usr/local/share/cifuzz
If you installed cifuzz as a non-root user:
rm -rf "${XDG_DATA_HOME:-$HOME/.local/share}/cifuzz" ~/.local/bin/cifuzz ~/.cmake/packages/cifuzz
If you installed into a custom installation directory you have to remove that one instead.
Windows
To uninstall cifuzz and delete the corresponding registry entries:
rd /s %APPDATA%/cifuzz
reg delete "HKLM\Software\Kitware\CMake\Packages\cifuzz" /f 2> nul
reg delete "HKCU\Software\Kitware\CMake\Packages\cifuzz" /f 2> nul
Building from Source (Linux / macOS)
If you want the latest version of cifuzz
, you can build it from source.
Prerequisites
Build dependencies:
Test dependencies:
- LLVM >= 14
- make
- CMake >= 3.21
- Bazel >= 5.3.2
- Java JDK >= 8 (e.g. OpenJDK or Zulu)
- Maven
- Gradle >= 4.9
Installing required dependencies
Ubuntu / Debian
sudo apt install git make cmake clang llvm golang-go libcap-dev default-jdk maven gradle
# install bazelisk
sudo curl -L https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-linux-amd64 -o /usr/local/bin/bazel
sudo chmod +x /usr/local/bin/bazel
Arch
sudo pacman -S git make cmake clang llvm go jdk-openjdk maven gradle
# install bazelisk
sudo curl -L https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-linux-amd64 -o /usr/local/bin/bazel
sudo chmod +x /usr/local/bin/bazel
Unfortunately, the Arch libcap
package does not include the static libcap library, which is needed to build cifuzz. You have to build it from source instead:
pacman -Sy --noconfirm glibc pam linux-api-headers make diffutils
git clone git://git.kernel.org/pub/scm/libs/libcap/libcap.git
cd libcap
git checkout libcap-2.65
make
make install
macOS
brew install git cmake llvm lcov go openjdk maven gradle bazelisk
Note: Unfortunately, there is a bug in Bazel < 6 on macOS. However, if you set the USE_BAZEL_VERSION
environment variable, bazelisk will pick that up and use the correct version accordingly. E.g., put this in your .zshrc:
export USE_BAZEL_VERSION=6.0.0-pre.20221020.1
Add the following to your ~/.zshrc
or ~/.bashrc
to use the correct version of LLVM:
export PATH=$(brew --prefix)/opt/llvm/bin:$PATH
export LDFLAGS="-L$(brew --prefix)/opt/llvm/lib"
export CPPFLAGS="-I$(brew --prefix)/opt/llvm/include"
Steps
To build cifuzz from source you have to execute the following steps:
git clone https://github.com/CodeIntelligenceTesting/cifuzz.git
cd cifuzz
make test
make install
To verify the installation we recommend you to start a fuzzing run in one of our example projects:
cd examples/cmake
cifuzz run my_fuzz_test
This should stop after a few seconds with an actual finding.