Add instructions for embed Bazel version when building from source
Fixes https://github.com/bazelbuild/bazel/issues/22798
PiperOrigin-RevId: 647067109
Change-Id: I968866bd60c43552e90b87efd4551ddf19173143
diff --git a/site/en/install/compile-source.md b/site/en/install/compile-source.md
index 1a6ad40..486ed5c 100644
--- a/site/en/install/compile-source.md
+++ b/site/en/install/compile-source.md
@@ -112,6 +112,9 @@
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}
@@ -134,11 +137,14 @@
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`).