Skip to content

Commit

Permalink
Ensure go v1.18 used in make build & make install (#3634)
Browse files Browse the repository at this point in the history
* Apply @jhernandez ' patch to Makefil

* Add changelog

(cherry picked from commit f52cb53)
  • Loading branch information
ValarDragon authored and mergify[bot] committed Dec 6, 2022
1 parent fe6d544 commit 3baadbc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,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

Expand Down
11 changes: 10 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -83,13 +86,19 @@ endif
### Build ###
###############################################################################

check_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)/:
Expand Down

0 comments on commit 3baadbc

Please sign in to comment.