Skip to content

Commit ceffcbe

Browse files
Pin golang.org/x/sys to fix windows compilation
Upstream golang.org/x/sys introduced a breaking change within a major version, see golang/go#34610. The workaround is to pin it to the last revesion that is compatible with the version of moby/moby that we are using. Verify that the code compiles on windows, macos and linux during our CI run to catch problems like this one (a regression in golang.org/x/sys) in the future as soon as it happens. Also do a reset of our go dependencies after bootstrap. When we use go get to install global dependencies, it modifies our go.* files changing the versions of the dependencies that we required, making the build break, because kind requires different versions than docker. This resets it back to what we need before we compile. Signed-off-by: Carolyn Van Slyck <[email protected]>
1 parent 8b2ff3a commit ceffcbe

File tree

5 files changed

+23
-2
lines changed

5 files changed

+23
-2
lines changed

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ endif
5050
ifndef HAS_GO_JUNIT_REPORT
5151
go get github.com/jstemmer/go-junit-report
5252
endif
53+
@# go get to install global tools with modules modify our dependencies. Reset them back
54+
git checkout go.mod go.sum
5355

5456
.PHONY: coverage
5557
coverage:

azure-pipelines.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ steps:
2222
go version
2323
go get sigs.k8s.io/[email protected]
2424
make bootstrap build lint coverage
25+
GOOS=windows make build
26+
GOOS=darwin make build
2527
workingDirectory: '$(modulePath)'
2628
displayName: 'Get dependencies, build, test'
2729

brigade.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ function test(e, project) {
5858
`cd ${localPath}`,
5959
"make bootstrap",
6060
"make build",
61+
// Ensure that it compiles on the three main OS's
62+
"GOOS=windows make build",
63+
"GOOS=darwin make build",
6164
"make test",
6265
"make lint",
6366
];

go.mod

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,14 @@ require (
1616
github.com/bugsnag/bugsnag-go v1.5.0 // indirect
1717
github.com/bugsnag/panicwrap v1.2.0 // indirect
1818
github.com/cenkalti/backoff v2.2.1+incompatible // indirect
19+
github.com/cespare/xxhash/v2 v2.1.0 // indirect
1920
github.com/cloudflare/cfssl v1.4.1 // indirect
20-
github.com/containerd/cgroups v0.0.0-20191125132625-80b32e3c75c9 // indirect
2121
github.com/containerd/containerd v1.3.0 // indirect
2222
github.com/containerd/continuity v0.0.0-20181203112020-004b46473808 // indirect
2323
github.com/containerd/fifo v0.0.0-20190816180239-bda0ff6ed73c // indirect
2424
github.com/containerd/ttrpc v0.0.0-20191028202541-4f1b8fe65a5c // indirect
2525
github.com/containerd/typeurl v0.0.0-20190911142611-5eb25027c9fd // indirect
26+
github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e // indirect
2627
github.com/docker/cli v0.0.0-20191017083524-a8ff7f821017
2728
github.com/docker/distribution v2.7.1-0.20190205005809-0d3efadf0154+incompatible
2829
github.com/docker/docker v1.4.2-0.20181229214054-f76d6a078d88
@@ -49,14 +50,19 @@ require (
4950
github.com/opencontainers/runtime-spec v1.0.1 // indirect
5051
github.com/pivotal/image-relocation v0.0.0-20191111101224-e94aff6df06c
5152
github.com/pkg/errors v0.8.1
52-
github.com/prometheus/client_golang v1.2.1 // indirect
53+
github.com/prometheus/client_golang v1.1.0 // indirect
54+
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4 // indirect
55+
github.com/prometheus/common v0.7.0 // indirect
56+
github.com/prometheus/procfs v0.0.5 // indirect
5357
github.com/qri-io/jsonschema v0.1.1
5458
github.com/stretchr/testify v1.4.0
5559
github.com/syndtr/gocapability v0.0.0-20180916011248-d98352740cb2 // indirect
5660
github.com/theupdateframework/notary v0.6.1 // indirect
61+
github.com/urfave/cli v1.22.1 // indirect
5762
github.com/xlab/handysort v0.0.0-20150421192137-fb3537ed64a1 // indirect
5863
go.etcd.io/bbolt v1.3.3 // indirect
5964
golang.org/x/crypto v0.0.0-20191028145041-f83a4685e152 // indirect
65+
golang.org/x/sys v0.0.0-20190830141801-acfa387b8d69 // indirect
6066
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 // indirect
6167
gopkg.in/dancannon/gorethink.v3 v3.0.5 // indirect
6268
gopkg.in/fatih/pool.v2 v2.0.0 // indirect

go.sum

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,9 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN
338338
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
339339
github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs=
340340
github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo=
341+
github.com/prometheus/client_golang v1.1.0 h1:BQ53HtBmfOitExawJ6LokA4x8ov/z0SYYb0+HxJfRI8=
342+
github.com/prometheus/client_golang v1.1.0/go.mod h1:I1FGZT9+L76gKKOs5djB6ezCbFQP1xR9D75/vuwEF3g=
343+
github.com/prometheus/client_golang v1.2.0/go.mod h1:XMU6Z2MjaRKVu/dC1qupJI9SiNkDYzz3xecMgSW/F+U=
341344
github.com/prometheus/client_golang v1.2.1 h1:JnMpQc6ppsNgw9QPAGF6Dod479itz7lvlsMzzNayLOI=
342345
github.com/prometheus/client_golang v1.2.1/go.mod h1:XMU6Z2MjaRKVu/dC1qupJI9SiNkDYzz3xecMgSW/F+U=
343346
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
@@ -347,12 +350,14 @@ github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4 h1:gQz4mCb
347350
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
348351
github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
349352
github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
353+
github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+Zk0j9GMYc=
350354
github.com/prometheus/common v0.7.0 h1:L+1lyG48J1zAQXA3RBX/nG/B3gjlHq0zTt2tlbJLyCY=
351355
github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA=
352356
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
353357
github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
354358
github.com/prometheus/procfs v0.0.0-20190522114515-bc1a522cf7b1/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
355359
github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
360+
github.com/prometheus/procfs v0.0.3/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ=
356361
github.com/prometheus/procfs v0.0.5 h1:3+auTFlqw+ZaQYJARz6ArODtkaIwtvBTx3N2NehQlL8=
357362
github.com/prometheus/procfs v0.0.5/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ=
358363
github.com/qri-io/jsonpointer v0.1.0 h1:OcTtTmorodUCRc2CZhj/ZwOET8zVj6uo0ArEmzoThZI=
@@ -474,6 +479,9 @@ golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7w
474479
golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
475480
golang.org/x/sys v0.0.0-20190522044717-8097e1b27ff5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
476481
golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
482+
golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
483+
golang.org/x/sys v0.0.0-20190830141801-acfa387b8d69 h1:Wdn4Yb8d5VrsO3jWgaeSZss09x1VLVBMePDh4VW/xSQ=
484+
golang.org/x/sys v0.0.0-20190830141801-acfa387b8d69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
477485
golang.org/x/sys v0.0.0-20191010194322-b09406accb47/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
478486
golang.org/x/sys v0.0.0-20191022100944-742c48ecaeb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
479487
golang.org/x/sys v0.0.0-20191112214154-59a1497f0cea h1:Mz1TMnfJDRJLk8S8OPCoJYgrsp/Se/2TBre2+vwX128=

0 commit comments

Comments
 (0)