refraction-networking / utls

Fork of the Go standard TLS library, providing low-level access to the ClientHello for mimicry purposes.
BSD 3-Clause "New" or "Revised" License
1.57k stars 230 forks source link

Towards better versioning policy #290

Open gaukas opened 2 months ago

gaukas commented 2 months ago

As discussed before, to reduce the extra workload and confusion in maintaining uTLS across multiple different Go versions, uTLS is set to support the top 2 MOST RECENT Go (minor) versions. e.g., for April 02, 2024, the latest Go version is Go 1.22.1 so we will support Go 1.21 and Go 1.22. That is to say, once uTLS bump up the minimum version required to go 1.21, Go 1.20 and older version of Go will no longer be able to build and run programs built with uTLS as a dependency.

We also acknowledge and are deeply concerned about another issue mentioned in #249, that past updates to uTLS have broken backward compatibility for a few times for various reason, causing old code no longer compile with newer version of uTLS. While there are human errors in the maintainers of uTLS by mistakenly removing/renaming public interfaces, other uncontrollable factors such as crypto/tls making breaking changes to their function signature or crypto/tls exporting a type in a name existing in uTLS are more concerning.

Onward, here's a few possible versioning policies we can adopt, with pros and cons for each:

VeNoMouS commented 2 months ago

Re: crypto/tls ..

Let's not forget that whole debate about switching to cloudflares branch of crypto/tls due to their work/changes on ECH etc

gaukas commented 2 months ago

Let's not forget that whole debate about switching to cloudflares branch of crypto/tls due to their work/changes on ECH etc

Only if cloudflare can stop rebasing their commits 😅

Unlike us, cloudflare rebase their changes/commits on top of latest main branch of golang/go (ir)regularly, which is pretty tricky to maintain since we are also making changes based on theirs.

bassosimone commented 1 month ago

Thanks for opening this issue, @gaukas!

Regarding this:

Cons: go mod's automated dependency update will not work at all.

I assume you mean that go get -u -v ./... will stop updating, is that correct?

I don't know if it's helpful, but I have been recently using https://github.com/icholy/gomajor to check whether I need to upgrade to major versions of OONI dependencies.

gaukas commented 1 month ago

Hi @bassosimone, thanks for the reply. Yes, that's exactly what I meant.

While third-party tools (such as the one you mentioned, icholy/gomajor could be quite helpful in this case, it is obviously that automated procedures such as go get -u -v ./... or GitHub dependabot will be impacted. And we just cannot simply assume/suggest all importing parties should use any certain third-party tool.

For now I am leaning towards the last two options, with a strong preference in tagging a v2 in the very near future to first address all the existing forward compatibility problems once-and-for-all, which would at least buy us some time in figuring out a more proper long-term solution.