Skip to content

Large Enum causes Go compiler to fail on generated code #1676

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

Closed
wmorgan6796 opened this issue Feb 3, 2025 · 3 comments
Closed

Large Enum causes Go compiler to fail on generated code #1676

wmorgan6796 opened this issue Feb 3, 2025 · 3 comments

Comments

@wmorgan6796
Copy link

What version of protobuf and what language are you using?
Version:

// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// 	protoc-gen-go v1.34.2
// 	protoc        v3.20.1

What did you do?
Generate code with an extremely large enum. I cannot provide the source file, but the issue is the generated map is too large for the go compiler to compile it.

What did you expect to see?
A successful compile.

What did you see instead?

golang/go#33437 <-- This issue

Make sure you include information that can help us debug (full error message, exception listing, stack trace, logs).

Anything else we should know about your project / environment?

We generate protobufs from an internal source. These files are large, complex, and the enums get extremely large (1000s of entries).

@stapelberg
Copy link

I am not sure what you expect the Go Protobuf maintainers can do here? You seem to be running into a Go compiler limitation (golang/go#33437, which you linked to).

In general, I would strongly recommend to fix the issue at the source: Split up your large number of values into smaller chunks. This will likely ease stress on your build system and toolchain in a number of dimensions.

@Jorropo
Copy link
Member

Jorropo commented Feb 3, 2025

For context, this compiler bug was fixed in 1.20rc3 released in January 2023.

@stapelberg
Copy link

Thanks for pointing that out, @Jorropo.

I’ll close this issue for now as the issue report seems too incomplete to do anything with (no example provided, claims it’s running into a years-old compiler bug).

@stapelberg stapelberg closed this as not planned Won't fix, can't repro, duplicate, stale Feb 4, 2025
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

No branches or pull requests

3 participants