From 9ca1b66317c486a21ddb4cbea43a866da1d477e1 Mon Sep 17 00:00:00 2001 From: Nikhil Benesch Date: Tue, 30 Jan 2018 19:19:32 -0500 Subject: [PATCH 1/2] Makefile: define CPP_PROTOS[_CCL]_TARGET before its use libroach and libroachccl were entirely failing to express a dependency on CPP_PROTOS_TARGET and CPP_PROTOS_CPP_TARGET, as neither of those variables were defined at their point of use. Hoist those variables higher in the Makefile. This will actually fix the failing builds that #22231 attempted to address. Release note: None --- Makefile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 3f7791b22753..56bd4936f26f 100644 --- a/Makefile +++ b/Makefile @@ -336,6 +336,11 @@ BOOTSTRAP_TARGET := bin/.bootstrap SUBMODULES_TARGET := bin/.submodules-initialized +GO_PROTOS_TARGET := bin/.go_protobuf_sources +GW_PROTOS_TARGET := bin/.gw_protobuf_sources +CPP_PROTOS_TARGET := bin/.cpp_protobuf_sources +CPP_PROTOS_CCL_TARGET := bin/.cpp_ccl_protobuf_sources + # Update the git hooks and install commands from dependencies whenever they # change. $(BOOTSTRAP_TARGET): $(GITHOOKS) Gopkg.lock bin/returncheck | $(SUBMODULES_TARGET) @@ -684,11 +689,6 @@ SQLPARSER_TARGETS = \ DOCGEN_TARGETS := bin/.docgen_bnfs bin/.docgen_functions -GO_PROTOS_TARGET := bin/.go_protobuf_sources -GW_PROTOS_TARGET := bin/.gw_protobuf_sources -CPP_PROTOS_TARGET := bin/.cpp_protobuf_sources -CPP_PROTOS_CCL_TARGET := bin/.cpp_ccl_protobuf_sources - .DEFAULT_GOAL := all all: $(COCKROACH) From 66c05c8379011f9c7cddf36676578c6fa386faa2 Mon Sep 17 00:00:00 2001 From: Nikhil Benesch Date: Tue, 30 Jan 2018 19:23:06 -0500 Subject: [PATCH 2/2] Makefile: fix cpp proto cleanup The former find invocations were only operating inside ./pkg, but the CPP protos are generated into c-deps/protos and c-deps/protoccl. Since they have dedicated directories, just nuke those directories instead of mucking around with find. Release note: None --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 56bd4936f26f..fef008d94b1a 100644 --- a/Makefile +++ b/Makefile @@ -987,14 +987,14 @@ $(GW_PROTOS_TARGET): $(PROTOC) $(GW_SERVER_PROTOS) $(GW_TS_PROTOS) $(GO_PROTOS) touch $@ $(CPP_PROTOS_TARGET): $(PROTOC) $(CPP_PROTOS) - $(FIND_RELEVANT) -type f \( -name '*.pb.h' -o -name '*.pb.cc' \) -exec rm {} + + rm -rf $(CPP_PROTO_ROOT) mkdir -p $(CPP_PROTO_ROOT) build/werror.sh $(PROTOC) -I$(PKG_ROOT):$(GOGO_PROTOBUF_PATH):$(PROTOBUF_PATH) --cpp_out=lite:$(CPP_PROTO_ROOT) $(CPP_PROTOS) $(SED_INPLACE) -E '/gogoproto/d' $(CPP_HEADERS) $(CPP_SOURCES) touch $@ $(CPP_PROTOS_CCL_TARGET): $(PROTOC) $(CPP_PROTOS_CCL) - $(FIND_RELEVANT) -type f \( -name '*.pb.h' -o -name '*.pb.cc' \) -exec rm {} + + rm -rf $(CPP_PROTO_CCL_ROOT) mkdir -p $(CPP_PROTO_CCL_ROOT) build/werror.sh $(PROTOC) -I$(PKG_ROOT):$(GOGO_PROTOBUF_PATH):$(PROTOBUF_PATH) --cpp_out=lite:$(CPP_PROTO_CCL_ROOT) $(CPP_PROTOS_CCL) $(SED_INPLACE) -E '/gogoproto/d' $(CPP_HEADERS_CCL) $(CPP_SOURCES_CCL)