The Bootstrap Tool Reference

Most users install a release package and can skip this page. Read it only when a release does not fit your case:

  • Your Linux is older than the releases support, for example Ubuntu 18.04 or CentOS 7.

  • No release covers your platform.

  • You need plugins on a platform whose release package cannot load them.

  • You are setting up a development environment with presets, IDE targets and just recipes.

python bootstrap.py builds Mr.Docs from source and sets up a development environment for it.

Build from Source shows the basic usage.

Development Workflow presents extra commands developers are expected to run. To change the bootstrap tool itself, see the Bootstrap Contributor Guide.

Effects of a run

A run does these things, in this order:

  1. Inspect and download

    1. Checks the tools and compilers it needs, and tells you which one is missing.

    2. Finds Ninja, and downloads it into build/third-party/ when it is not on PATH.

    3. Builds the third-party dependencies from their JSON recipes. Sources go to build/third-party/source/ and installs to build/third-party/install/.

  2. Configure

    1. Writes the presets to CMakeUserPresets.json.

    2. Configures Mr.Docs with the preset.

    3. Writes the run configurations, unless you pass --no-run-configs:

      • .run/ for CLion.

      • .vscode/launch.json for VS Code, except on Windows.

      • .vs/launch.vs.json for Visual Studio, on Windows.

      • A justfile at the repository root. just --list then shows every recipe.

    4. Install the debugger pretty printer files .lldbinit and .gdbinit.

  3. Builds Mr.Docs (default destination build/<preset>/)

  4. Runs Mr.Docs tests

  5. Installs Mr.Docs into (default destination install/<preset>/)

With --skip-build the run stops after the configure step. With --skip-build and --no-run-configs together, it skips configuring Mr.Docs too.

Default directories

Without --build-dir and --install-dir, a run uses one directory per preset under the source directory. For the release-macos preset, the build goes to build/release-macos and Mr.Docs installs into install/release-macos. The preset name combines the build type, the OS, the compiler and the sanitizer, so different combinations install side by side.

Environment variables

All the following environment variables are optional and have default values depending on what’s inspected about the platform.

Variable Effect

NO_COLOR

Turns colors off.

BOOTSTRAP_PLAIN

Turns colors and emoji off, like --plain.

BOOTSTRAP_FORCE_COLOR, CLICOLOR_FORCE

Turns colors on, even when the output is not a terminal.

BOOTSTRAP_FORCE_EMOJI

Turns emoji on.

TERM, WT_SESSION

On Windows, either one tells the tool that the terminal understands ANSI escape codes.

GITHUB_ACTIONS

Makes the output group its lines the way the GitHub Actions log expects.

JAVA_HOME

The tool looks here for Java first, because the XML schema checks need it.

<TOOL>_ROOT, <TOOL>_DIR, <TOOL>_PATH, <TOOL>_HOME, <TOOL>_INSTALL_DIR, <TOOL>_EXECUTABLE

The tool looks here for a tool before it searches PATH, in upper, lower and title case (CMAKE_ROOT, git_PATH, Ninja_HOME). It uses a value that names an executable, or a directory with the tool in it or in its bin/.

Options Reference

Build Configuration

Name Description
--build-type
(enum)

Selects the CMake build configuration. Release maximizes optimization; Debug disables it and enables assertions; RelWithDebInfo produces optimized binaries with debug info; MinSizeRel optimizes for size; DebugFast trades some debuggability for build speed.

Choices: Release, Debug, RelWithDebInfo, MinSizeRel, DebugFast

Default: Release

--preset
(string)

Name of the CMake preset to use. The default template expands to a value derived from build type, OS, compiler, and sanitizer; override only when you have a custom preset.

Default: a name like release-macos or debug-linux-clang-asan, derived from the build type, OS, compiler, and sanitizer

--sanitizer
(enum)

Builds Mr.Docs with a Clang/GCC sanitizer enabled. address catches out-of-bounds and use-after-free, undefined catches undefined behavior, thread catches data races, memory catches uninitialized reads. Bootstrap also rebuilds libc++ with the matching instrumentation when the sanitizer needs it.

Choices: address, undefined, thread, memory

--no-build-tests
(flag)

Skip building the test suite (golden, unit, lint, schema, self-doc). Tests are built by default; pass --no-build-tests for a leaner build that skips the Java-runtime requirement of the xml-lint step.

Compiler Options

Name Description
--cc
(string)

Path to the C compiler. Defaults to the compiler CMake discovers on the system; set this when you need to pin a specific version or pick between Clang and GCC.

--cxx
(string)

Path to the C++ compiler. Defaults to the compiler CMake discovers on the system; set this to pin a specific version or to use a different toolchain from CC.

