Skip to content

Commit 068e426

Browse files
Sam Kleinmantychoish
authored andcommitted
GODRIVER-318: add canary builders
Change-Id: I0022c9904921bb7741feb5360d6f3f5463488db0
1 parent a02b87b commit 068e426

File tree

3 files changed

+50
-6
lines changed

3 files changed

+50
-6
lines changed

.evergreen/config.yml

Lines changed: 43 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -220,14 +220,13 @@ functions:
220220
file="${PROJECT_DIRECTORY}/.evergreen/install-dependencies.sh"
221221
[ -f ${file} ] && sh ${file} || echo "${file} not available, skipping"
222222
223-
224223
run-make:
225224
- command: shell.exec
226225
params:
227226
working_dir: src/github.com/mongodb/mongo-go-driver
228227
script: |
229228
${PREPARE_SHELL}
230-
make ${targets} BUILD_TAGS="-tags gssapi"
229+
${BUILD_ENV|} make ${targets} BUILD_TAGS="-tags gssapi"
231230
232231
233232
run-tests:
@@ -511,6 +510,38 @@ tasks:
511510
commands:
512511
- func: run-enterprise-gssapi-auth-tests
513512

513+
- name: go1.8-build
514+
tags: ["compile-check"]
515+
commands:
516+
- func: run-make
517+
vars:
518+
targets: "build"
519+
BUILD_ENV: "PATH=/opt/golang/go1.8/bin:$PATH GOROOT=/opt/golang/go1.8"
520+
521+
- name: linux-32-bit
522+
tags: ["compile-check"]
523+
commands:
524+
- func: run-make
525+
vars:
526+
targets: "build"
527+
BUILD_ENV: "GOARCH=386"
528+
529+
- name: linux-arm64
530+
tags: ["compile-check"]
531+
commands:
532+
- func: run-make
533+
vars:
534+
targets: "build"
535+
BUILD_ENV: "GOARCH=arm64"
536+
537+
- name: linux-s390x
538+
tags: ["compile-check"]
539+
commands:
540+
- func: run-make
541+
vars:
542+
targets: "build"
543+
BUILD_ENV: "GOARCH=ppc64le"
544+
514545
axes:
515546
- id: version
516547
display_name: MongoDB Version
@@ -559,11 +590,20 @@ buildvariants:
559590
display_name: "Static Analysis"
560591
run_on:
561592
- ubuntu1604-build
562-
expansions:
593+
expansions:
563594
GO_DIST: "/opt/golang/go1.9"
564595
tasks:
565596
- name: ".static-analysis"
566597

598+
- name: build-check
599+
display_name: "Compile Only Checks"
600+
run_on:
601+
- ubuntu1604-test
602+
expansions:
603+
GO_DIST: "/opt/golang/go1.10"
604+
tasks:
605+
- name: ".compile-check"
606+
567607
- matrix_name: "tests"
568608
matrix_spec: { version: "*", os: "*" }
569609
display_name: "${version} ${os}"

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ doc:
2020
build-examples:
2121
go build $(BUILD_TAGS) ./examples/... ./core/examples/...
2222

23+
.PHONY: build
24+
build:
25+
go build $(filter-out ./core/auth/internal/gssapi,$(PKGS))
26+
2327
.PHONY: check-fmt
2428
check-fmt:
2529
@gofmt -l -s $(PKGS) | read; if [ $$? == 0 ]; then echo "gofmt check failed for:"; gofmt -l -s $(PKGS) | sed -e 's/^/ - /'; exit 1; fi

bson/constructor.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ func (ElementConstructor) Interface(key string, value interface{}) *Element {
6464
switch {
6565
case t < math.MaxInt32:
6666
elem = EC.Int32(key, int32(t))
67-
case t > math.MaxInt64:
67+
case uint64(t) > math.MaxInt64:
6868
elem = EC.Null(key)
6969
default:
7070
elem = EC.Int64(key, int64(t))
@@ -128,7 +128,7 @@ func (c ElementConstructor) InterfaceErr(key string, value interface{}) (*Elemen
128128
switch {
129129
case t < math.MaxInt32:
130130
elem = EC.Int32(key, int32(t))
131-
case t > math.MaxInt64:
131+
case uint64(t) > math.MaxInt64:
132132
err = fmt.Errorf("BSON only has signed integer types and %d overflows an int64", t)
133133
default:
134134
elem = EC.Int64(key, int64(t))
@@ -137,7 +137,7 @@ func (c ElementConstructor) InterfaceErr(key string, value interface{}) (*Elemen
137137
switch {
138138
case t < math.MaxInt32:
139139
elem = EC.Int32(key, int32(t))
140-
case t > math.MaxInt64:
140+
case uint64(t) > math.MaxInt64:
141141
err = fmt.Errorf("BSON only has signed integer types and %d overflows an int64", t)
142142
default:
143143
elem = EC.Int64(key, int64(t))

0 commit comments

Comments
 (0)