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

Regression in v0.11.1: Fails with could not parse Go build info #666

Closed
embano1 opened this issue Mar 21, 2022 · 11 comments · Fixed by #668
Closed

Regression in v0.11.1: Fails with could not parse Go build info #666

embano1 opened this issue Mar 21, 2022 · 11 comments · Fixed by #668

Comments

@embano1
Copy link
Contributor

embano1 commented Mar 21, 2022

I saw couple of issues referencing a similar error, but this should have been resolved in v0.11.x. However, we just noticed in our pipelines, that with v0.11.1 the following error is thrown (again):

error during command execution:error processing import paths in "-": error resolving image references: parsing build info: could not parse Go build info: line 5: expected 3 columns for replacement; got 2

Reverting the pipeline back to v0.11.0 fixes it.

Go version: v1.17.7

Example workflow run where this is observed with v0.11.1: https://github.com/vmware-tanzu/sources-for-knative/runs/5621359754?check_suite_focus=true

Working run reverting back to v0.11.0:
https://github.com/vmware-tanzu/sources-for-knative/runs/5626066023?check_suite_focus=true

@imjasonh
Copy link
Member

Thanks for reporting this!

It looks like the problematic importpath is github.com/vmware/govmomi/govc:

$ ./ko version
0.11.1
$ ./ko build github.com/vmware/govmomi/govc --local
...
2022/03/21 10:05:21 error during command execution:failed to publish images: error building "ko://github.com/vmware/govmomi/govc": parsing build info: could not parse Go build info: line 5: expected 3 columns for replacement; got 2

(the other image in that YAML builds fine).

Building that binary locally and running go version -m (Go 1.17) on it shows there's a replace directive in use:

$ go build -o ./ github.com/vmware/govmomi/govc
$ go version -m govc
govc: go1.17.8
	path	github.com/vmware/govmomi/govc
	mod	github.com/vmware/govmomi	v0.24.1-0.20210127152625-854ba4efe87e	
	dep	github.com/google/uuid	v1.3.0	h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
	dep	github.com/kr/pretty	v0.2.1
	=>	github.com/dougm/pretty	v0.0.0-20171025230240-2ee9d7453c02	
	dep	github.com/kr/text	v0.2.0	h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=

And that's the line causing us trouble -- that's line 5, and expected 3 columns for replacement comes from here, parsing a repLine (=>).

What's even weirder, when I build that package with go1.18, it can't be go version -m'd with go1.17:

$ go1.18 build -o ./govc2 github.com/vmware/govmomi/govc
$ go version -m govc2
govc2: go version not found

But it can be parsed with go1.18 version -m:

$ go1.18 version -m govc2
govc2: go1.18
	path	github.com/vmware/govmomi/govc
	mod	github.com/vmware/govmomi	v0.24.1-0.20210127152625-854ba4efe87e	
	dep	github.com/google/uuid	v1.3.0	h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
	dep	github.com/kr/pretty	v0.2.1
	=>	github.com/dougm/pretty	v0.0.0-20171025230240-2ee9d7453c02	
	
	dep	github.com/kr/text	v0.2.0	h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
	build	-compiler=gc
	build	CGO_ENABLED=1
...

(note the suspicious newline after the => ... 🤔 )

I wonder if there's some subtle and annoying incompatibility between the output of go1.17 version -m and go1.18 version -m that we'll need to account for if we want both versions to work.

In the meantime, upgrading to 1.18 or --sbom=none should unblock you, though I understand neither may be great answers. I'll dig more and see if I can figure this out.

Thanks again for reporting! 👍

@embano1
Copy link
Contributor Author

embano1 commented Mar 21, 2022

Thx for the quick reply! I pinned the ko version in my workflow to v0.11.0 for now.

@StevenACoffman
Copy link
Contributor

StevenACoffman commented Mar 21, 2022

Not sure if this is the same issue or a different one, but with v0.11.1 on both Go 1.17.5 and Go 1.18.0 I get:

