From 95da0ba5b43e5ac6cc12590566ca945b0c848793 Mon Sep 17 00:00:00 2001 From: "David L. Jones" Date: Fri, 29 Apr 2022 17:57:55 -0700 Subject: [PATCH] Rename all BUILD files to BUILD.bazel (#9892) This avoids conflicting names in a couple of cases. 1. Within google, we want to sync files but not name them BUILD (since the structure doesn't match). 2. On case-insensitive filesystems, `build` may be used for a build directory. Naming `BUILD.bazel` avoids potentioal conflicts. --- BUILD => BUILD.bazel | 4 +- Makefile.am | 44 +++++++++---------- benchmarks/{BUILD => BUILD.bazel} | 2 +- benchmarks/cpp/{BUILD => BUILD.bazel} | 0 benchmarks/datasets/{BUILD => BUILD.bazel} | 2 +- .../proto2/{BUILD => BUILD.bazel} | 0 .../proto3/{BUILD => BUILD.bazel} | 0 .../google_message2/{BUILD => BUILD.bazel} | 0 .../google_message3/{BUILD => BUILD.bazel} | 0 .../google_message4/{BUILD => BUILD.bazel} | 0 csharp/{BUILD => BUILD.bazel} | 2 +- examples/{BUILD => BUILD.bazel} | 2 +- java/{BUILD => BUILD.bazel} | 2 +- java/core/{BUILD => BUILD.bazel} | 2 +- java/internal/{BUILD => BUILD.bazel} | 2 +- java/kotlin-lite/{BUILD => BUILD.bazel} | 2 +- java/kotlin/{BUILD => BUILD.bazel} | 2 +- java/lite/{BUILD => BUILD.bazel} | 2 +- java/util/{BUILD => BUILD.bazel} | 2 +- objectivec/{BUILD => BUILD.bazel} | 2 +- php/{BUILD => BUILD.bazel} | 2 +- pkg/{BUILD => BUILD.bazel} | 0 ruby/{BUILD => BUILD.bazel} | 2 +- third_party/{BUILD => BUILD.bazel} | 0 third_party/utf8_range/{BUILD => BUILD.bazel} | 0 toolchain/{BUILD => BUILD.bazel} | 0 util/python/{BUILD => BUILD.bazel} | 2 +- 27 files changed, 39 insertions(+), 39 deletions(-) rename BUILD => BUILD.bazel (99%) rename benchmarks/{BUILD => BUILD.bazel} (98%) rename benchmarks/cpp/{BUILD => BUILD.bazel} (100%) rename benchmarks/datasets/{BUILD => BUILD.bazel} (98%) rename benchmarks/datasets/google_message1/proto2/{BUILD => BUILD.bazel} (100%) rename benchmarks/datasets/google_message1/proto3/{BUILD => BUILD.bazel} (100%) rename benchmarks/datasets/google_message2/{BUILD => BUILD.bazel} (100%) rename benchmarks/datasets/google_message3/{BUILD => BUILD.bazel} (100%) rename benchmarks/datasets/google_message4/{BUILD => BUILD.bazel} (100%) rename csharp/{BUILD => BUILD.bazel} (97%) rename examples/{BUILD => BUILD.bazel} (99%) rename java/{BUILD => BUILD.bazel} (98%) rename java/core/{BUILD => BUILD.bazel} (99%) rename java/internal/{BUILD => BUILD.bazel} (92%) rename java/kotlin-lite/{BUILD => BUILD.bazel} (99%) rename java/kotlin/{BUILD => BUILD.bazel} (99%) rename java/lite/{BUILD => BUILD.bazel} (99%) rename java/util/{BUILD => BUILD.bazel} (99%) rename objectivec/{BUILD => BUILD.bazel} (99%) rename php/{BUILD => BUILD.bazel} (97%) rename pkg/{BUILD => BUILD.bazel} (100%) rename ruby/{BUILD => BUILD.bazel} (97%) rename third_party/{BUILD => BUILD.bazel} (100%) rename third_party/utf8_range/{BUILD => BUILD.bazel} (100%) rename toolchain/{BUILD => BUILD.bazel} (100%) rename util/python/{BUILD => BUILD.bazel} (96%) diff --git a/BUILD b/BUILD.bazel similarity index 99% rename from BUILD rename to BUILD.bazel index aaff71a0c..335261439 100644 --- a/BUILD +++ b/BUILD.bazel @@ -1496,7 +1496,7 @@ pkg_files( "protobuf*.pc.in", "test-driver", ], allow_empty = True) + [ - "BUILD", + "BUILD.bazel", "CHANGES.txt", "CMakeLists.txt", "CONTRIBUTORS.txt", @@ -1512,7 +1512,7 @@ pkg_files( "maven_install.json", "update_file_lists.sh", "//third_party:zlib.BUILD", - "//util/python:BUILD", + "//util/python:BUILD.bazel", ], strip_prefix = strip_prefix.from_root(""), visibility = ["//pkg:__pkg__"], diff --git a/Makefile.am b/Makefile.am index 6c1bf316c..748099950 100644 --- a/Makefile.am +++ b/Makefile.am @@ -11,7 +11,7 @@ SUBDIRS = . src # Always include third_party directories in distributions. # # Note that distribution artifacts will be produced by Bazel in the future. -# See pkg/BUILD for overall definitions. +# See pkg/BUILD.bazel for overall definitions. DIST_SUBDIRS = src conformance benchmarks third_party/googletest # Build gmock before we build protobuf tests. We don't add gmock to SUBDIRS @@ -51,7 +51,7 @@ clean-local: pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = protobuf.pc protobuf-lite.pc -# Note: please keep this in sync with the dist_files rule in csharp/BUILD. +# Note: please keep this in sync with the dist_files rule in csharp/BUILD.bazel. csharp_EXTRA_DIST= \ global.json \ csharp/.editorconfig \ @@ -283,11 +283,11 @@ csharp_EXTRA_DIST= \ csharp/src/Google.Protobuf/UnknownFieldSet.cs \ csharp/src/Google.Protobuf/UnsafeByteOperations.cs -# Note: please keep this in sync with the dist_files rules under java/.../BUILD. +# Note: please keep this in sync with the dist_files rules under java/.../BUILD.bazel. java_EXTRA_DIST= \ java/README.md \ java/bom/pom.xml \ - java/core/BUILD \ + java/core/BUILD.bazel \ java/core/generate-sources-build.xml \ java/core/generate-test-sources-build.xml \ java/core/pom.xml \ @@ -543,9 +543,9 @@ java_EXTRA_DIST= java/core/src/test/proto/com/google/protobuf/test_check_utf8_size.proto \ java/core/src/test/proto/com/google/protobuf/test_custom_options.proto \ java/core/src/test/proto/com/google/protobuf/wrappers_test.proto \ - java/internal/BUILD \ + java/internal/BUILD.bazel \ java/internal/testing.bzl \ - java/kotlin/BUILD \ + java/kotlin/BUILD.bazel \ java/kotlin/generate-sources-build.xml \ java/kotlin/generate-test-sources-build.xml \ java/kotlin/pom.xml \ @@ -572,7 +572,7 @@ java_EXTRA_DIST= java/kotlin/src/test/proto/com/google/protobuf/evil_names_proto3.proto \ java/kotlin/src/test/proto/com/google/protobuf/example_extensible_message.proto \ java/kotlin/src/test/proto/com/google/protobuf/multiple_files_proto3.proto \ - java/kotlin-lite/BUILD \ + java/kotlin-lite/BUILD.bazel \ java/kotlin-lite/generate-sources-build.xml \ java/kotlin-lite/generate-test-sources-build.xml \ java/kotlin-lite/lite.awk \ @@ -583,7 +583,7 @@ java_EXTRA_DIST= java/kotlin-lite/src/test/kotlin/com/google/protobuf/ExtendableMessageLiteExtensionsTest.kt\ java/kotlin-lite/src/test/kotlin/com/google/protobuf/Proto2LiteTest.kt \ java/lite.md \ - java/lite/BUILD \ + java/lite/BUILD.bazel \ java/lite/generate-sources-build.xml \ java/lite/generate-test-sources-build.xml \ java/lite/lite.awk \ @@ -591,9 +591,9 @@ java_EXTRA_DIST= java/lite/pom_template.xml \ java/lite/process-lite-sources-build.xml \ java/lite/src/test/java/com/google/protobuf/LiteTest.java \ - java/BUILD \ + java/BUILD.bazel \ java/pom.xml \ - java/util/BUILD \ + java/util/BUILD.bazel \ java/util/pom.xml \ java/util/pom_template.xml \ java/util/src/main/java/com/google/protobuf/util/Durations.java \ @@ -612,10 +612,10 @@ java_EXTRA_DIST= java/util/src/test/java/com/google/protobuf/util/ValuesTest.java \ java/util/src/test/proto/com/google/protobuf/util/json_test.proto -# Note: please keep this in sync with the dist_files rule in objectivec/BUILD. +# Note: please keep this in sync with the dist_files rule in objectivec/BUILD.bazel. objectivec_EXTRA_DIST= \ objectivec/.clang-format \ - objectivec/BUILD \ + objectivec/BUILD.bazel \ objectivec/DevTools/check_version_stamps.sh \ objectivec/DevTools/compile_testing_protos.sh \ objectivec/DevTools/full_mac_build.sh \ @@ -821,7 +821,7 @@ objectivec_EXTRA_DIST= \ objectivec/Tests/UnitTests-Info.plist \ Protobuf.podspec -# Note: please keep this in sync with the dist_files rule in php/BUILD. +# Note: please keep this in sync with the dist_files rule in php/BUILD.bazel. php_EXTRA_DIST= \ php/README.md \ php/REFCOUNTING.md \ @@ -1018,7 +1018,7 @@ php_EXTRA_DIST= \ php/tests/WellKnownTest.php \ php/tests/WrapperTypeSettersTest.php -# Note: please keep this in sync with the python_dist_files rule in BUILD. +# Note: please keep this in sync with the python_dist_files rule in BUILD.bazel. python_EXTRA_DIST= \ python/MANIFEST.in \ python/google/__init__.py \ @@ -1142,7 +1142,7 @@ python_EXTRA_DIST= \ python/tox.ini \ python/README.md -# Note: please keep this in sync with the dist_files rule in ruby/BUILD. +# Note: please keep this in sync with the dist_files rule in ruby/BUILD.bazel. ruby_EXTRA_DIST= \ ruby/Gemfile \ ruby/.gitignore \ @@ -1220,7 +1220,7 @@ ruby_EXTRA_DIST= \ all_EXTRA_DIST=$(csharp_EXTRA_DIST) $(java_EXTRA_DIST) $(objectivec_EXTRA_DIST) $(php_EXTRA_DIST) $(python_EXTRA_DIST) $(ruby_EXTRA_DIST) -# Note: please keep this in sync with the common_dist_files rule in BUILD. +# Note: please keep this in sync with the common_dist_files rule in BUILD.bazel. EXTRA_DIST = $(@DIST_LANG@_EXTRA_DIST) \ autogen.sh \ generate_descriptor_proto.sh \ @@ -1229,7 +1229,7 @@ EXTRA_DIST = $(@DIST_LANG@_EXTRA_DIST) \ CONTRIBUTORS.txt \ CHANGES.txt \ update_file_lists.sh \ - BUILD \ + BUILD.bazel \ WORKSPACE \ CMakeLists.txt \ cmake/abseil-cpp.cmake \ @@ -1254,12 +1254,12 @@ EXTRA_DIST = $(@DIST_LANG@_EXTRA_DIST) \ compiler_config_setting.bzl \ build_files_updated_unittest.sh \ cc_proto_blacklist_test.bzl \ - csharp/BUILD \ + csharp/BUILD.bazel \ editors/README.txt \ editors/proto.vim \ editors/protobuf-mode.el \ examples/AddPerson.java \ - examples/BUILD \ + examples/BUILD.bazel \ examples/CMakeLists.txt \ examples/ListPeople.java \ examples/Makefile \ @@ -1281,14 +1281,14 @@ EXTRA_DIST = $(@DIST_LANG@_EXTRA_DIST) \ examples/pubspec.yaml \ internal.bzl \ maven_install.json \ - php/BUILD \ + php/BUILD.bazel \ protobuf.bzl \ protobuf_deps.bzl \ protobuf_release.bzl \ protobuf_version.bzl \ - ruby/BUILD \ + ruby/BUILD.bazel \ third_party/zlib.BUILD \ - util/python/BUILD + util/python/BUILD.bazel # Deletes all the files generated by autogen.sh. MAINTAINERCLEANFILES = \ diff --git a/benchmarks/BUILD b/benchmarks/BUILD.bazel similarity index 98% rename from benchmarks/BUILD rename to benchmarks/BUILD.bazel index 2f7b4c749..83b2c7ee5 100644 --- a/benchmarks/BUILD +++ b/benchmarks/BUILD.bazel @@ -75,7 +75,7 @@ pkg_files( ], exclude = [ "__init__.py", # not in autotools dist - "BUILD", + "BUILD.bazel", "go/*", ], ), diff --git a/benchmarks/cpp/BUILD b/benchmarks/cpp/BUILD.bazel similarity index 100% rename from benchmarks/cpp/BUILD rename to benchmarks/cpp/BUILD.bazel diff --git a/benchmarks/datasets/BUILD b/benchmarks/datasets/BUILD.bazel similarity index 98% rename from benchmarks/datasets/BUILD rename to benchmarks/datasets/BUILD.bazel index 1cb11bdda..2a8b40266 100644 --- a/benchmarks/datasets/BUILD +++ b/benchmarks/datasets/BUILD.bazel @@ -61,7 +61,7 @@ java_library( pkg_files( name = "dist_files", - srcs = ["BUILD"], + srcs = ["BUILD.bazel"], strip_prefix = strip_prefix.from_root(""), visibility = ["//benchmarks:__pkg__"], ) diff --git a/benchmarks/datasets/google_message1/proto2/BUILD b/benchmarks/datasets/google_message1/proto2/BUILD.bazel similarity index 100% rename from benchmarks/datasets/google_message1/proto2/BUILD rename to benchmarks/datasets/google_message1/proto2/BUILD.bazel diff --git a/benchmarks/datasets/google_message1/proto3/BUILD b/benchmarks/datasets/google_message1/proto3/BUILD.bazel similarity index 100% rename from benchmarks/datasets/google_message1/proto3/BUILD rename to benchmarks/datasets/google_message1/proto3/BUILD.bazel diff --git a/benchmarks/datasets/google_message2/BUILD b/benchmarks/datasets/google_message2/BUILD.bazel similarity index 100% rename from benchmarks/datasets/google_message2/BUILD rename to benchmarks/datasets/google_message2/BUILD.bazel diff --git a/benchmarks/datasets/google_message3/BUILD b/benchmarks/datasets/google_message3/BUILD.bazel similarity index 100% rename from benchmarks/datasets/google_message3/BUILD rename to benchmarks/datasets/google_message3/BUILD.bazel diff --git a/benchmarks/datasets/google_message4/BUILD b/benchmarks/datasets/google_message4/BUILD.bazel similarity index 100% rename from benchmarks/datasets/google_message4/BUILD rename to benchmarks/datasets/google_message4/BUILD.bazel diff --git a/csharp/BUILD b/csharp/BUILD.bazel similarity index 97% rename from csharp/BUILD rename to csharp/BUILD.bazel index 6d31ba0cc..2c150841b 100644 --- a/csharp/BUILD +++ b/csharp/BUILD.bazel @@ -13,7 +13,7 @@ pkg_files( ]) + [ ".editorconfig", ".gitignore", - "BUILD", + "BUILD.bazel", "CHANGES.txt", "Google.Protobuf.Tools.nuspec", "Google.Protobuf.Tools.targets", diff --git a/examples/BUILD b/examples/BUILD.bazel similarity index 99% rename from examples/BUILD rename to examples/BUILD.bazel index 358a1529b..d5a719ca8 100644 --- a/examples/BUILD +++ b/examples/BUILD.bazel @@ -110,7 +110,7 @@ pkg_files( name = "dist_files", srcs = [ "AddPerson.java", - "BUILD", + "BUILD.bazel", "CMakeLists.txt", "ListPeople.java", "Makefile", diff --git a/java/BUILD b/java/BUILD.bazel similarity index 98% rename from java/BUILD rename to java/BUILD.bazel index c084db639..b3178c9f8 100644 --- a/java/BUILD +++ b/java/BUILD.bazel @@ -28,7 +28,7 @@ filegroup( pkg_files( name = "dist_files", srcs = [ - "BUILD", + "BUILD.bazel", "README.md", "bom/pom.xml", "lite.md", diff --git a/java/core/BUILD b/java/core/BUILD.bazel similarity index 99% rename from java/core/BUILD rename to java/core/BUILD.bazel index 685ebd098..4a3884768 100644 --- a/java/core/BUILD +++ b/java/core/BUILD.bazel @@ -420,7 +420,7 @@ pkg_files( "src/test/java/**/*.java", "src/test/proto/**/*.proto", ]) + [ - "BUILD", + "BUILD.bazel", "generate-sources-build.xml", "generate-test-sources-build.xml", "pom.xml", diff --git a/java/internal/BUILD b/java/internal/BUILD.bazel similarity index 92% rename from java/internal/BUILD rename to java/internal/BUILD.bazel index d2e0b538f..662dabd56 100644 --- a/java/internal/BUILD +++ b/java/internal/BUILD.bazel @@ -5,7 +5,7 @@ load("@rules_pkg//:mappings.bzl", "pkg_files", "strip_prefix") pkg_files( name = "dist_files", srcs = [ - "BUILD", + "BUILD.bazel", "testing.bzl", ], strip_prefix = strip_prefix.from_root(""), diff --git a/java/kotlin-lite/BUILD b/java/kotlin-lite/BUILD.bazel similarity index 99% rename from java/kotlin-lite/BUILD rename to java/kotlin-lite/BUILD.bazel index 18914441c..88f6014fc 100644 --- a/java/kotlin-lite/BUILD +++ b/java/kotlin-lite/BUILD.bazel @@ -191,7 +191,7 @@ pkg_files( "src/main/kotlin/com/google/protobuf/*.kt", "src/test/kotlin/**/*.kt", ]) + [ - "BUILD", + "BUILD.bazel", "generate-sources-build.xml", "generate-test-sources-build.xml", "lite.awk", diff --git a/java/kotlin/BUILD b/java/kotlin/BUILD.bazel similarity index 99% rename from java/kotlin/BUILD rename to java/kotlin/BUILD.bazel index c8aae0a04..c48cb0376 100644 --- a/java/kotlin/BUILD +++ b/java/kotlin/BUILD.bazel @@ -303,7 +303,7 @@ pkg_files( "src/test/kotlin/**/*.kt", "src/test/proto/**/*.proto", ]) + [ - "BUILD", + "BUILD.bazel", "generate-sources-build.xml", "generate-test-sources-build.xml", "pom.xml", diff --git a/java/lite/BUILD b/java/lite/BUILD.bazel similarity index 99% rename from java/lite/BUILD rename to java/lite/BUILD.bazel index 6ff858e3f..b492cdda7 100644 --- a/java/lite/BUILD +++ b/java/lite/BUILD.bazel @@ -83,7 +83,7 @@ pkg_files( srcs = glob([ "**/*.java", ]) + [ - "BUILD", + "BUILD.bazel", "generate-sources-build.xml", "generate-test-sources-build.xml", "lite.awk", diff --git a/java/util/BUILD b/java/util/BUILD.bazel similarity index 99% rename from java/util/BUILD rename to java/util/BUILD.bazel index 820adb9a0..ac9b5fde3 100644 --- a/java/util/BUILD +++ b/java/util/BUILD.bazel @@ -83,7 +83,7 @@ pkg_files( "src/test/**/*.java", "src/test/**/*.proto", ]) + [ - "BUILD", + "BUILD.bazel", "pom.xml", "pom_template.xml", ], diff --git a/objectivec/BUILD b/objectivec/BUILD.bazel similarity index 99% rename from objectivec/BUILD rename to objectivec/BUILD.bazel index 7b0ede686..c18788f40 100644 --- a/objectivec/BUILD +++ b/objectivec/BUILD.bazel @@ -111,7 +111,7 @@ pkg_files( "Tests/*.proto", ]) + [ ".clang-format", - "BUILD", + "BUILD.bazel", "README.md", "Tests/golden_message", "Tests/golden_packed_fields_message", diff --git a/php/BUILD b/php/BUILD.bazel similarity index 97% rename from php/BUILD rename to php/BUILD.bazel index cf94be1cd..346095957 100644 --- a/php/BUILD +++ b/php/BUILD.bazel @@ -14,7 +14,7 @@ pkg_files( "tests/*.sh", "tests/proto/**/*.proto", ]) + [ - "BUILD", + "BUILD.bazel", "README.md", "REFCOUNTING.md", "composer.json", diff --git a/pkg/BUILD b/pkg/BUILD.bazel similarity index 100% rename from pkg/BUILD rename to pkg/BUILD.bazel diff --git a/ruby/BUILD b/ruby/BUILD.bazel similarity index 97% rename from ruby/BUILD rename to ruby/BUILD.bazel index 1884c3983..fe336e549 100644 --- a/ruby/BUILD +++ b/ruby/BUILD.bazel @@ -14,7 +14,7 @@ pkg_files( "tests/*.rb", ]) + [ ".gitignore", - "BUILD", + "BUILD.bazel", "Gemfile", "README.md", "Rakefile", diff --git a/third_party/BUILD b/third_party/BUILD.bazel similarity index 100% rename from third_party/BUILD rename to third_party/BUILD.bazel diff --git a/third_party/utf8_range/BUILD b/third_party/utf8_range/BUILD.bazel similarity index 100% rename from third_party/utf8_range/BUILD rename to third_party/utf8_range/BUILD.bazel diff --git a/toolchain/BUILD b/toolchain/BUILD.bazel similarity index 100% rename from toolchain/BUILD rename to toolchain/BUILD.bazel diff --git a/util/python/BUILD b/util/python/BUILD.bazel similarity index 96% rename from util/python/BUILD rename to util/python/BUILD.bazel index 85ede91c5..071efd20b 100644 --- a/util/python/BUILD +++ b/util/python/BUILD.bazel @@ -1,6 +1,6 @@ load("@rules_cc//cc:defs.bzl", "cc_library") -exports_files(["BUILD"]) +exports_files(["BUILD.bazel"]) # This is a placeholder for python headers. Projects needing to use # fast cpp protos in protobuf's python interface should build with