Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/exp/apidiff: incorrectly reports incompatible change in type alias #65112

Open
joelanford opened this issue Jan 16, 2024 · 1 comment
Open
Assignees
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@joelanford
Copy link

Go version

go version go1.21.6 darwin/arm64

Output of go env in your module/workspace:

GO111MODULE='on'
GOARCH='arm64'
GOBIN=''
GOCACHE='/Users/joe/Library/Caches/go-build'
GOENV='/Users/joe/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='arm64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMODCACHE='/Users/joe/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='darwin'
GOPATH='/Users/joe/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/Users/joe/.local/go'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/Users/joe/.local/go/pkg/tool/darwin_arm64'
GOVCS=''
GOVERSION='go1.21.6'
GCCGO='gccgo'
AR='ar'
CC='clang'
CXX='clang++'
CGO_ENABLED='1'
GOMOD='/Users/joe/projects/work/kubernetes-sigs/controller-runtime/go.mod'
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 -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/w4/kts6sn8j2cz4fv_l67fp4cvm0000gn/T/go-build575403176=/tmp/go-build -gno-record-gcc-switches -fno-common'

What did you do?

I maintain a tool (https://github.com/joelanford/go-apidiff) that uses golang.org/x/exp/apidiff to compare two commits of a git repository to build a report on compatible/incompatible changes (thanks for doing all of the heavy lifting!).

This tool is used by the sigs.k8s.io/controller-runtime project to help its maintainers see when PRs making breaking changes.

I bumped go-apidiff's dependency to https://github.com/golang/exp/tree/db7319d0e0e361ccef5c449b760df8e5f2d5087c

Then, I used a build of go-apidiff with this dependency on controller-runtime, comparing commits with no code changes whatsoever. See kubernetes-sigs/controller-runtime#2654

What did you see happen?

I saw the go-apidiff run fail: https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_controller-runtime/2654/pull-controller-runtime-apidiff/1747021423471235072

Relevant output:

sigs.k8s.io/controller-runtime
  Incompatible changes:
  - SchemeBuilder: changed from sigs.k8s.io/controller-runtime/pkg/scheme.Builder to sigs.k8s.io/controller-runtime/pkg/builder.Builder

What did you expect to see?

I expected to see no diff produced.

I bisected changes in golang.org/x/exp/apidiff and found that commit https://github.com/golang/exp/tree/89c5cff77bcbacf5bc89bd83d69d4fa8c80cf8af is when this unexpected diff report begins.

If I downgrade to https://github.com/golang/exp/tree/3b0b5b66b5f19dc18cc54ec01e4b9d7906761f14, I see the expected output.

@gopherbot gopherbot added this to the Unreleased milestone Jan 16, 2024
@cagedmantis cagedmantis added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Jan 16, 2024
@cagedmantis
Copy link
Contributor

cc @jba

@jba jba self-assigned this Jan 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

4 participants