Go 1.19 just dropped

Which means that we can now use 1.18 features, as per our policy. Generics ahoy.

7 Likes

The current main fails to build on Go 1.19 in my tests with the following error.

# github.com/lucas-clemente/quic-go/internal/qtls
C:\...\go\pkg\mod\github.com\lucas-clemente\quic-go@v0.27.0\internal\qtls\go119.go:6:13: cannot use "The version of quic-go you're using can't be built on Go 1.19 yet. For more details, please see https://github.com/lucas-clemente/quic-go/wiki/quic-go-and-Go-versions." (untyped string constant "The version of quic-go you're using can't be built on Go 1.19 yet. F...) as int value in variable declaration

Also, when trying to run

go install github.com/syncthing/syncthing/cmd/stsigtool@latest

I get

go: github.com/syncthing/syncthing/cmd/stsigtool@latest (in github.com/syncthing/syncthing@v1.20.4):
        The go.mod file for the module providing named packages contains one or
        more replace directives. It must not contain directives that would cause
        it to be interpreted differently than if it were the main module.

Not sure whether this is important or not though.

I fixed that yesterday, you probably need to pull.

3 Likes

That was it. I use scripts to always update to the latest main before compiling, so I was sure that I had the latest code locally, but I’d unknowingly broken the relevant script by mistake a few days earlier :sweat_smile:.

Everything is fine now!

1 Like

I fixed that yesterday, you probably need to pull.

Since this fix isn’t in a release yet, is there a commit I can backport to the last release? (or is a new release due any moment perhaps?)

OpenBSD ports are trying to move to go-1.19, but it breaks our syncthing port.

Thanks

Yes, 209e68c1b. A release is not imminent.

Thanks

The patch doesn’t apply cleanly to the latest release, but I tried to resolve it manually.

The build is broken with:

# github.com/syncthing/syncthing/vendor/github.com/lucas-clemente/quic-go/internal/qtls
vendor/github.com/lucas-clemente/quic-go/internal/qtls/go119.go:6:13: cannot use "The version of quic-go you're using can't be built on Go 1.19 yet. For more details, please see https://github.com/lucas-clemente/quic-go/wiki/quic-go-and-Go-versions." (untyped string constant "The version of quic-go you're using can't be built on Go 1.19 yet. F...) as int value in variable declaration
cat >$WORK/b336/importcfg << 'EOF' # internal

That’s despite this patch hunk in go.mod (i applied your whole patch set):

-	github.com/lucas-clemente/quic-go v0.27.0
+	github.com/lucas-clemente/quic-go v0.28.1

I emptied out go.sum as I believe it is an auto-generated cache file, right?

(sorry, I am still a go noob)

We will just use a release candidate in the interim.