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
Unable to compile protobufs in pb
namespace
#8349
Comments
Thanks for the report, and I'm sorry this is causing trouble for you. We'll be monitoring this bug and (any other reports we get about this problem) to get a sense for how many users are affected. We don't want to break users, but given how widely used protobuf is, it's hard to make a change like this that won't break anybody. A fair number of the results of the GitHub search appear to be false positives, so it's difficult to quantify how many users are affected. |
Thanks so much for taking a look! I can empathize with how hard it is to make changes in a project relied on my so many. That said, I can comment that this will break how we at Lyft use protobuf and require us to do an extremely costly migration, never upgrade past 3.14, or maintain our own fork - none of which are appealing options. I can see if I can poke around in sourcegraph or another system to find other places in OSS that will be hurt by this. What's going to happen to the well known types that are already in the Happy to brainstorm any solutions here, would an alternative namespace like |
Thanks for the extra info about the impact, it's really helpful. To answer your questions:
Unless the protobuf language itself gets type aliases, it's not possible to change these in a backward-compatible way. So these are currently out of scope.
The main goal of this change is that users can refer to This change is motivated by the fact that the namespace is currently bifurcated: open-source protobuf uses Several other alternatives we have evaluated have already been deemed infeasible ( |
This closes protocolbuffers#8349, although we will probably still pursue some other name in the future.
This closes protocolbuffers#8349, although we will probably still pursue some other name in the future.
I believe that migration to
@haberman, @acozzette, @dlj-NaN, do you think if such approach might work? This will put the code from I am a real fan of migrating into shorter namespace, and |
Hi @georgthegreat, thanks for the feedback. It's true that if our symbols were declared directly in I think we would want to adopt compatibility guarantees like ABSL, which states:
|
I agree, but this does not allow to change the status quo: for every possible short namespace there will be some company named accordingly, and this company will be using protobufs enclosed into corresponding namespace. When the code does not belong to Plethora Brands Company, PB Company Limited or PB Products (none of three looks like an IT company to me), enclosing the code into IMO, the strategy suggested above should be declared and the migration should take place disregarding possible co-existence of a user-defined namespace / package. This should happen is a separate major release (3.16 is a good candidate). |
In Nov 2020 protobuf reserved the namespace
pb
for protobuf to move to in the future (protobuf/src/google/protobuf/port.h
Lines 42 to 44 in bd9a710
pb
namespace and breaks our ability to upgrade. This seems to be quite a common pattern in the industry - there's over 10k examples on github alone - https://github.com/search?l=Protocol+Buffer&p=1&q=%22package+pb%22&type=Code .If at all possible can we roll back that change? I suspect it has the potential to break a huge number of users beyond just us.
What version of protobuf and what language are you using?
Version: 3.15.0
Language: C++
What operating system (Linux, Windows, ...) and version?
OSX
What runtime / compiler are you using (e.g., python version or gcc version)
clang --version
Apple clang version 12.0.0 (clang-1200.0.32.28)
Target: x86_64-apple-darwin19.6.0
Thread model: posix
What did you do?
Steps to reproduce the behavior:
Create file
pb/people/models/people.proto
:What did you expect to see
No output, Code compiles
What did you see instead?
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
The text was updated successfully, but these errors were encountered: