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:
See the bootstrap walkthrough on the C++ Alliance site for the design rationale. |
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:
-
Inspect and download
-
Checks the tools and compilers it needs, and tells you which one is missing.
-
Finds Ninja, and downloads it into
build/third-party/when it is not onPATH. -
Builds the third-party dependencies from their JSON recipes. Sources go to
build/third-party/source/and installs tobuild/third-party/install/.
-
-
Configure
-
Writes the presets to
CMakeUserPresets.json. -
Configures Mr.Docs with the preset.
-
Writes the run configurations, unless you pass
--no-run-configs:-
.run/for CLion. -
.vscode/launch.jsonfor VS Code, except on Windows. -
.vs/launch.vs.jsonfor Visual Studio, on Windows. -
A
justfileat the repository root.just --listthen shows every recipe.
-
-
Install the debugger pretty printer files
.lldbinitand.gdbinit.
-
-
Builds Mr.Docs (default destination
build/<preset>/) -
Runs Mr.Docs tests
-
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 |
|---|---|
|
Turns colors off. |
|
Turns colors and emoji off, like |
|
Turns colors on, even when the output is not a terminal. |
|
Turns emoji on. |
|
On Windows, either one tells the tool that the terminal understands ANSI escape codes. |
|
Makes the output group its lines the way the GitHub Actions log expects. |
|
The tool looks here for Java first, because the XML schema checks need it. |
|
The tool looks here for a tool before it searches |
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: Default: |
--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 |
--sanitizer(enum) | Builds Mr.Docs with a Clang/GCC sanitizer enabled. Choices: |
--no-build-tests(flag) | Skip building the test suite (golden, unit, lint, schema, self-doc). Tests are built by default; pass |
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 ( |
--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 |
--ninja-path(string) | Path to the Ninja executable. Ninja is the preferred CMake generator because it produces a |
--git-path(string) | Path to Git. Required for cloning recipes and for the compilation-database CMake integration. Bootstrap discovers Git on |
--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 |
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: |
--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: |
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 |
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, |
--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 |
--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-key(string) | Print the cache key for one recipe and exit (for example, |
--os-key(string) | OS or container identifier baked into cache keys (for example, |
--env-file(string) | Path where bootstrap writes computed |
--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 |