Skip to content

Commit

Permalink
Add an additional bazelrc file for Windows.
Browse files Browse the repository at this point in the history
This is a workaround for the path-length issue on building protobuf on
Windows with bazel.

 * protocolbuffers/protobuf#12947
 * bazelbuild/bazel#18683

To work around it, specify --bazelrc=windows.bazelrc as follows.

  bazel --bazelrc=windows.bazelrc   \
        build //protocol:commands_proto  \
        --config oss_windows

This is a preparation to support Bazel for Windows build (#948).

There must be no observable behavior change in mac/Linux Bazel builds.

PiperOrigin-RevId: 645622326
  • Loading branch information
yukawa authored and hiroyuki-komatsu committed Jun 22, 2024
1 parent 7eeb752 commit 9adf5ce
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/windows.bazelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Currently there seems to be no way to customize startup option based on the
# host platform.
# https://github.com/bazelbuild/bazel/issues/22763
# Thus having our own file here.
# To specify this file, use the "-bazelrc" option as follows.
#
# bazel --bazelrc=windows.bazelrc build //protocol:commands_proto \
# --config oss_windows

# There has been a long standing path-length issue on building protobuf on
# Windows with bazel. See the following for details.
# https://github.com/protocolbuffers/protobuf/issues/12947
# https://github.com/bazelbuild/bazel/issues/18683
# Here is an ugly workaround, which we really hope to get rid of.
startup --output_base=C:/x --windows_enable_symlinks

0 comments on commit 9adf5ce

Please sign in to comment.