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

[Build] Failure to build with "expected identifier before ‘alignas’`" #16867

Closed
veblush opened this issue May 16, 2024 · 3 comments
Closed
Assignees
Labels

Comments

@veblush
Copy link
Contributor

veblush commented May 16, 2024

What version of protobuf and what language are you using?

Protobuf commit 9f40411

What operating system (Linux, Windows, ...) and version?

Linux Debian 11 using Docker

What runtime / compiler are you using (e.g., python version or gcc version)

gcc 10 / cmake build with -DBUILD_SHARED_LIBS=ON

What did you do?

Build protobuf with cmake -DBUILD_SHARED_LIBS=ON option

What did you expect to see

Successful build

What did you see instead?

Build failure with log

[ 36%] Building CXX object third_party/protobuf/CMakeFiles/libprotobuf.dir/src/google/protobuf/any.cc.o
In file included from /var/local/jenkins/grpc/third_party/protobuf/src/google/protobuf/any.pb.h:21,
                 from /var/local/jenkins/grpc/third_party/protobuf/src/google/protobuf/any.pb.cc:6:
/var/local/jenkins/grpc/third_party/protobuf/src/google/protobuf/arena.h:145:23: error: expected identifier before ‘alignas’
  145 | class PROTOBUF_EXPORT alignas(8) Arena final {
      |                       ^~~~~~~
/var/local/jenkins/grpc/third_party/protobuf/src/google/protobuf/arena.h:145:40: error: expected initializer before ‘final’
  145 | class PROTOBUF_EXPORT alignas(8) Arena final {
      |                                        ^~~~~
/var/local/jenkins/grpc/third_party/protobuf/src/google/protobuf/arena.h:659:61: error: invalid use of incomplete type ‘class google::protobuf::Arena’
  659 | PROTOBUF_NOINLINE void* Arena::DefaultConstruct(Arena* arena) {
      |                                                             ^
/var/local/jenkins/grpc/third_party/protobuf/src/google/protobuf/arena.h:51:7: note: forward declaration of ‘class google::protobuf::Arena’
   51 | class Arena;    // defined below
      |       ^~~~~
/var/local/jenkins/grpc/third_party/protobuf/src/google/protobuf/arena.h:667:76: error: invalid use of incomplete type ‘class google::protobuf::Arena’
  667 | PROTOBUF_NOINLINE void* Arena::CopyConstruct(Arena* arena, const void* from) {
      |                                                                            ^
/var/local/jenkins/grpc/third_party/protobuf/src/google/protobuf/arena.h:51:7: note: forward declaration of ‘class google::protobuf::Arena’
   51 | class Arena;    // defined below
      |       ^~~~~
/var/local/jenkins/grpc/third_party/protobuf/src/google/protobuf/arena.h:675:37: error: expected initializer before ‘<’ token
  675 | inline void* Arena::AllocateInternal() {

Anything else we should know about your project / environment

  • You can check the PR catching this issue; [Deps] Protobuf at head grpc/grpc#36626
  • This test is running under this docker image; us-docker.pkg.dev/grpc-testing/testing-images-public/cxx_debian11_x64:a9c5d062364adc836b4068cad93a3e448b25c37c@sha256:9f9285da21c1053ac715027e0cee66c20c70ebf016053328a4cee61ffd37e59b
@veblush veblush added the untriaged auto added to all issues by default when created. label May 16, 2024
@zhangskz
Copy link
Member

@sbenzaquen Looks like this was introduced in ec126a5, which undoes previous fix for this 32caf511c8. Can you take a look?

@zhangskz zhangskz added c++ and removed untriaged auto added to all issues by default when created. labels May 16, 2024
@veblush
Copy link
Contributor Author

veblush commented May 21, 2024

Verified and thanks for the quick fix. This issue can be closed if there is nothing to follow up with.

@zhangskz
Copy link
Member

Thanks for confirming -- closing.

This was fixed via rollback: baeab50

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

3 participants