golang / go

The Go programming language
https://go.dev
BSD 3-Clause "New" or "Revised" License
123.18k stars 17.57k forks source link

images: breaking change introduced in 1.18 #69721

Open creack opened 3 hours ago

creack commented 3 hours ago

Go version

go1.23.1 amd64/linux

Output of go env in your module/workspace:

GO111MODULE='on'
GOARCH='amd64'
GOBIN=''
GOCACHE='/home/creack/.cache/go-build'
GOENV='/home/creack/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMODCACHE='/home/creack/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/home/creack/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/home/creack/goroot'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/home/creack/goroot/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.23.1'
GODEBUG=''
GOTELEMETRY='local'
GOTELEMETRYDIR='/home/creack/.config/go/telemetry'
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 -ffile-prefix-map=/tmp/go-build411067699=/tmp/go-build -gno-record-gcc-switches'

What did you do?

Pulled on old-ish (5years) project and tried to use it, but it is now broken. https://github.com/creack/bug

I bisected go major version and found that it started to break at go1.18, go1.17 was still working fine. Now the result is a blank image.

Simple project using stdlin only:

$ go list -f '{{ .Imports }}'
[bytes errors image image/color image/draw io io/ioutil unicode/utf8]

Checking using go test.

What did you see happen?

All tests fail with blank images.

What did you expect to see?

Passing tests.

gabyhelp commented 3 hours ago

Related Issues and Documentation

(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)

randall77 commented 3 hours ago

It would be helpful to bisect to a single CL if you can do that. There was an image/draw change in 1.18, see https://tip.golang.org/doc/go1.18#minor_library_changes. Not sure if that is related to your code or not.

ianlancetaylor commented 2 hours ago

The behavior change was indeed caused by https://go.dev/cl/340049. CC @nigeltao