Error: failed to publish images: error building "ko://github.com/Khan/districts-jobs/admin-reports": parsing build info: could not parse Go build info: line 17: expected 3 columns for replacement; got 2
2022/03/21 10:40:29 error during command execution:failed to publish images: error building "ko://github.com/Khan/districts-jobs/admin-reports": parsing build info: could not parse Go build info: line 17: expected 3 columns for replacement; got 2

What is the go command that is being parsed so I can figure out what the deal is? Adding --sbom=none causes things to succeed as normal.

@imjasonh
Copy link
Member

SBOMs are generated by running go version -m <binary>, removing the first line (something like <binary>: go1.1X) and trimming off the tab prefix on each line.

@imjasonh
Copy link
Member

In all these cases it would be relevant to say how you installed ko, since that determines whether we use the upstream ParseBuildInfo that Go provides in 1.18+ or the same code we copied to support pre-1.18.

If you install the prebuilt binary for 0.11.1 (incl using setup-ko without version:tip) it was built using 1.18, and should use the upstream code. If it was go install github.com/google/ko@v0.11.1 (or @latest or @main), the Go version you used to build it matters -- if was Go 1.17, ko was installed using our copied fork of the 1.18 code.

@StevenACoffman
Copy link
Contributor

StevenACoffman commented Mar 21, 2022

go install github.com/google/ko@latest is how I installed ko.
If I build the local binary executable and run under Go 1.18:

