From 2c3714679fd0167269c19f538c6f877d76e4e85e Mon Sep 17 00:00:00 2001 From: Dev Ojha Date: Mon, 5 Dec 2022 16:49:30 -0600 Subject: [PATCH 1/2] Apply @jhernandez ' patch to Makefil --- Makefile | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 8db01b1028b..a60ef1ba9c3 100644 --- a/Makefile +++ b/Makefile @@ -10,6 +10,9 @@ BUILDDIR ?= $(CURDIR)/build E2E_UPGRADE_VERSION := "v13" +GO_MAJOR_VERSION = $(shell go version | cut -c 14- | cut -d' ' -f1 | cut -d'.' -f1) +GO_MINOR_VERSION = $(shell go version | cut -c 14- | cut -d' ' -f1 | cut -d'.' -f2) + export GO111MODULE = on # process build tags @@ -83,13 +86,20 @@ endif ### Build ### ############################################################################### +check_version: + @echo "Go version: $(GO_MAJOR_VERSION).$(GO_MINOR_VERSION)" +ifneq ($(GO_MINOR_VERSION),18) + @echo "ERROR: Go version 1.18 is required for this version of Osmosis. Go 1.19 has changes that are believed to break consensus." + exit 1 +endif + all: install lint test BUILD_TARGETS := build install build: BUILD_ARGS=-o $(BUILDDIR)/ -$(BUILD_TARGETS): go.sum $(BUILDDIR)/ +$(BUILD_TARGETS): check_version go.sum $(BUILDDIR)/ go $@ -mod=readonly $(BUILD_FLAGS) $(BUILD_ARGS) ./... $(BUILDDIR)/: From ae64f1002445f216255cb792cf119f6d6709227d Mon Sep 17 00:00:00 2001 From: Dev Ojha Date: Mon, 5 Dec 2022 17:06:43 -0600 Subject: [PATCH 2/2] Add changelog --- CHANGELOG.md | 1 + Makefile | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0fbc0af1c70..f745c9326e5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -53,6 +53,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Misc Improvements * [#3611](https://github.com/osmosis-labs/osmosis/pull/3611) Introduce osmocli, to automate thousands of lines of CLI boilerplate +* [#3634](https://github.com/osmosis-labs/osmosis/pull/3634) (Makefile) Ensure correct golang version in make build and make install. (Thank you @jhernandezb ) ## v13.0.0 diff --git a/Makefile b/Makefile index a60ef1ba9c3..8ded27938a7 100644 --- a/Makefile +++ b/Makefile @@ -87,7 +87,6 @@ endif ############################################################################### check_version: - @echo "Go version: $(GO_MAJOR_VERSION).$(GO_MINOR_VERSION)" ifneq ($(GO_MINOR_VERSION),18) @echo "ERROR: Go version 1.18 is required for this version of Osmosis. Go 1.19 has changes that are believed to break consensus." exit 1