> ## Documentation Index
> Fetch the complete documentation index at: https://docs.incredibuild.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Running Builds for Bazel

Last updated on Aug 27, 2026

Starting with Incredibuild 10.37.0, Incredibuild can distribute Bazel builds and supports [Build Cache](/windows/10.37.0/build-cache) for Bazel builds.

## BuildCacheProfile Prerequisites

Build Cache is generally case insensitive, whereas Bazel is case sensitive.

To fix this, add `/BuildCacheProfile="<IB installation folder>\BuildCache Profiles\BuildCache_profile_bazel.xml"` to the BuildConsole command.

## Profile Prerequisites

Incredibuild interception requires processes spawned by Incredibuild. Bazel is a long-running service which means it cannot be intercepted by the current build if started earlier. Bazel must therefore be restarted by BuildConsole.

The `bazel.ib_profile.xml` includes `<PreBuildStep Filepath="path\to\bazel.exe shutdown"/>` at the xml root level, and bazel and java listed in the Tools list with `AllowIntercept="true"`.

In order for the Bazel process shutdown command to work:

1. Edit `bazel.ib_profile.xml` and edit the path to bazel.exe in `<PreBuildStep Filepath="path\to\bazel.exe shutdown" />`
2. To activate this, add `/Profile="<IB installation folder>\Profiles\bazel.ib_profile.xml"` to the BuildConsole command.

```xml theme={null}
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<!-- Bazel (Windows, MSVC). cl.exe is spawned by Bazel's Java server, not bazel.exe - both need interception. -->
<Profile FormatVersion="1">

  <!-- Bazel's long-running Java server can only be intercepted if BuildConsole's
       own process tree creates it. Set the full path to bazel.exe below so it
       restarts the server before each build. -->
  <PreBuildStep Filepath="path\to\bazel.exe shutdown" />

  <Tools>

    <Tool Filename="bazel" AllowIntercept="true" />
    <Tool Filename="java"  AllowIntercept="true" />

  </Tools>
</Profile>
```

<Note>
  Confirm with your Customer Success representative whether your Incredibuild 10.37.0 installation ships with the built-in Bazel profile. If it does not, create a profile XML file (as shown above) and reference it in your build command, as described in [Creating a Profile XML File](/windows/10.37.0/create-profile-xml-file).
</Note>

## Running a Build

Run your Bazel build through BuildConsole, pointing `/Profile` at your profile XML file and `/BuildCacheProfile` to the Bazel Build Cache profile:

```powershell theme={null}
BuildConsole /command=<Bazel command> /Profile="<path>\bazel.ib_profile.xml" /BuildCacheProfile="<IB installation folder>\BuildCache Profiles\BuildCache_profile_bazel.xml"
```