go version -m output
$ go version -m admin-reports
admin-reports: go1.18
	path	command-line-arguments
	dep	cloud.google.com/go	v0.100.2	h1:t9Iw5QH5v4XtlEQaCtUY7x6sCABps8sW0acw7e2WQ6Y=
	dep	cloud.google.com/go/compute	v1.5.0	h1:b1zWmYuuHz7gO9kDcM/EpHGr06UgsYNRpNJzI2kFiLM=
	dep	cloud.google.com/go/datastore	v1.6.0	h1:wZaHIqu1tebvGRYhVgcfNX6jN2q638OGO23JyJckxuI=
	dep	cloud.google.com/go/iam	v0.3.0	h1:exkAomrVUuzx9kWFI1wm3KI0uoDeUFPB4kKGzx6x+Gc=
	dep	cloud.google.com/go/pubsub	v1.19.0	h1:WZy66ga6/tqmZiwv1jwKVgqV8FuEuAmPR5CEJHNVCZk=
	dep	cloud.google.com/go/storage	v1.21.0	h1:HwnT2u2D309SFDHQII6m18HlrCi3jAXhUMTLOWXYH14=
	dep	contrib.go.opencensus.io/integrations/ocsql	v0.1.7	h1:G3k7C0/W44zcqkpRSFyjU9f6HZkbwIrL//qqnlqWZ60=
	dep	github.com/Azure/go-autorest/autorest	v0.11.1	h1:eVvIXUKiTgv++6YnWb42DUA1YL7qDugnKP0HljexdnQ=
	dep	github.com/Azure/go-autorest/autorest/adal	v0.9.14	h1:G8hexQdV5D4khOXrWG2YuLCFKhWYmWD8bHYaXN5ophk=
	dep	github.com/Azure/go-autorest/autorest/date	v0.3.0	h1:7gUk1U5M/CQbp9WoqinNzJar+8KY+LPI6wiWrP/myHw=
	dep	github.com/Azure/go-autorest/logger	v0.2.1	h1:IG7i4p/mDa2Ce4TRyAO8IHnVhAVF3RFU+ZtXWSmf4Tg=
	dep	github.com/Azure/go-autorest/tracing	v0.6.0	h1:TYi4+3m5t6K48TGI9AUdb+IzbnSxvnvUMfuitfgcfuo=
	dep	github.com/GoogleCloudPlatform/cloudsql-proxy	v1.29.0	h1:YNu23BtH0PKF+fg3ykSorCp6jSTjcEtfnYLzbmcjVRA=
	dep	github.com/Khan/districts-jobs/admin-reports	(devel)
	dep	github.com/Khan/districts-jobs/pkg	v0.0.0-20220313214034-a2f5c1e01494
	=>	../pkg	(devel)

	dep	github.com/Khan/genqlient	v0.4.0	h1:4XImbzhBtaIFmwGPwEKdnx3TuGOX0GZ0hcW/idTzwts=
	dep	github.com/aws/aws-sdk-go-v2	v1.15.0	h1:f9kWLNfyCzCB43eupDAk3/XgJ2EpgktiySD6leqs0js=
	dep	github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream	v1.4.0	h1:J/tiyHbl07LL4/1i0rFrW5pbLMvo7M6JrekBUNpLeT4=
	dep	github.com/aws/aws-sdk-go-v2/config	v1.15.0	h1:cibCYF2c2uq0lsbu0Ggbg8RuGeiHCmXwUlTMS77CiK4=
	dep	github.com/aws/aws-sdk-go-v2/credentials	v1.10.0	h1:M/FFpf2w31F7xqJqJLgiM0mFpLOtBvwZggORr6QCpo8=
	dep	github.com/aws/aws-sdk-go-v2/feature/ec2/imds	v1.12.0	h1:gUlb+I7NwDtqJUIRcFYDiheYa97PdVHG/5Iz+SwdoHE=
	dep	github.com/aws/aws-sdk-go-v2/internal/configsources	v1.1.6	h1:xiGjGVQsem2cxoIX61uRGy+Jux2s9C/kKbTrWLdrU54=
	dep	github.com/aws/aws-sdk-go-v2/internal/endpoints/v2	v2.4.0	h1:bt3zw79tm209glISdMRCIVRCwvSDXxgAxh5KWe2qHkY=
	dep	github.com/aws/aws-sdk-go-v2/internal/ini	v1.3.7	h1:QOMEP8jnO8sm0SX/4G7dbaIq2eEP2wcWEsF0jzrXLJc=
	dep	github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding	v1.9.0	h1:uhb7moM7VjqIEpWzTpCvceLDSwrWpaleXm39OnVjuLE=
	dep	github.com/aws/aws-sdk-go-v2/service/internal/checksum	v1.1.0	h1:IhiVUezzcKlszx6wXSDQYDjEn/bIO6Mc73uNQ1YfTmA=
	dep	github.com/aws/aws-sdk-go-v2/service/internal/presigned-url	v1.9.0	h1:YQ3fTXACo7xeAqg0NiqcCmBOXJruUfh+4+O2qxF2EjQ=
	dep	github.com/aws/aws-sdk-go-v2/service/internal/s3shared	v1.13.0	h1:i+7ve93k5G0S2xWBu60CKtmzU5RjBj9g7fcSypQNLR0=
	dep	github.com/aws/aws-sdk-go-v2/service/s3	v1.26.0	h1:6IdBZVY8zod9umkwWrtbH2opcM00eKEmIfZKGUg5ywI=
	dep	github.com/aws/aws-sdk-go-v2/service/sso	v1.11.0	h1:gZLEXLH6NiU8Y52nRhK1jA+9oz7LZzBK242fi/ziXa4=
	dep	github.com/aws/aws-sdk-go-v2/service/sts	v1.16.0	h1:0+X/rJ2+DTBKWbUsn7WtF0JvNk/fRf928vkFsXkbbZs=
	dep	github.com/aws/smithy-go	v1.11.1	h1:IQ+lPZVkSM3FRtyaDox41R8YS6iwPMYIreejOgPW49g=
	dep	github.com/cockroachdb/errors	v1.9.0	h1:B48dYem5SlAY7iU8AKsgedb4gH6mo+bDkbtLIvM/a88=
	dep	github.com/cockroachdb/logtags	v0.0.0-20211118104740-dabe8e521a4f	h1:6jduT9Hfc0njg5jJ1DdKCFPdMBrp/mdZfCpa5h+WM74=
	dep	github.com/cockroachdb/redact	v1.1.3	h1:AKZds10rFSIj7qADf0g46UixK8NNLwWTNdCIGS5wfSQ=
	dep	github.com/davecgh/go-spew	v1.1.1	h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
	dep	github.com/form3tech-oss/jwt-go	v3.2.5+incompatible	h1:/l4kBbb4/vGSsdtB5nUe8L7B9mImVMaBPw9L/0TBHU8=
	dep	github.com/getsentry/sentry-go	v0.12.0	h1:era7g0re5iY13bHSdN/xMkyV+5zZppjRVQhZrXCaEIk=
	dep	github.com/go-logr/logr	v0.2.0	h1:QvGt2nLcHH0WK9orKa+ppBPAxREcH364nPUedEpK0TY=
	dep	github.com/gogo/protobuf	v1.3.2	h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
	dep	github.com/golang-migrate/migrate/v4	v4.15.1	h1:Sakl3Nm6+wQKq0Q62tpFMi5a503bgGhceo2icrgQ9vM=
	dep	github.com/golang/groupcache	v0.0.0-20210331224755-41bb18bfe9da	h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE=
	dep	github.com/golang/protobuf	v1.5.2	h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw=
	dep	github.com/google/go-cmp	v0.5.7	h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o=
	dep	github.com/google/gofuzz	v1.1.0	h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g=
	dep	github.com/google/uuid	v1.3.0	h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
	dep	github.com/googleapis/gax-go/v2	v2.1.1	h1:dp3bWCh+PPO1zjRRiCSczJav13sBvG4UhNyVTa1KqdU=
	dep	github.com/googleapis/gnostic	v0.4.1	h1:DLJCy1n/vrD4HPjOvYcT8aYQXpPIzoRZONaYwyycI+I=
	dep	github.com/hashicorp/errwrap	v1.1.0	h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I=
	dep	github.com/hashicorp/go-multierror	v1.1.1	h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo=
	dep	github.com/imdario/mergo	v0.3.12	h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU=
	dep	github.com/jackc/chunkreader/v2	v2.0.1	h1:i+RDz65UE+mmpjTfyz0MoVTnzeYxroil2G82ki7MGG8=
	dep	github.com/jackc/pgconn	v1.11.0	h1:HiHArx4yFbwl91X3qqIHtUFoiIfLNJXCQRsnzkiwwaQ=
	dep	github.com/jackc/pgio	v1.0.0	h1:g12B9UwVnzGhueNavwioyEEpAmqMe1E/BN9ES+8ovkE=
	dep	github.com/jackc/pgpassfile	v1.0.0	h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM=
	dep	github.com/jackc/pgproto3/v2	v2.2.0	h1:r7JypeP2D3onoQTCxWdTpCtJ4D+qpKr0TxvoyMhZ5ns=
	dep	github.com/jackc/pgservicefile	v0.0.0-20200714003250-2b9c44734f2b	h1:C8S2+VttkHFdOOCXJe+YGfa4vHYwlt4Zx+IVXQ97jYg=
	dep	github.com/jackc/pgtype	v1.10.0	h1:ILnBWrRMSXGczYvmkYD6PsYyVFUNLTnIUJHHDLmqk38=
	dep	github.com/jackc/pgx/v4	v4.15.0	h1:B7dTkXsdILD3MF987WGGCcg+tvLW6bZJdEcqVFeU//w=
	dep	github.com/json-iterator/go	v1.1.12	h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
	dep	github.com/kr/pretty	v0.3.0	h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0=
	dep	github.com/kr/text	v0.2.0	h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
	dep	github.com/lib/pq	v1.10.4	h1:SO9z7FRPzA03QhHKJrH5BXA6HU1rS4V2nIVrrNC1iYk=
	dep	github.com/modern-go/concurrent	v0.0.0-20180306012644-bacd9c7ef1dd	h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
	dep	github.com/modern-go/reflect2	v1.0.2	h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
	dep	github.com/pkg/errors	v0.9.1	h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
	dep	github.com/rogpeppe/go-internal	v1.8.1	h1:geMPLpDpQOgVyCg5z5GoRwLHepNdb71NXb67XFkP+Eg=
	dep	github.com/sethgrid/pester	v1.2.0	h1:adC9RS29rRUef3rIKWPOuP1Jm3/MmB6ke+OhE5giENI=
	dep	github.com/spf13/pflag	v1.0.5	h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
	dep	github.com/tmthrgd/go-bindata	v0.0.0-20190904063317-a4b65675e0fb	h1:fTaLzbXi8Yk24ntb/yp/sEX65EqXYJG4oP3/qPtb6uU=
	dep	github.com/tommy351/zap-stackdriver	v0.1.4	h1:qJqlT8q8xfjFyOs5CS8OvYPyOPEjv8ejhNLVSaRxmn0=
	dep	github.com/vektah/gqlparser/v2	v2.3.1
	=>	github.com/vektah/gqlparser/v2	v2.2.1-0.20210907234948-2a3d320c0f1d	h1:iz3MtAjCTsO1Z8tiuUlvqvEWSklt4WphXJuIc1/kqEc=

	dep	go.opencensus.io	v0.23.0	h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M=
	dep	go.uber.org/atomic	v1.9.0	h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE=
	dep	go.uber.org/multierr	v1.7.0	h1:zaiO/rmgFjbmCXdSYJWQcdvOCsthmdaHfr3Gm2Kx4Ec=
	dep	go.uber.org/zap	v1.21.0	h1:WefMeulhovoZ2sYXz7st6K0sLj7bBhpiFaud4r4zST8=
	dep	golang.org/x/crypto	v0.0.0-20220214200702-86341886e292	h1:f+lwQ+GtmgoY+A2YaQxlSOnDjXcQ7ZRLWOHbC6HtRqE=
	dep	golang.org/x/net	v0.0.0-20220225172249-27dd8689420f	h1:oA4XRj0qtSt8Yo1Zms0CUlsT3KG69V2UGQWPBxujDmc=
	dep	golang.org/x/oauth2	v0.0.0-20220309155454-6242fa91716a	h1:qfl7ob3DIEs3Ml9oLuPwY2N04gymzAW04WsUQHIClgM=
	dep	golang.org/x/sync	v0.0.0-20210220032951-036812b2e83c	h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ=
	dep	golang.org/x/sys	v0.0.0-20220319134239-a9b59b0215f8	h1:OH54vjqzRWmbJ62fjuhxy7AxFFgoHN0/DPc/UrL8cAs=
	dep	golang.org/x/term	v0.0.0-20210927222741-03fcf44c2211	h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY=
	dep	golang.org/x/text	v0.3.7	h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk=
	dep	golang.org/x/time	v0.0.0-20220224211638-0e9765cccd65	h1:M73Iuj3xbbb9Uk1DYhzydthsj6oOd6l9bpuFcNoUvTs=
	dep	golang.org/x/xerrors	v0.0.0-20200804184101-5ec99f83aff1	h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
	dep	google.golang.org/api	v0.73.0	h1:O9bThUh35K1rvUrQwTUQ1eqLC/IYyzUpWavYIO2EXvo=
	dep	google.golang.org/genproto	v0.0.0-20220317150908-0efb43f6373e	h1:fNKDNuUyC4WH+inqDMpfXDdfvwfYILbsX+oskGZ8hxg=
	dep	google.golang.org/grpc	v1.45.0	h1:NEpgUqV3Z+ZjkqMsxMg11IaDrXY4RY6CQukSGK0uI1M=
	dep	google.golang.org/protobuf	v1.27.1	h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ=
	dep	gopkg.in/inf.v0	v0.9.1	h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
	dep	gopkg.in/yaml.v2	v2.4.0	h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
	dep	k8s.io/api	v0.23.4
	=>	k8s.io/api	v0.20.12	h1:LfRpmRkJLwPP8eaYehsVVmIIfg1yCBIIUHaSsdqCgHA=

	dep	k8s.io/apimachinery	v0.23.4
	=>	k8s.io/apimachinery	v0.20.12	h1:2c0LIVNMvB8k2Ozstmhl2zGeCEcPazznuLYEwxFdNjM=

	dep	k8s.io/client-go	v1.5.2
	=>	k8s.io/client-go	v0.20.12	h1:U75SxTC31BHT9i7CbX/hL4v+U1Wkzy/E1vt5ClDPp3I=

	dep	k8s.io/klog/v2	v2.4.0	h1:7+X0fUguPyrKEC4WjH8iGDg3laWgMo5tMnRTIGTTxGQ=
	dep	k8s.io/utils	v0.0.0-20201110183641-67b214c5f920	h1:CbnUZsM497iRC5QMVkHwyl8s2tB3g7yaSHkYPkpgelw=
	dep	sigs.k8s.io/structured-merge-diff/v4	v4.1.2	h1:Hr/htKFmJEbtMgS/UD0N+gtgctAqz81t3nu+sPzynno=
	dep	sigs.k8s.io/yaml	v1.2.0	h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q=
	build	-compiler=gc
	build	-ldflags="  -X github.com/Khan/districts-jobs/pkg/version.AppName=admin-reports  -X github.com/Khan/districts-jobs/pkg/version.Date=2022-03-21T11:18:57-0400  -X github.com/Khan/districts-jobs/pkg/version.GitCommit=7a81dc2600610a667e8519945422cd1ba0d584d7  -X github.com/Khan/districts-jobs/pkg/version.Project=khan-internal-services  -X github.com/Khan/districts-jobs/pkg/version.Version=v0.0.0 "
	build	CGO_ENABLED=1
	build	CGO_CFLAGS=
	build	CGO_CPPFLAGS=
	build	CGO_CXXFLAGS=
	build	CGO_LDFLAGS=
	build	GOARCH=amd64
	build	GOOS=darwin
	build	GOAMD64=v1

