From 9ad412ea0b0fac08ccaa9112534b18a60ed67d9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Sun, 10 May 2020 17:18:30 +0100 Subject: [PATCH] cmd: bump gioui.org dependency, use -modfile properly on CI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A simple 'go test -modfile=' won't work properly for the end-to-end tests, since they run 'go build' under the hood as well. To properly propagate the flag, we need to use GOFLAGS. Since -modfile is always relative to the current directory, we can't use it to test many packages at once, nor can we use it via 'go test ./gogio'. While at it, document this distinction in go.local.mod to prevent others getting confused like I did. Signed-off-by: Daniel Martí --- .builds/linux.yml | 3 ++- cmd/go.local.mod | 6 ++++++ cmd/go.mod | 2 +- cmd/go.sum | 4 ++-- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.builds/linux.yml b/.builds/linux.yml index 6161bb71..4b2d3833 100644 --- a/.builds/linux.yml +++ b/.builds/linux.yml @@ -46,7 +46,8 @@ tasks: cd gio/cmd go test ./... go test -race ./... - go test -modfile=go.local.mod ./... + cd gogio # since we need -modfile to point at the parent directory + GOFLAGS=-modfile=../go.local.mod go test - test_example: | cd gio/example go test -race ./... diff --git a/cmd/go.local.mod b/cmd/go.local.mod index 774b55b4..fcd4cbfd 100644 --- a/cmd/go.local.mod +++ b/cmd/go.local.mod @@ -1,3 +1,9 @@ +// Keep in sync with go.mod; the only difference should be the gioui.org +// replace. To use it: +// +// cd gogio +// GOFLAGS=-modfile=../go.local.mod go test + module gioui.org/cmd go 1.13 diff --git a/cmd/go.mod b/cmd/go.mod index 788ac944..578a709e 100644 --- a/cmd/go.mod +++ b/cmd/go.mod @@ -3,7 +3,7 @@ module gioui.org/cmd go 1.13 require ( - gioui.org v0.0.0-20200503190452-8d9612f9aa46 + gioui.org v0.0.0-20200510064036-c2cbcee78de0 github.com/chromedp/cdproto v0.0.0-20191114225735-6626966fbae4 github.com/chromedp/chromedp v0.5.2 golang.org/x/image v0.0.0-20190802002840-cff245a6509b diff --git a/cmd/go.sum b/cmd/go.sum index 10fd26b5..c5b09bf4 100644 --- a/cmd/go.sum +++ b/cmd/go.sum @@ -1,6 +1,6 @@ dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -gioui.org v0.0.0-20200503190452-8d9612f9aa46 h1:7OFSBlHlymqJPrX54xUKnattrlsTxmVbTZwtFbG+kgU= -gioui.org v0.0.0-20200503190452-8d9612f9aa46/go.mod h1:AHI9rFr6AEEHCb8EPVtb/p5M+NMJRKH58IOp8O3Je04= +gioui.org v0.0.0-20200510064036-c2cbcee78de0 h1:8QYEZvEzu7Jtb6QGNRCV5/innPTrafeidxdcHZ67p6U= +gioui.org v0.0.0-20200510064036-c2cbcee78de0/go.mod h1:AHI9rFr6AEEHCb8EPVtb/p5M+NMJRKH58IOp8O3Je04= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802 h1:1BDTz0u9nC3//pOCMdNH+CiXJVYJh5UQNCOBG7jbELc= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/chromedp/cdproto v0.0.0-20191114225735-6626966fbae4 h1:QD3KxSJ59L2lxG6MXBjNHxiQO2RmxTQ3XcK+wO44WOg=