From dc2eecbd63ce700bdfd94782fec5098db79e9048 Mon Sep 17 00:00:00 2001 From: Pirmin Duss Date: Mon, 6 Jan 2020 15:37:01 +0100 Subject: [PATCH] Fix creation of toolchain for protobuf and gRPC This improves the creation of the toolchain needed to build protobuf and gRPC applications on for the Genode framework. Especially, the script is now independent of the distribution's protoc. Issue #190 --- recipes/api/grpc/hash | 2 +- recipes/api/protobuf/hash | 2 +- recipes/src/grpc/hash | 2 +- recipes/src/protobuf/hash | 2 +- tool/tool_chain_protobuf | 48 ++++++++++++--------------------------- 5 files changed, 18 insertions(+), 38 deletions(-) diff --git a/recipes/api/grpc/hash b/recipes/api/grpc/hash index eb76a13..2289c13 100644 --- a/recipes/api/grpc/hash +++ b/recipes/api/grpc/hash @@ -1 +1 @@ -2019-11-26 a43e1dc232eedb942c7671186ab535b181386ee8 +2020-01-06 96878901f9084928e4a9a8e103c226b04bbaa869 diff --git a/recipes/api/protobuf/hash b/recipes/api/protobuf/hash index 2107a19..3b78dc4 100644 --- a/recipes/api/protobuf/hash +++ b/recipes/api/protobuf/hash @@ -1 +1 @@ -2019-11-26 2473fe50075f7ff8b335b7ff50b7be79484bb4de +2020-01-06 2473fe50075f7ff8b335b7ff50b7be79484bb4de diff --git a/recipes/src/grpc/hash b/recipes/src/grpc/hash index ee85697..a67427c 100644 --- a/recipes/src/grpc/hash +++ b/recipes/src/grpc/hash @@ -1 +1 @@ -2019-11-26 73bfa38645a9a4d0457accabccc201508516ea17 +2020-01-06 9b1b94c77fe87e62f6620fdc0e304813a9301f87 diff --git a/recipes/src/protobuf/hash b/recipes/src/protobuf/hash index 4358dcb..16d8a40 100644 --- a/recipes/src/protobuf/hash +++ b/recipes/src/protobuf/hash @@ -1 +1 @@ -2019-11-26 87ea8d858ab10dc9362596f167c0b39b500663a2 +2020-01-06 985c217572a886b5e4ef97d76585e70052f6e45f diff --git a/tool/tool_chain_protobuf b/tool/tool_chain_protobuf index 8d6c5ed..418c7b9 100755 --- a/tool/tool_chain_protobuf +++ b/tool/tool_chain_protobuf @@ -1,6 +1,7 @@ #!/usr/bin/make -f # -# \brief Tool for preparing the protobuf tool-chain for the Genode OS Framework +# \brief Tool for preparing the protobuf and gRPC tool-chain for +# use in the build system of the Genode OS Framework. # \author Pirmin Duss # \date 2019-09-24 # @@ -14,8 +15,8 @@ help: $(ECHO) "Build protobuf and gRPC tools for the Genode OS Framework tool chain" $(ECHO) $(ECHO) "--- available commands ---" - $(ECHO) "build - build protobuf tools" - $(ECHO) "install - install protobuf tools to '$(INSTALL_LOCATION)'" + $(ECHO) "build - build protobuf and gRPC tools" + $(ECHO) "install - install protobuf and gRPC tools to '$(INSTALL_LOCATION)'" $(ECHO) "clean - clean everything except contrib sources" $(ECHO) $(ECHO) "--- available command line options ---" @@ -26,7 +27,7 @@ help: .PHONY: build help install -TOOL_VERSION := 19.11 +TOOL_VERSION := 20.01 # # Enable parallel build for 2nd-level $(MAKE) by default @@ -39,7 +40,7 @@ CMAKE ?= cmake # cmake is required to enable out of tree builds $(call check_tool,$(CMAKE)) -GENODE_DIR ?= $(realpath $(dir $(firstword $(MAKEFILE_LIST)))/..)/../.. +GENODE_DIR ?= $(abspath $(dir $(firstword $(MAKEFILE_LIST)))/../../..) CONTRIB_DIR := $(shell $(GENODE_DIR)/tool/ports/current protobuf_grpc-host)/src/lib HOST_TOOL_DIR := $(CONTRIB_DIR)/grpc-host BUILD_DIR := $(GENODE_DIR)/build/tool/protobuf_grpc/$(TOOL_VERSION) @@ -53,14 +54,7 @@ extract: $(VERBOSE)$(GENODE_DIR)/tool/ports/prepare_port protobuf_grpc-host -configure: extract cares/cmake protobuf/cmake grpc/cmake - -cares/cmake: - $(VERBOSE)mkdir -p $(CARES_BUILD_DIR) - $(VERBOSE)cd $(CARES_BUILD_DIR) && \ - $(CMAKE) -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_PREFIX=$(INSTALL_LOCATION) \ - $(HOST_TOOL_DIR)/third_party/cares/cares +configure: extract protobuf/cmake grpc/cmake protobuf/cmake: $(VERBOSE)mkdir -p $(PROTOC_BUILD_DIR) @@ -69,50 +63,36 @@ protobuf/cmake: -DCMAKE_INSTALL_PREFIX=$(INSTALL_LOCATION) \ $(HOST_TOOL_DIR)/third_party/protobuf/cmake -grpc/cmake: cares/install protobuf/install +grpc/cmake: $(VERBOSE)mkdir -p $(BUILD_DIR) $(VERBOSE)cd $(BUILD_DIR) && \ $(CMAKE) -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX=$(INSTALL_LOCATION) \ -DgRPC_BUILD_CODEGEN=y \ - -DgRPC_CARES_PROVIDER=package \ + -DgRPC_CARES_PROVIDER=module \ -DgRPC_SSL_PROVIDER=package \ -DgRPC_ZLIB_PROVIDER=package \ - -DgRPC_PROTOBUF_PROVIDER=package \ + -DgRPC_PROTOBUF_PROVIDER=module \ $(HOST_TOOL_DIR) -build: configure protobuf/make grpc/make - -cares/make: protobuf/cmake - $(VERBOSE)cd $(CARES_BUILD_DIR) && \ - make -j$(MAKE_JOBS) all - -protobuf/make: protobuf/cmake - $(VERBOSE)cd $(PROTOC_BUILD_DIR) && \ - make -j$(MAKE_JOBS) all +build: configure grpc/make grpc/make: grpc/cmake $(VERBOSE)cd $(BUILD_DIR) && \ make -j$(MAKE_JOBS) all -install: build cares/install protobuf/install grpc/install +install: build grpc/install ifeq ($(INSTALL_LOCATION),$(DEFAULT_INSTALL_LOCATION)) $(VERBOSE)$(SUDO) ln -snf $(TOOL_VERSION) $(dir $(INSTALL_LOCATION))/current endif -cares/install: - $(VERBOSE)cd $(CARES_BUILD_DIR) && \ - $(SUDO) make -j$(MAKE_JOBS) install - -protobuf/install: - $(VERBOSE)cd $(PROTOC_BUILD_DIR) && \ - $(SUDO) make -j$(MAKE_JOBS) install - grpc/install: $(VERBOSE)cd $(BUILD_DIR) && \ $(SUDO) make -j$(MAKE_JOBS) install + $(VERBOSE)cd $(BUILD_DIR) && \ + $(SUDO) cp grpc_*_plugin $(INSTALL_LOCATION)/bin clean: