diff --git a/.gitmodules b/.gitmodules index 2b79db1d235c..e9d7c0e0e14e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,9 +4,6 @@ [submodule "c-deps/jemalloc"] path = c-deps/jemalloc url = https://github.com/cockroachdb/jemalloc.git -[submodule "c-deps/protobuf"] - path = c-deps/protobuf - url = https://github.com/cockroachdb/protobuf.git [submodule "pkg/ui/yarn-vendor"] path = pkg/ui/yarn-vendor url = https://github.com/cockroachdb/yarn-vendored diff --git a/BUILD.bazel b/BUILD.bazel index f799ac84b482..e406acf3de46 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -72,7 +72,6 @@ load("@bazel_gazelle//:def.bzl", "gazelle") # # gazelle:exclude _bazel # gazelle:exclude c-deps/krb5 -# gazelle:exclude c-deps/protobuf # gazelle:exclude artifacts # gazelle:exclude vendor # gazelle:exclude .vendor.tmp.* diff --git a/Makefile b/Makefile index ebf19b42e303..78d8b4702fe0 100644 --- a/Makefile +++ b/Makefile @@ -487,7 +487,6 @@ endif C_DEPS_DIR := $(abspath c-deps) JEMALLOC_SRC_DIR := $(C_DEPS_DIR)/jemalloc -PROTOBUF_SRC_DIR := $(C_DEPS_DIR)/protobuf GEOS_SRC_DIR := $(C_DEPS_DIR)/geos PROJ_SRC_DIR := $(C_DEPS_DIR)/proj LIBEDIT_SRC_DIR := $(C_DEPS_DIR)/libedit @@ -512,16 +511,13 @@ BUILD_DIR := $(shell cygpath -m $(BUILD_DIR)) endif JEMALLOC_DIR := $(BUILD_DIR)/jemalloc -PROTOBUF_DIR := $(BUILD_DIR)/protobuf GEOS_DIR := $(BUILD_DIR)/geos PROJ_DIR := $(BUILD_DIR)/proj LIBEDIT_DIR := $(BUILD_DIR)/libedit LIBROACH_DIR := $(BUILD_DIR)/libroach$(if $(ENABLE_LIBROACH_ASSERTIONS),_assert) KRB5_DIR := $(BUILD_DIR)/krb5 -# Can't share with protobuf because protoc is always built for the host. LIBJEMALLOC := $(JEMALLOC_DIR)/lib/libjemalloc.a -LIBPROTOBUF := $(PROTOBUF_DIR)/libprotobuf.a LIBEDIT := $(LIBEDIT_DIR)/src/.libs/libedit.a LIBROACH := $(LIBROACH_DIR)/libroach.a LIBPROJ := $(PROJ_DIR)/lib/libproj$(if $(target-is-windows),_4_9).a @@ -543,8 +539,8 @@ C_LIBS_COMMON = \ $(if $(target-is-windows),,$(LIBEDIT)) \ $(LIBPROJ) $(LIBROACH) C_LIBS_SHORT = $(C_LIBS_COMMON) -C_LIBS_OSS = $(C_LIBS_COMMON) $(LIBPROTOBUF) -C_LIBS_CCL = $(C_LIBS_COMMON) $(LIBPROTOBUF) +C_LIBS_OSS = $(C_LIBS_COMMON) +C_LIBS_CCL = $(C_LIBS_COMMON) C_LIBS_DYNAMIC = $(LIBGEOS) # We only include krb5 on linux, non-musl builds. @@ -601,7 +597,7 @@ $(BASE_CGO_FLAGS_FILES): Makefile build/defs.mk.sig | bin/.submodules-initialize @echo 'package $(if $($(@D)-package),$($(@D)-package),$(notdir $(@D)))' >> $@ @echo >> $@ @echo '// #cgo CPPFLAGS: $(addprefix -I,$(JEMALLOC_DIR)/include $(KRB_CPPFLAGS))' >> $@ - @echo '// #cgo LDFLAGS: $(addprefix -L,$(PROTOBUF_DIR) $(JEMALLOC_DIR)/lib $(LIBEDIT_DIR)/src/.libs $(LIBROACH_DIR) $(KRB_DIR) $(PROJ_DIR)/lib)' >> $@ + @echo '// #cgo LDFLAGS: $(addprefix -L,$(JEMALLOC_DIR)/lib $(LIBEDIT_DIR)/src/.libs $(LIBROACH_DIR) $(KRB_DIR) $(PROJ_DIR)/lib)' >> $@ @echo 'import "C"' >> $@ vendor/github.com/knz/go-libedit/unix/zcgo_flags_extra.go: Makefile | bin/.submodules-initialized @@ -659,14 +655,6 @@ $(KRB5_DIR)/Makefile: $(C_DEPS_DIR)/krb5-rebuild $(KRB5_SRC_DIR)/src/configure @# We specify -fcommon to get around duplicate definition errors in recent gcc. cd $(KRB5_DIR) && env -u CXXFLAGS CFLAGS="-fcommon" $(KRB5_SRC_DIR)/src/configure $(xconfigure-flags) --enable-static --disable-shared -$(PROTOBUF_DIR)/Makefile: $(C_DEPS_DIR)/protobuf-rebuild | bin/.submodules-initialized - rm -rf $(PROTOBUF_DIR) - mkdir -p $(PROTOBUF_DIR) - @# NOTE: If you change the CMake flags below, bump the version in - @# $(C_DEPS_DIR)/protobuf-rebuild. See above for rationale. - cd $(PROTOBUF_DIR) && cmake $(xcmake-flags) -Dprotobuf_WITH_ZLIB=OFF -Dprotobuf_BUILD_TESTS=OFF $(PROTOBUF_SRC_DIR)/cmake \ - -DCMAKE_BUILD_TYPE=Release - $(GEOS_DIR)/Makefile: $(C_DEPS_DIR)/geos-rebuild | bin/.submodules-initialized rm -rf $(GEOS_DIR) mkdir -p $(GEOS_DIR) @@ -736,9 +724,6 @@ $(LIBEDIT_DIR)/Makefile: $(C_DEPS_DIR)/libedit-rebuild $(LIBEDIT_SRC_DIR)/config $(LIBJEMALLOC): $(JEMALLOC_DIR)/Makefile bin/uptodate .ALWAYS_REBUILD @uptodate $@ $(JEMALLOC_SRC_DIR) || $(MAKE) --no-print-directory -C $(JEMALLOC_DIR) build_lib_static -$(LIBPROTOBUF): $(PROTOBUF_DIR)/Makefile bin/uptodate .ALWAYS_REBUILD - @uptodate $@ $(PROTOBUF_SRC_DIR) || $(MAKE) --no-print-directory -C $(PROTOBUF_DIR) libprotobuf - ifdef is-cross-compile ifdef target-is-macos geos_require_install_name_tool := 1 @@ -789,10 +774,9 @@ $(LIBKRB5): $(KRB5_DIR)/Makefile bin/uptodate .ALWAYS_REBUILD @uptodate $@ $(KRB5_SRC_DIR)/src || $(MAKE) --no-print-directory -C $(KRB5_DIR) # Convenient names for maintainers. Not used by other targets in the Makefile. -.PHONY: libjemalloc libprotobuf libgeos libproj libroach libkrb5 +.PHONY: libjemalloc libgeos libproj libroach libkrb5 libedit: $(LIBEDIT) libjemalloc: $(LIBJEMALLOC) -libprotobuf: $(LIBPROTOBUF) libgeos: $(LIBGEOS) libproj: $(LIBPROJ) libroach: $(LIBROACH) @@ -1685,7 +1669,6 @@ c-deps-fmt: .PHONY: clean-c-deps clean-c-deps: rm -rf $(JEMALLOC_DIR) - rm -rf $(PROTOBUF_DIR) rm -rf $(GEOS_DIR) rm -rf $(PROJ_DIR) rm -rf $(LIBROACH_DIR) @@ -1694,7 +1677,6 @@ clean-c-deps: .PHONY: unsafe-clean-c-deps unsafe-clean-c-deps: git -C $(JEMALLOC_SRC_DIR) clean -dxf - git -C $(PROTOBUF_SRC_DIR) clean -dxf git -C $(GEOS_SRC_DIR) clean -dxf git -C $(PROJ_SRC_DIR) clean -dxf git -C $(LIBROACH_SRC_DIR) clean -dxf diff --git a/build/variables.mk b/build/variables.mk index 0c051a483714..0fe0471fc05d 100644 --- a/build/variables.mk +++ b/build/variables.mk @@ -94,7 +94,6 @@ define VALID_VARS LIBGEOS LIBJEMALLOC LIBPROJ - LIBPROTOBUF LIBROACH LIBROACH_DIR LIBROACH_SRC_DIR @@ -117,8 +116,6 @@ define VALID_VARS PROJ_DIR PROJ_SRC_DIR PROMETHEUS_PATH - PROTOBUF_DIR - PROTOBUF_SRC_DIR PROTOBUF_TARGETS PROTO_MAPPINGS RACETIMEOUT diff --git a/c-deps/REPOSITORIES.bzl b/c-deps/REPOSITORIES.bzl index 9319dedc4904..f249a18b2354 100644 --- a/c-deps/REPOSITORIES.bzl +++ b/c-deps/REPOSITORIES.bzl @@ -11,11 +11,6 @@ BUILD_ALL_CONTENT = """filegroup(name = "all", srcs = glob(["**"]), visibility = # building those libraries require certain checked out repositories being # placed relative to the source tree of the library itself. -# For c-deps/protobuf, we elide a checked in generated file. Already generated -# files are read-only in the bazel sandbox, so bazel is unable to regenerate -# the same files, which the build process requires it to do so. -BUILD_PROTOBUF_CONTENT = """filegroup(name = "all", srcs = glob(["**"], exclude=["src/google/protobuf/compiler/js/well_known_types_embed.cc"]), visibility = ["//visibility:public"])""" - # This is essentially the same above, we elide a generated file to avoid # permission issues when building jemalloc within the bazel sandbox. BUILD_JEMALLOC_CONTENT = """filegroup(name = "all", srcs = glob(["**"], exclude=["configure"]), visibility = ["//visibility:public"])""" @@ -37,11 +32,6 @@ def c_deps(): path = "c-deps/geos", build_file_content = BUILD_ALL_CONTENT, ) - native.new_local_repository( - name = "protobuf", - path = "c-deps/protobuf", - build_file_content = BUILD_PROTOBUF_CONTENT, - ) native.new_local_repository( name = "jemalloc", path = "c-deps/jemalloc", diff --git a/c-deps/protobuf b/c-deps/protobuf deleted file mode 160000 index e809d75ecb57..000000000000 --- a/c-deps/protobuf +++ /dev/null @@ -1 +0,0 @@ -Subproject commit e809d75ecb5770fdc531081eef306b3e672bcdd2