ooni / probe

OONI Probe network measurement tool for detecting internet censorship
https://ooni.org/install
BSD 3-Clause "New" or "Revised" License
750 stars 142 forks source link

cli, engine: use go1.21 #2548

Closed bassosimone closed 6 months ago

bassosimone commented 9 months ago

This issue captures https://github.com/ooni/probe/issues/2524#issuecomment-1730755617 feature request by @jefferyto.

bassosimone commented 9 months ago

It seems it's not yet possible:

% ~/go/bin/go1.21.1 build -v ./...
github.com/Psiphon-Labs/quic-go/internal/qtls
# github.com/Psiphon-Labs/quic-go/internal/qtls
vendor/github.com/Psiphon-Labs/quic-go/internal/qtls/go121.go:5:13: cannot use "The version of quic-go you're using can't be built on Go 1.21 yet. For more details, please see https://github.com/Psiphon-Labs/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.21 yet. F...) as int value in variable declaration

We'll cut 3.19 and 3.20 using go1.20 and 3.21 will hopefully use go1.21.

Luckily, after go1.21 the quic-go library does not need this kind of strict binding with a go version anymore. We still need to bind to a specific Go version, but that would definitely be easier to do.

bassosimone commented 9 months ago

I understand from Psiphon developers that their migration to a Psiphon-Labs/quic-go version supporting go1.21 would take time, because changes to make quic-go use the stdlib for crypto from now on conflict with Psiphon changes to support circumvention they applied in their own fork.

I also investigated what it would take to support go1.21 in our tree by disabling Psiphon and creating a compatibility layer that disables our own stdlib forks of net/http and crypto/tls when using go1.21. I don't want to go down this path, because it would create several subtle behavior differences with the version of ooniprobe using our net/http and crypto/tls forks, which would possibly cause headaches when processing and interpreting measurements. (Not to mention my headache in making sure the version w/o our forks is WAI and even defining what WAI means here is a bit of work.)

Because Psiphon is eventually going to migrate to a version of their quic-go fork supporting go1.21, and because after that migration we would not have build issues, and because we tend to stick using the latest version of Go (chiefly because I am a Go enthusiast and always want to use the latest version), I think it's fair to wait in this case, knowing this is probably the last time in which a version of ooniprobe ships after a version of Go and does not support it (well, hopefully, and I don't want to self-jynx it here 😅 🤞).

bassosimone commented 8 months ago

See also https://github.com/ooni/probe/issues/2585.

bassosimone commented 6 months ago

I will soon merge https://github.com/ooni/probe-cli/pull/1424 and enable building with go1.21. The price to pay is that psiphon will be disabled when building in this configuration. I don't think there's much else I can do here, TBH. 🤷