Skip to content

packaging+docker: Outdated go.mod used in images and tarball #60297

Closed as not planned
@btasker

Description

@btasker

What version of Go are you using (go version)?

go version go1.20.4 linux/amd64
(docker image golang:1.20.4)

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/root/.cache/go-build"
GOENV="/root/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.20.4"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/dev/null"
GOWORK=""
CGO_CFLAGS="-O2 -g"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-O2 -g"
CGO_FFLAGS="-O2 -g"
CGO_LDFLAGS="-O2 -g"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build2411391097=/tmp/go-build -gno-record-gcc-switches"

What did you do?

Started a Go docker container - docker run -it --rm -v $PWD:/src golang:1.20.4 bash and built a project in order to confirm the fix in golang/net@82780d6 took effect

What did you expect to see?

The fix should exist in the h2 bundle (/usr/local/go/src/net/http/h2_bundle.go)

What did you see instead?

It does not (and the issue still repros) because h2_bundle.go is still based on x/net v.4.1

Extra

To try and dig into it a bit further, I figured I'd manually update the bundle and see whether that pulled the changes down

root@dfd0ea978345:/# git clone https://github.com/golang/tools.git
root@dfd0ea978345:~/tools/cmd/bundle# cd tools/cmd/bundle
root@dfd0ea978345:~/tools/cmd/bundle# go build main.go
root@dfd0ea978345:~/tools/cmd/bundle# cp main /bundle

# Taken from the header of the existing bundle
root@dfd0ea978345:/usr/local/go/src/net/http# /bundle -o=h2_bundle.go -prefix=http2 -tags='!nethttpomithttp2' golang.org/x/net/http2`

The file regenerated on disk, but the fix still wasn't in there.

The reason for this was in /usr/local/go/src/go.mod:

root@d8a072516a9a:/go# grep "x/net" /usr/local/go/src/go.mod 
	golang.org/x/net v0.4.1-0.20230214201333-88ed8ca3307d

The docker container is referencing a really old version.

I updated to use v0.10.0 (as here) and updated vendor/modules.txt) accordingly.

The bundle then updated correctly and I was able to build my project with the expected fix in place

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions