Bazel

This page captures the progress of Bazel for windows on arm.

Status

Limitations

Bazel Binaries

Bazel pre-built binaries for woa are available

Releases · bazelbuild/bazel

Building from Source

Bazel can be built from the source and requires an x64 bazel for cross-compilation.

You need Bazel(x64) 5 or later.

bazel build --subcommands --cpu=x64_arm64_windows //src:bazel.exe

This generates a standalone bazel.exe which is a native arm64 Bazel binary.

Bazel builds generated by CI

Bazel binaries for WoA are published as part of Bazel CI and every commit generates a build.

An example built from an old commit. Replace the commit id with one of the latest to access latest builds.

https://storage.googleapis.com/bazel-builds/artifacts/windows_arm64/b6024258c5b9b396b022bad6e7e3d64423048289/bazel

You might need to explicitly add an exe suffix to the generated binary to execute it.

Usage

Using the examples provided in https://docs.bazel.build/versions/main/tutorial/cpp.html

For targeting windows/arm64 , the following flag needs to be specified

--cpu=arm64_windows

For native compilation, target CPU is auto-detected and explicit target is not required.

Few examples given below,

Cross compilation

bazel build --subcommands //main:hello-world --cpu=arm64_windows

Native Compilation

bazel build --subcommands //main:hello-world