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

Proposal: remove presumably unused purego support #1640

Closed
stapelberg opened this issue Aug 9, 2024 · 0 comments
Closed

Proposal: remove presumably unused purego support #1640

stapelberg opened this issue Aug 9, 2024 · 0 comments
Labels

Comments

@stapelberg
Copy link

Support for the purego build tag was originally introduced to make Go Protobuf
work on Google AppEngine (see also https://go.dev/issue/23172).

We propose to remove the presumably unused purego support to simplify the code base.

If anyone still relies on Go Protobuf’s purego support,
please let us know and explain where / how you use it.

What can we remove?

We can delete 4 alternative implementations that are build tag guarded with the
purego build tag: /~https://github.com/search?q=repo%3Aprotocolbuffers%2Fprotobuf-go%20%22build%20purego%22&type=code

We can remove the Exporter field in the internal/impl.MessageInfo type and the
related exporter functions in the generated .pb.go files.

For large Go programs, we observed up to 10 MiB of binary file size savings.

Who used the purego build tag?

Nowadays, AppEngine works differently and no longer needs the purego build tag.

Environments like WASM do not need the purego build tag either (tested with
wazero on Go 1.21.4).

This leaves GopherJS as the only remaining environment we know of that might
need the purego build tag. I spoke to @dmitshur (who used to be a maintainer of
GopherJS) and emailed with @nevkontakte (who is a current maintainer of GopherJS).

As far as we can tell, there isn’t a single notable (published) GopherJS application
that uses Go Protobuf.

There are some contributing factors: Go Protobuf is relatively heavyweight in
size, but when working with JavaScript, smaller code size translates into faster
loading times. Hence, users are more likely to reach for builtin solutions like
encoding/json.

gopherbot pushed a commit to protocolbuffers/protobuf-go that referenced this issue Aug 23, 2024
This should have been part of CL 606755.

related to golang/protobuf#1640

Change-Id: Iae1bfb9e3bd440f879047d3a78e1bba364d7568c
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/607775
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Christian Höppner <hoeppi@google.com>
mcy added a commit to bufbuild/protocompile that referenced this issue Oct 11, 2024
Protobuf itself no longer supports it, so neither should we. See
golang/protobuf#1640
gopherbot pushed a commit to protocolbuffers/protobuf-go that referenced this issue Jan 8, 2025
This parameter became unused with golang/protobuf#1640.

Change-Id: Iab50ffb757f5b6f017bc32c37b25294894c1c6d9
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/641019
Reviewed-by: Chressie Himpel <chressie@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
zasuchilas added a commit to zasuchilas/shortener that referenced this issue Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant