Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove all autotools usage #10132

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
94f0eda
Bazelfying conformance tests
mkruskal-google Jun 15, 2022
3056bac
Delete benchmarks for languages supported by other repositories
mkruskal-google Jun 14, 2022
fe1ae2a
Bazelfying benchmark tests
mkruskal-google Jun 18, 2022
4e8ec45
Bazelfying python
mkruskal-google Jun 22, 2022
1d4e82e
Bazelfying Ruby
mkruskal-google Jul 21, 2022
829767c
Bazelfying C#
mkruskal-google Jul 21, 2022
e84953c
Bazelfying Objective-c
mkruskal-google Jul 11, 2022
f2694de
Bazelfying Kokoro mac builds
mkruskal-google Jul 22, 2022
657fda0
Bazelfying Kokoro linux builds
mkruskal-google Aug 2, 2022
63a5278
Deleting all deprecated files from autotools cleanup
mkruskal-google Aug 2, 2022
f42012b
Cleanup after PR reorganizing
mkruskal-google Aug 2, 2022
ba9a146
Updating READMEs to use bazel instead of autotools.
mkruskal-google Aug 2, 2022
6427eb3
Bazelfying Kokoro release builds
mkruskal-google Aug 2, 2022
c8738e3
First round of review fixes
mkruskal-google Aug 3, 2022
226c1fd
Second round of review fixes
mkruskal-google Aug 3, 2022
39c2bf0
Third round of review fixes
mkruskal-google Aug 4, 2022
730569a
Filtering out conformance tests from Bazel on Windows (b/241484899)
mkruskal-google Aug 9, 2022
2f88b86
Add version metadata that was previously scraped from configure.ac
mkruskal-google Aug 9, 2022
3d89a9b
fixing typo from previous fix
mkruskal-google Aug 9, 2022
718af2f
Adding ruby version tests
mkruskal-google Aug 10, 2022
eb70c29
Bumping pinned upb version, and adding tests to python CI
mkruskal-google Aug 10, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 0 additions & 26 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,24 +1,3 @@
# autogen.sh-generated files
Makefile.in
src/Makefile.in
config.guess
config.h.in
config.sub
configure
depcomp
install-sh
ltmain.sh
missing
configure~

aclocal.m4
m4/libtool.m4
m4/ltoptions.m4
m4/ltsugar.m4
m4/ltversion.m4
m4/lt~obsolete.m4
autom4te.cache

# CMake-generated files
.ninja_deps
.ninja_logs
Expand All @@ -40,8 +19,6 @@ Testing/Temporary/*
/gmock

# in-tree configure-generated files
Makefile
src/Makefile
/config.h
config.log
config.status
Expand All @@ -56,7 +33,6 @@ stamp-h1
*.o
*.lo
*.la
src/.libs
*.so
*.a

Expand All @@ -79,8 +55,6 @@ python/build/
python/docs/_build/

src/js_embed
src/protoc
src/unittest_proto_middleman

# vim generated
*.swp
Expand Down
143 changes: 104 additions & 39 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ load("@rules_pkg//:mappings.bzl", "pkg_files", "strip_prefix")
load("@rules_proto//proto:defs.bzl", "proto_lang_toolchain", "proto_library")
load("@rules_java//java:defs.bzl", "java_binary", "java_lite_proto_library", "java_proto_library")
load("//build_defs:cpp_opts.bzl", "COPTS", "LINK_OPTS", "PROTOC_LINK_OPTS")
load(":protobuf.bzl", "py_proto_library")
load(":protobuf.bzl", "internal_py_proto_library", "internal_php_proto_library", "internal_ruby_proto_library", "internal_objc_proto_library")

licenses(["notice"])

Expand Down Expand Up @@ -145,6 +145,16 @@ filegroup(
visibility = ["//visibility:public"],
)

internal_ruby_proto_library(
name = "well_known_ruby_protos",
srcs = [":well_known_protos"],
includes = ["src"],
visibility = [
"//conformance:__pkg__",
"//ruby:__subpackages__",
],
)

################################################################################
# Protocol Buffers Compiler
################################################################################
Expand Down Expand Up @@ -302,6 +312,10 @@ proto_lang_toolchain(
visibility = ["//visibility:public"],
)

################################################################################
# Objective-C support
################################################################################

alias(
name = "objectivec",
actual = "//objectivec",
Expand Down Expand Up @@ -355,7 +369,7 @@ proto_library(
deps = ["//src/google/protobuf:generic_test_protos"],
)

py_proto_library(
internal_py_proto_library(
name = "generated_protos_py",
testonly = 1,
srcs = [":generated_protos"],
Expand All @@ -368,22 +382,22 @@ py_proto_library(
# Conformance tests
################################################################################

alias(
name = "conformance_test_runner",
actual = "//conformance:conformance_test_runner",
visibility = ["//visibility:public"],
)

alias(
name = "test_messages_proto2_proto",
actual = "//src/google/protobuf:test_messages_proto2_proto", # proto_library
visibility = ["//visibility:public"],
cc_proto_library(
name = "test_messages_proto2_cc_proto",
visibility = [
"//conformance:__pkg__",
"//src:__subpackages__",
],
deps = ["//src/google/protobuf:test_messages_proto2_proto"],
)

alias(
name = "test_messages_proto3_proto",
actual = "//src/google/protobuf:test_messages_proto3_proto", # proto_library
visibility = ["//visibility:public"],
cc_proto_library(
name = "test_messages_proto3_cc_proto",
visibility = [
"//conformance:__pkg__",
"//src:__subpackages__",
],
deps = ["//src/google/protobuf:test_messages_proto3_proto"],
)

java_proto_library(
Expand All @@ -392,7 +406,7 @@ java_proto_library(
"//conformance:__pkg__",
"//java:__subpackages__",
],
deps = [":test_messages_proto2_proto"],
deps = ["//src/google/protobuf:test_messages_proto2_proto"],
)

java_proto_library(
Expand All @@ -401,7 +415,7 @@ java_proto_library(
"//conformance:__pkg__",
"//java:__subpackages__",
],
deps = [":test_messages_proto3_proto"],
deps = ["//src/google/protobuf:test_messages_proto3_proto"],
)

java_lite_proto_library(
Expand All @@ -410,7 +424,7 @@ java_lite_proto_library(
"//conformance:__pkg__",
"//java:__subpackages__",
],
deps = [":test_messages_proto2_proto"],
deps = ["//src/google/protobuf:test_messages_proto2_proto"],
)

java_lite_proto_library(
Expand All @@ -419,7 +433,77 @@ java_lite_proto_library(
"//conformance:__pkg__",
"//java:__subpackages__",
],
deps = [":test_messages_proto3_proto"],
deps = ["//src/google/protobuf:test_messages_proto3_proto"],
)

internal_objc_proto_library(
name = "test_messages_proto2_objc_proto",
srcs = ["//src/google/protobuf:test_messages_proto2.proto"],
includes = ["src/google/protobuf"],
testonly = 1,
visibility = [
"//conformance:__pkg__",
"//objectivec:__subpackages__",
],
)

internal_objc_proto_library(
name = "test_messages_proto3_objc_proto",
srcs = ["//src/google/protobuf:test_messages_proto3.proto"],
proto_deps = [":well_known_protos"],
includes = ["src/google/protobuf", "src"],
testonly = 1,
visibility = [
"//conformance:__pkg__",
"//objectivec:__subpackages__",
],
)

internal_php_proto_library(
name = "test_messages_proto3_php_proto",
srcs = ["//src/google/protobuf:test_messages_proto3.proto"],
proto_deps = [":well_known_protos"],
includes = ["src/google/protobuf", "src"],
outs = [
"Protobuf_test_messages/Proto3/EnumOnlyProto3.php",
"Protobuf_test_messages/Proto3/EnumOnlyProto3/PBBool.php",
"Protobuf_test_messages/Proto3/ForeignEnum.php",
"Protobuf_test_messages/Proto3/ForeignMessage.php",
"Protobuf_test_messages/Proto3/NullHypothesisProto3.php",
"Protobuf_test_messages/Proto3/TestAllTypesProto3.php",
"Protobuf_test_messages/Proto3/TestAllTypesProto3/AliasedEnum.php",
"Protobuf_test_messages/Proto3/TestAllTypesProto3/NestedEnum.php",
"Protobuf_test_messages/Proto3/TestAllTypesProto3/NestedMessage.php",
"GPBMetadata/TestMessagesProto3.php",
],
testonly = 1,
visibility = [
"//conformance:__pkg__",
"//php:__subpackages__",
],
)

internal_ruby_proto_library(
name = "test_messages_proto2_ruby_proto",
srcs = ["//src/google/protobuf:test_messages_proto2.proto"],
includes = ["src/google/protobuf"],
testonly = 1,
visibility = [
"//conformance:__pkg__",
"//ruby:__subpackages__",
],
)

internal_ruby_proto_library(
name = "test_messages_proto3_ruby_proto",
srcs = ["//src/google/protobuf:test_messages_proto3.proto"],
proto_deps = [":well_known_protos"],
includes = ["src/google/protobuf", "src"],
testonly = 1,
visibility = [
"//conformance:__pkg__",
"//ruby:__subpackages__",
],
)

filegroup(
Expand All @@ -441,22 +525,6 @@ pkg_files(
"cmake/*.cmake",
"cmake/*.in",
"editors/*",

# Several of these files are generated by autogen.sh, so using
# glob() lets us ignore them if they are missing. (This is not good
# practice, though.)
"Makefile.in",
"aclocal.m4",
"ar-lib",
"compile",
"config*",
"depcomp",
"install-sh",
"ltmain.sh",
"m4/*.m4",
"missing",
"protobuf*.pc.in",
"test-driver",
],
allow_empty = True,
) + [
Expand All @@ -465,18 +533,15 @@ pkg_files(
"CMakeLists.txt",
"CONTRIBUTORS.txt",
"LICENSE",
"Makefile.am",
"README.md",
"WORKSPACE",
"autogen.sh",
"cmake/CMakeLists.txt",
"cmake/README.md",
"cmake/update_file_lists.sh",
"generate_descriptor_proto.sh",
"maven_install.json",
"//third_party:BUILD.bazel",
"//third_party:zlib.BUILD",
"//util/python:BUILD.bazel",
],
strip_prefix = strip_prefix.from_root(""),
visibility = ["//pkg:__pkg__"],
Expand Down
22 changes: 5 additions & 17 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -79,30 +79,18 @@ mark_as_advanced(protobuf_DEBUG_POSTFIX)
# User options
include(${protobuf_SOURCE_DIR}/cmake/protobuf-options.cmake)

# Version metadata
set(protobuf_VERSION_STRING "3.21.4")
set(protobuf_DESCRIPTION "Protocol Buffers")
set(protobuf_CONTACT "protobuf@googlegroups.com")

# Overrides for option dependencies
if (protobuf_BUILD_PROTOC_BINARIES OR protobuf_BUILD_TESTS)
set(protobuf_BUILD_LIBPROTOC ON)
endif ()
if (NOT protobuf_BUILD_PROTOBUF_BINARIES)
set(protobuf_INSTALL OFF)
endif()
# Path to main configure script
set(protobuf_CONFIGURE_SCRIPT "${protobuf_SOURCE_DIR}/configure.ac")

# Parse configure script
set(protobuf_AC_INIT_REGEX
"^AC_INIT\\(\\[([^]]+)\\],\\[([^]]+)\\],\\[([^]]+)\\],\\[([^]]+)\\]\\)$")
file(STRINGS "${protobuf_CONFIGURE_SCRIPT}" protobuf_AC_INIT_LINE
LIMIT_COUNT 1 REGEX "^AC_INIT")
# Description
string(REGEX REPLACE "${protobuf_AC_INIT_REGEX}" "\\1"
protobuf_DESCRIPTION "${protobuf_AC_INIT_LINE}")
# Version
string(REGEX REPLACE "${protobuf_AC_INIT_REGEX}" "\\2"
protobuf_VERSION_STRING "${protobuf_AC_INIT_LINE}")
# Contact
string(REGEX REPLACE "${protobuf_AC_INIT_REGEX}" "\\3"
protobuf_CONTACT "${protobuf_AC_INIT_LINE}")
# Parse version tweaks
set(protobuf_VERSION_REGEX "^([0-9]+)\\.([0-9]+)\\.([0-9]+)([-]rc[-]|\\.)?([0-9]*)$")
string(REGEX REPLACE "${protobuf_VERSION_REGEX}" "\\1"
Expand Down
Loading