mirror of
https://github.com/0glabs/0g-chain.git
synced 2024-11-20 15:05:21 +00:00
614d4e40fe
* Update cometbft, cosmos, ethermint, and ibc-go * Replace github.com/tendermint/tendermint by github.com/cometbft/cometbft * Replace github.com/tendermint/tm-db by github.com/cometbft/cometbft-db * Replace gogo/protobuf with cosmos/gogoproto & simapp replacement * Replace cosmos-sdk/simapp/helpers with cosmos-sdk/testutil/sims * Remove no longer used simulations * Replace ibchost with ibcexported See https://github.com/cosmos/ibc-go/blob/v7.2.2/docs/migrations/v6-to-v7.md#ibc-module-constants * Add new consensus params keeper * Add consensus keeper to blockers * Fix keeper and module issues in app.go * Add IsSendEnabledCoins and update SetParams interface changes * Fix protobuf build for cosmos 47 (#1800) * fix cp errors by using -f; fix lint by only linting our proto dir; and use proofs.proto directly from ics23 for ibc-go v7 * run proto-all; commit updated third party deps and swagger changes * regenerate proto files * use correct gocosmos build plugin for buf * re-gen all protobuf files to update paths for new gocosmos plugin * update protoc and buf to latest versions * fix staking keeper issues in app.go * update tally handler for gov changes * chain id fix and flag fixes * update deps for cometbft 47.7 upgrade * remove all module legacy queriers * update stakingKeeper to pointer * Replace ModuleCdc from govv1beta1 to govcodec * remove simulations * abci.LastCommitInfo → abci.CommitInfo * Remove unused code in keys.go * simapp.MakeTestEncodingConfig -> moduletestutil.MakeTestEncodingConfi * Fix chain id issues in tests * Fix remaining unit test issues * Update changelog for upgrade * Fix e2e tests using updated kvtool * Update protonet to v47 compatible genesis * Bump cometbft-db to v0.9.1-kava.1 * Update kvtool * Remove extra changelog * Fix merged rocksdb issues * go mod cleanup * Bump cometbft-db to v9 and go to 1.21 * Bump rocksdb version to v8.10.0 * Update kvtool to latest version * Update gin to v1.9.0 * Use ibctm.ModuleName in app_test * Fallback to genesis chain id instead of client toml * Remove all simulations * Fix cdp migrations issue with v47 * Update dependencies to correct tags --------- Co-authored-by: Nick DeLuca <nickdeluca08@gmail.com>
220 lines
8.8 KiB
Makefile
220 lines
8.8 KiB
Makefile
## Derived from work and ideas in https://github.com/ovrclk/akash/blob/8a29be1c3404843c80f0c861b2e577067607474b/make/setup-cache.mk
|
|
|
|
################################################################################
|
|
### Required Variables ###
|
|
################################################################################
|
|
ifndef BUILD_CACHE_DIR
|
|
$(error BUILD_CACHE_DIR not set)
|
|
endif
|
|
|
|
ifndef BIN_DIR
|
|
$(error BIN_DIR not set)
|
|
endif
|
|
|
|
ifndef OS_FAMILY
|
|
$(error OS_FAMILY not set)
|
|
endif
|
|
|
|
ifndef MACHINE
|
|
$(error MACHINE not set)
|
|
endif
|
|
|
|
################################################################################
|
|
### Dir Setup ###
|
|
################################################################################
|
|
DIRS := $(BUILD_CACHE_DIR) $(BIN_DIR)
|
|
|
|
################################################################################
|
|
### Tool Versions ###
|
|
################################################################################
|
|
GO_BIN ?= go
|
|
PROTOC_VERSION ?= v25.1
|
|
BUF_VERSION ?= v1.28.1
|
|
PROTOC_GEN_GOCOSMOS_VERSION ?= $(shell $(GO_BIN) list -m -f '{{.Version}}' github.com/cosmos/gogoproto)
|
|
PROTOC_GEN_GRPC_GATEWAY_VERSION ?= $(shell $(GO_BIN) list -m github.com/grpc-ecosystem/grpc-gateway| sed 's:.* ::')
|
|
PROTOC_GEN_DOC_VERSION ?= v1.5.1
|
|
SWAGGER_COMBINE_VERSION ?= v1.4.0
|
|
|
|
################################################################################
|
|
### Protoc Install ###
|
|
################################################################################
|
|
PROTOC_VERSION_FILE := $(BUILD_CACHE_DIR)/protoc-$(PROTOC_VERSION).version
|
|
|
|
ifeq ($(OS_FAMILY),Linux)
|
|
PROTOC_PLATFORM := linux
|
|
endif
|
|
ifeq ($(OS_FAMILY),Darwin)
|
|
PROTOC_PLATFORM := osx
|
|
endif
|
|
PROTOC_MACHINE := $(MACHINE)
|
|
ifeq ($(MACHINE),amd64)
|
|
PROTOC_MACHINE := x86_64
|
|
endif
|
|
ifeq ($(MACHINE),aarch64)
|
|
PROTOC_MACHINE := aarch_64
|
|
endif
|
|
ifeq ($(MACHINE),arm64)
|
|
PROTOC_MACHINE := aarch_64
|
|
endif
|
|
|
|
PROTOC_ARCHIVE_NAME := protoc-$(shell echo $(PROTOC_VERSION) | sed s/^v//)-$(PROTOC_PLATFORM)-$(PROTOC_MACHINE).zip
|
|
PROTOC_DOWNLOAD_URL := https://github.com/protocolbuffers/protobuf/releases/download/$(PROTOC_VERSION)/$(PROTOC_ARCHIVE_NAME)
|
|
|
|
$(PROTOC_VERSION_FILE):
|
|
@echo "installing protoc..."
|
|
@mkdir -p $(DIRS)
|
|
@touch $(PROTOC_VERSION_FILE)
|
|
@cd $(BUILD_CACHE_DIR); \
|
|
mkdir -p protoc && cd protoc; \
|
|
curl -sOL $(PROTOC_DOWNLOAD_URL); \
|
|
unzip -q $(PROTOC_ARCHIVE_NAME) bin/protoc
|
|
@cp -f $(BUILD_CACHE_DIR)/protoc/bin/protoc $(BIN_DIR)/protoc
|
|
@rm -rf $(BUILD_CACHE_DIR)/protoc
|
|
|
|
PROTOC := $(BIN_DIR)/protoc
|
|
BUILD_DEPS = $(PROTOC)
|
|
|
|
$(PROTOC): $(PROTOC_VERSION_FILE)
|
|
@echo "installed $(shell $(PROTOC) --version)"
|
|
|
|
################################################################################
|
|
### Buf Install ###
|
|
################################################################################
|
|
BUF_VERSION_FILE := $(BUILD_CACHE_DIR)/buf-$(BUF_VERSION).version
|
|
|
|
BUF_ARCHIVE_NAME := buf-$(OS_FAMILY)-$(MACHINE).tar.gz
|
|
BUF_DOWNLOAD_URL := https://github.com/bufbuild/buf/releases/download/$(BUF_VERSION)/$(BUF_ARCHIVE_NAME)
|
|
|
|
$(BUF_VERSION_FILE):
|
|
@echo "installing buf..."
|
|
@mkdir -p $(DIRS)
|
|
@touch $(BUF_VERSION_FILE)
|
|
@cd $(BUILD_CACHE_DIR); \
|
|
mkdir -p buf && cd buf; \
|
|
curl -sOL $(BUF_DOWNLOAD_URL); \
|
|
tar -xzf $(BUF_ARCHIVE_NAME) buf/bin/buf
|
|
@cp -f $(BUILD_CACHE_DIR)/buf/buf/bin/buf $(BIN_DIR)/buf
|
|
@rm -rf $(BUILD_CACHE_DIR)/buf
|
|
|
|
BUF := $(BIN_DIR)/buf
|
|
BUILD_DEPS += $(BUF)
|
|
|
|
$(BUF): $(BUF_VERSION_FILE)
|
|
@echo "installed buf $(shell $(BUF) --version)"
|
|
|
|
################################################################################
|
|
### gocomos proto plugin ###
|
|
################################################################################
|
|
PROTOC_GEN_GOCOSMOS_VERSION_FILE := $(BUILD_CACHE_DIR)/protoc-gen-gocosmos-$(PROTOC_GEN_GOCOSMOS_VERSION).version
|
|
|
|
$(PROTOC_GEN_GOCOSMOS_VERSION_FILE):
|
|
@echo "installing protoc-gen-gocosmos..."
|
|
@mkdir -p $(DIRS)
|
|
@touch $(PROTOC_GEN_GOCOSMOS_VERSION_FILE)
|
|
@cd $(BUILD_CACHE_DIR); \
|
|
mkdir -p protoc-gen-gocosmos && cd protoc-gen-gocosmos; \
|
|
git clone -q https://github.com/cosmos/gogoproto.git; \
|
|
cd gogoproto; \
|
|
git checkout -q $(PROTOC_GEN_GOCOSMOS_VERSION); \
|
|
GOBIN=$(ROOT_DIR)/$(BIN_DIR) $(GO_BIN) install ./protoc-gen-gocosmos
|
|
@rm -rf $(BUILD_CACHE_DIR)/protoc-gen-gocosmos
|
|
|
|
PROTOC_GEN_GOCOSMOS := $(BIN_DIR)/protoc-gen-gocosmos
|
|
BUILD_DEPS += $(PROTOC_GEN_GOCOSMOS)
|
|
|
|
$(PROTOC_GEN_GOCOSMOS): $(PROTOC_GEN_GOCOSMOS_VERSION_FILE)
|
|
@echo "installed protoc-gen-gocosmos $(PROTOC_GEN_GOCOSMOS_VERSION)"
|
|
|
|
################################################################################
|
|
### grpc gateway proto plugin ###
|
|
################################################################################
|
|
PROTOC_GEN_GRPC_GATEWAY_VERSION_FILE := $(BUILD_CACHE_DIR)/protoc-gen-grpc-gateway-$(PROTOC_GEN_GRPC_GATEWAY_VERSION).version
|
|
|
|
$(PROTOC_GEN_GRPC_GATEWAY_VERSION_FILE):
|
|
@echo "installing protoc-gen-grpc-gateway..."
|
|
@mkdir -p $(DIRS)
|
|
@touch $(PROTOC_GEN_GRPC_GATEWAY_VERSION_FILE)
|
|
@cd $(BUILD_CACHE_DIR); \
|
|
mkdir -p protoc-gen-grpc-gateway && cd protoc-gen-grpc-gateway; \
|
|
git clone -q https://github.com/grpc-ecosystem/grpc-gateway.git; \
|
|
cd grpc-gateway; \
|
|
git checkout -q $(PROTOC_GEN_GRPC_GATEWAY_VERSION); \
|
|
GOBIN=$(ROOT_DIR)/$(BIN_DIR) $(GO_BIN) install ./protoc-gen-grpc-gateway; \
|
|
GOBIN=$(ROOT_DIR)/$(BIN_DIR) $(GO_BIN) install ./protoc-gen-swagger
|
|
@rm -rf $(BUILD_CACHE_DIR)/protoc-gen-grpc-gateway
|
|
|
|
PROTOC_GEN_GRPC_GATEWAY := $(BIN_DIR)/protoc-gen-grpc-gateway
|
|
BUILD_DEPS += $(PROTOC_GEN_GRPC_GATEWAY)
|
|
|
|
$(PROTOC_GEN_GRPC_GATEWAY): $(PROTOC_GEN_GRPC_GATEWAY_VERSION_FILE)
|
|
@echo "installed protoc-gen-grpc-gateway $(PROTOC_GEN_GRPC_GATEWAY_VERSION)"
|
|
|
|
PROTOC_GEN_SWAGGER := $(BIN_DIR)/protoc-gen-swagger
|
|
BUILD_DEPS += $(PROTOC_GEN_SWAGGER)
|
|
|
|
$(PROTOC_GEN_SWAGGER): $(PROTOC_GEN_GRPC_GATEWAY_VERSION_FILE)
|
|
@echo "installed protoc-gen-swagger $(PROTOC_GEN_GRPC_GATEWAY_VERSION)"
|
|
|
|
################################################################################
|
|
### Proto Gen Doc Install ###
|
|
################################################################################
|
|
PROTOC_GEN_DOC_VERSION_FILE := $(BUILD_CACHE_DIR)/protoc-gen-doc-$(PROTOC_GEN_DOC_VERSION).version
|
|
|
|
ifeq ($(OS_FAMILY),Linux)
|
|
PROTOC_GEN_DOC_PLATFORM := linux
|
|
endif
|
|
ifeq ($(OS_FAMILY),Darwin)
|
|
PROTOC_GEN_DOC_PLATFORM := darwin
|
|
endif
|
|
PROTOC_GEN_DOC_MACHINE := $(MACHINE)
|
|
ifeq ($(MACHINE),x86_64)
|
|
PROTOC_GEN_DOC_MACHINE := amd64
|
|
endif
|
|
ifeq ($(MACHINE),aarch64)
|
|
PROTOC_GEN_DOC_MACHINE := arm64
|
|
endif
|
|
|
|
PROTOC_GEN_DOC_ARCHIVE_NAME := protoc-gen-doc_$(shell echo $(PROTOC_GEN_DOC_VERSION) | sed s/^v//)_$(PROTOC_GEN_DOC_PLATFORM)_$(PROTOC_GEN_DOC_MACHINE).tar.gz
|
|
PROTOC_GEN_DOC_DOWNLOAD_URL := https://github.com/pseudomuto/protoc-gen-doc/releases/download/$(PROTOC_GEN_DOC_VERSION)/$(PROTOC_GEN_DOC_ARCHIVE_NAME)
|
|
|
|
$(PROTOC_GEN_DOC_VERSION_FILE):
|
|
@echo "installing protoc-gen-doc..."
|
|
@mkdir -p $(DIRS)
|
|
@touch $(PROTOC_GEN_DOC_VERSION_FILE)
|
|
@cd $(BUILD_CACHE_DIR); \
|
|
mkdir -p protoc-gen-doc && cd protoc-gen-doc; \
|
|
curl -sOL $(PROTOC_GEN_DOC_DOWNLOAD_URL); \
|
|
tar -xzf $(PROTOC_GEN_DOC_ARCHIVE_NAME) protoc-gen-doc
|
|
@cp -f $(BUILD_CACHE_DIR)/protoc-gen-doc/protoc-gen-doc $(BIN_DIR)/protoc-gen-doc
|
|
@rm -rf $(BUILD_CACHE_DIR)/protoc-gen-doc
|
|
|
|
PROTOC_GEN_DOC := $(BIN_DIR)/protoc-gen-doc
|
|
BUILD_DEPS += $(PROTOC_GEN_DOC)
|
|
|
|
$(PROTOC_GEN_DOC): $(PROTOC_GEN_DOC_VERSION_FILE)
|
|
@echo "installed protoc-gen-doc $(shell $(PROTOC_GEN_DOC) --version)"
|
|
|
|
################################################################################
|
|
### Swagger Combine ###
|
|
################################################################################
|
|
SWAGGER_COMBINE_VERSION_FILE := $(BUILD_CACHE_DIR)/swagger-combine-$(SWAGGER_COMBINE_VERSION).version
|
|
|
|
$(SWAGGER_COMBINE_VERSION_FILE):
|
|
@echo "installing swagger-combine..."
|
|
@mkdir -p $(DIRS) $(BUILD_CACHE_DIR)/node_modules
|
|
@touch $(SWAGGER_COMBINE_VERSION_FILE)
|
|
@npm install --silent --no-progress --prefix $(BUILD_CACHE_DIR) swagger-combine@$(shell echo $(SWAGGER_COMBINE_VERSION) | sed s/^v//)
|
|
@ln -sf ../.cache/node_modules/.bin/swagger-combine $(BIN_DIR)/swagger-combine
|
|
|
|
SWAGGER_COMBINE := $(BIN_DIR)/swagger-combine
|
|
BUILD_DEPS += $(SWAGGER_COMBINE)
|
|
|
|
$(SWAGGER_COMBINE): $(SWAGGER_COMBINE_VERSION_FILE)
|
|
@echo "installed swagger-combine $(shell $(SWAGGER_COMBINE) -v)"
|
|
|
|
################################################################################
|
|
### Build Deps ###
|
|
################################################################################
|
|
.PHONY: install-build-deps
|
|
install-build-deps: $(BUILD_DEPS)
|