@imjasonh
Copy link
Member

Yeah, if I had to guess, I'd say the newline after each => line is a likely culprit. That doesn't show up if you go version -m under Go 1.17.

go install golang.org/dl/go1.17@latest
go1.17 download
go install golang.org/dl/go1.18@latest
go1.18 download
diff <(go1.17 version -m $bin) <(go1.18 version -m $bin)

I can't imagine that was an intentional choice by the Go team.

@StevenACoffman
Copy link
Contributor

Is there also a problem with ko if I am using a version of Go (e.g. 1.18) to install ko (go install github.com/google/ko@latest) and then change the version of Go back to Go 1.17?

I use ASDF to locally switch different versions of Go since we have some apps using Google AppEngine on its latest Go 1.16 (I know, ugh), and Kubernetes apps on shiny new Go 1.18.

@StevenACoffman
Copy link
Contributor

Also, I'm on darwin amd64, but encountered the problem in github actions for Linux.

@imjasonh
Copy link
Member

Is there also a problem with ko if I am using a version of Go (e.g. 1.18) to install ko (go install github.com/google/ko@latest) and then change the version of Go back to Go 1.17?

Maybe? But it sounds like that's not the main issue here.

It sounds like Go-1.18-compatible code might be incapable of parsing Go-1.17-produced output, and maybe vice versa. What a headache.

@tstromberg
Copy link
Contributor

@jdolitsky and I took a look at this, and it appears to be an upstream go v1.18 bug with the new debug.ParseBuildInfo function and local replace directives. I'm working on a patch for ko & go.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants