Skip to content

Commit

Permalink
Add instructions for embed Bazel version when building from source
Browse files Browse the repository at this point in the history
Fixes #22798

PiperOrigin-RevId: 647067109
Change-Id: I968866bd60c43552e90b87efd4551ddf19173143
  • Loading branch information
meteorcloudy authored and Copybara-Service committed Jun 26, 2024
1 parent 9c4e73d commit 3f93d37
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion site/en/install/compile-source.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ For instructions for Windows, see [Build Bazel on Windows](#build-bazel-on-windo
Alternatively you can run `bazel build //src:bazel --compilation_mode=opt`
to yield a smaller binary but it's slower to build.

You can build with `--stamp --embed_label=X.Y.Z` flag to embed a Bazel
version for the binary so that `bazel --version` outputs the given version.

4. The output will be at `bazel-bin/src/bazel-dev` (or `bazel-bin/src/bazel`).

### Step 4b: Build Bazel on Windows {:#build-bazel-on-windows}
Expand All @@ -134,11 +137,14 @@ For instructions for Unix-like systems, see

3. Build Bazel from source:

bazel build //src:bazel-dev.exe
bazel build //src:bazel-dev.exe

Alternatively you can run `bazel build //src:bazel.exe
--compilation_mode=opt` to yield a smaller binary but it's slower to build.

You can build with `--stamp --embed_label=X.Y.Z` flag to embed a Bazel
version for the binary so that `bazel --version` outputs the given version.

4. The output will be at `bazel-bin\src\bazel-dev.exe` (or
`bazel-bin\src\bazel.exe`).

Expand Down

0 comments on commit 3f93d37

Please sign in to comment.