--cflags
(string)

Extra flags appended to every C compile command, both for third-party recipes and for Mr.Docs itself. Useful for linker-friendly debug info (-gz=zstd) or coverage flags.

--cxxflags
(string)

Extra flags appended to every C++ compile command, both for third-party recipes and for Mr.Docs itself.

--ldflags
(string)

Extra flags appended to every link command, both for third-party recipes and for Mr.Docs itself.

Tool Paths

Name Description
--cmake-path
(string)

Path to the CMake executable. Bootstrap discovers CMake on PATH by default; set this when multiple CMake versions are installed and the wrong one is picked up.

--ninja-path
(string)

Path to the Ninja executable. Ninja is the preferred CMake generator because it produces a compile_commands.json automatically; bootstrap discovers it on PATH by default.

--git-path
(string)

Path to Git. Required for cloning recipes and for the compilation-database CMake integration. Bootstrap discovers Git on PATH by default.

--python-path
(string)

Path to the Python interpreter recipes should use for any Python steps. Defaults to the interpreter currently running bootstrap.

--java-path
(string)

Path to a Java runtime. Required for the xml-lint test step when --build-tests is on; ignored otherwise.

Directories

Name Description
--source-dir
(string)

Root of the cloned Mr.Docs source tree. Bootstrap auto-detects this from the working directory, so you usually do not need to set it explicitly.

Default: the directory containing the cloned source

--build-dir
(string)

Where CMake places intermediate build artefacts. The default template expands per build type, OS, compiler, and sanitizer so different combinations do not clobber each other.

Default: <source-dir>/build/<preset>

--install-dir
(string)

Where the final binaries and resources are installed. The default template expands per build type, OS, compiler, and sanitizer so different combinations install side-by-side.

Default: <source-dir>/install/<preset>

Behavior Options

Name Description
-y
(flag)

Accept every default prompt without asking. Use this for CI, containers, and scripted installs where there is no human at the keyboard.

--dry-run
(flag)

Print every command bootstrap would run, fully resolved with absolute paths, without executing anything. Useful when you want to inspect the build steps or reproduce them manually.

--verbose
(flag)

Show extra log lines about each step bootstrap takes.

--debug
(flag)

Show full Python tracebacks on errors. Implies verbose.

--plain
(flag)

Disable colors and emoji in the output. Use for CI logs and any environment that does not render terminal escape codes.

--install-system-deps
(flag)

If a required system tool (CMake, a compiler, Git, etc.) is missing, attempt to install it via apt-get on Linux or brew on macOS before continuing.

Dependency Options

Name Description
--clean
(flag)

Wipe every cached third-party dependency build and start over. The Mr.Docs build itself is also cleared.

--force
(flag)

Rebuild a recipe even when its stamp file says it is up to date. Use this after an out-of-band change to a recipe's source tree.

--recipe-filter
(string)

Comma-separated list of recipe names to build (for example, llvm,jerryscript). Recipes not in the list are skipped.

--skip-build
(flag)

Install dependencies but skip the CMake build and install of Mr.Docs itself. Useful when you only need the dependency tree populated for CI cache restoration. Bootstrap still configures Mr.Docs unless you pass --no-run-configs, because the run configurations read the program paths from CMake's reply.

--list-recipes
(flag)

Print every dependency recipe bootstrap knows about and exit.

--cache-dir
(string)

Use a shared directory of cached dependency installs. Each recipe installs to <cache-dir>/<recipe-name> instead of the per-build location. Bootstrap checks stamp files and skips recipes that are already up to date, so this directory is the natural unit of CI cache restoration.

--cache-key
(string)

Print the cache key for one recipe and exit (for example, --cache-key llvm). The key includes the recipe name, the OS, and the configuration that affects its build, so it can be used as a cache restore key in CI.

--os-key
(string)

OS or container identifier baked into cache keys (for example, ubuntu:24.04, macos-15). Required for cross-machine cache reuse so that builds from different runners do not pull each other's artefacts.

--env-file
(string)

Path where bootstrap writes computed <recipe>_ROOT paths and propagation flags in key=value format. CI uses the file to inject environment variables into the steps that follow bootstrap.

--refresh-all
(flag)

Re-run the bootstrap configuration step for every existing IDE configuration in the source tree, regenerating run configs from current options without rebuilding.

Run Configuration Options

Name Description
--no-run-configs
(flag)

Skip generating IDE run/debug configurations for CLion, VS Code, and Visual Studio. Bootstrap generates configs by default so common Mr.Docs targets are one click away; pass --no-run-configs when you do not want bootstrap to touch the IDE config directories.