Skip to content

Commit

Permalink
Use a local Go 1.18 installation to check for minimum version support.
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewdale committed Oct 17, 2024
1 parent 98a74d2 commit b7df8f5
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 16 deletions.
13 changes: 0 additions & 13 deletions .evergreen/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1362,19 +1362,6 @@ tasks:
vars:
MONGO_GO_DRIVER_COMPRESSOR: "snappy"

# Build with the oldest supported version of Go.
- name: go1.18-build
tags: ["compile-check"]
commands:
- command: subprocess.exec
params:
binary: bash
env:
GOROOT: /opt/golang/go1.18
add_to_path: [/opt/golang/go1.18/bin]
args: [*task-runner, build-compile-check]

# Build with the same Go version that we're using for tests.
- name: build
tags: ["compile-check"]
commands:
Expand Down
19 changes: 17 additions & 2 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,23 @@ tasks:
check-license: bash etc/check_license.sh

build:
deps: [cross-compile, build-tests, build-compile-check, install-libmongocrypt]
deps: [install-libmongocrypt]
cmds:
- go build ./...
- go build ${BUILD_TAGS} ./...
- task: cross-compile
- task: build-tests
- task: build-compile-check

build-tests: go test -short ${BUILD_TAGS} -run ^$$ ./...

build-compile-check: bash etc/compile_check.sh
# Build the compilecheck submodule, both with the system version of Go and
# with the minimum supported version of Go (Go 1.18).
build-compile-check:
deps: [install-go118]
cmds:
- bash etc/compile_check.sh
- PATH=$(go1.18 env GOROOT)/bin:$PATH GOROOT=$(go1.18 env GOROOT) bash etc/compile_check.sh

build-aws-ecs-test: go build ${BUILD_TAGS} ./internal/cmd/testaws/main.go

Expand Down Expand Up @@ -210,3 +219,9 @@ tasks:
internal: true
cmds:
- go install github.com/walle/lll/...@latest

install-go118:
internal: true
cmds:
- go install golang.org/dl/go1.18@latest
- go1.18 download
1 change: 0 additions & 1 deletion etc/compile_check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ set -x # show all commands being run
GC=go
COMPILE_CHECK_DIR="internal/cmd/compilecheck"
# shellcheck disable=SC2034
DEV_MIN_VERSION=1.19

# version will flatten a version string of upto 4 components for inequality
# comparison.
Expand Down

0 comments on commit b7df8f5

Please sign in to comment.