From 9adf5cedd493084d2663a9b07f7808a9afa3bea9 Mon Sep 17 00:00:00 2001 From: Yohei Yukawa Date: Sat, 22 Jun 2024 08:00:22 +0000 Subject: [PATCH] Add an additional bazelrc file for Windows. This is a workaround for the path-length issue on building protobuf on Windows with bazel. * https://github.com/protocolbuffers/protobuf/issues/12947 * https://github.com/bazelbuild/bazel/issues/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 --- src/windows.bazelrc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/windows.bazelrc diff --git a/src/windows.bazelrc b/src/windows.bazelrc new file mode 100644 index 000000000..d76ed4f81 --- /dev/null +++ b/src/windows.bazelrc @@ -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