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

Make C++ compile and run under gcc-4.4 #6863

Merged
merged 31 commits into from
Jun 18, 2016
Merged

Make C++ compile and run under gcc-4.4 #6863

merged 31 commits into from
Jun 18, 2016

Conversation

vjpai
Copy link
Member

@vjpai vjpai commented Jun 10, 2016

Fixes #1928
Basic concepts are as follows

  • Do not allow range-based for or lambda
  • No explicit pointer comparisons to nullptr . All pointers have an implicit conversion to bool and that should be used in comparisons
  • Use GRPC_OVERRIDE and GRPC_FINAL, not override or final
  • unique_ptr must be used with extreme caution in any kind of collection and cannot be used in map (this change has not yet been added to this PR)

A separate PR adds relevant documentation for C++ development information (#6865)

vjpai added 3 commits June 9, 2016 15:50
Remove range-based fors
Do not make explicit comparisons against nullptr; only use
implicit typecast to bool
@vjpai
Copy link
Member Author

vjpai commented Jun 10, 2016

Dealing with this has raised another issue, documented in #6866

@vjpai
Copy link
Member Author

vjpai commented Jun 10, 2016

Fixes #6866

@vjpai
Copy link
Member Author

vjpai commented Jun 10, 2016

Remaining issue: build projects still has all the C++ boringssl tests included. We need to remove this for this case since we are bypassing boringssl for gcc-4.4

@vjpai
Copy link
Member Author

vjpai commented Jun 10, 2016

Yeah, about that. clang-format dockerfile is currently broken because it depends on http://llvm.org/apt , which is temporarily down .

@ctiller
Copy link
Member

ctiller commented Jun 10, 2016

I'd offer to send you a PR against this, but I rebooted my machine: someone
else nearby might be able to do so...

On Fri, Jun 10, 2016 at 4:24 PM Vijay Pai notifications@github.com wrote:

Yeah, about that. clang-format dockerfile is currently broken because it
depends on http://llvm.org/apt , which is temporarily down .


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#6863 (comment), or mute
the thread
https://github.com/notifications/unsubscribe/AJpudaGJqJYSncElBoE6ArE6Wyueh0d-ks5qKfIqgaJpZM4IypSO
.

@vjpai
Copy link
Member Author

vjpai commented Jun 13, 2016

The remaining issue here is that the C++ tests pull in the boringssl tests even if we're not (and can't) use boringssl. Any ideas how to deactivate those?

@vjpai
Copy link
Member Author

vjpai commented Jun 13, 2016

Working on providing a mechanism to disable the tests we don't want.

@vjpai
Copy link
Member Author

vjpai commented Jun 13, 2016

Fixes #6861

@vjpai
Copy link
Member Author

vjpai commented Jun 14, 2016

Current status: need to separate out boringssl test libs from privatelibs_cxx in Makefile which is one of the dependences for building C++ tests . Will require changes to makefile generation or templates.

@vjpai
Copy link
Member Author

vjpai commented Jun 15, 2016

Now we've got a protobuf issue. Need to see how g++4.4 handles friend templates as that seems to be the problem

@vjpai
Copy link
Member Author

vjpai commented Jun 16, 2016

My PR to protobuf (protocolbuffers/protobuf#1692) was merged, so this should build just fine if we pull down the newest protobuf. @nicolasnoble - would appreciate any advice on packaging, etc. implications.

@dgquintas
Copy link
Contributor

heh, it seems you are going to have to fight clang-format on this one...

-    : public CommonStressTest< ::grpc::testing::EchoTestService::AsyncService> {
+    : public CommonStressTest<::grpc::testing::EchoTestService::AsyncService> {

@vjpai
Copy link
Member Author

vjpai commented Jun 17, 2016

Just drop the initial paamayim nekudotayim; it's cleaner. Dropping the reference from global namespace and starting with grpc. Made other change requested by clang-format as well.

@jtattermusch
Copy link
Contributor

Our third_party/protobuf has been bumped to the version with gcc4.4 fixes: #6952

@@ -56,7 +56,7 @@ class ProtoServerReflectionPlugin : public ::grpc::ServerBuilderPlugin {
bool has_sync_methods() const GRPC_OVERRIDE;

private:
std::shared_ptr<::grpc::ProtoServerReflection> reflection_service_;
std::shared_ptr< ::grpc::ProtoServerReflection> reflection_service_;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very interesting that clang-format doesn't undo this change... would we still want to s/ ::grpc/grpc/?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably for consistency, as they've been removed from the other places as well.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@dgquintas
Copy link
Contributor

LGTM, just one nit comment regarding s/ ::grpc/grpc/

@vjpai
Copy link
Member Author

vjpai commented Jun 17, 2016

Confirming that all tests pass when running gcc4.4 manually through docker

@jtattermusch jtattermusch merged commit 56f9862 into grpc:master Jun 18, 2016
@vjpai vjpai deleted the wheezy branch August 18, 2016 20:22
@lock lock bot locked as resolved and limited conversation to collaborators Jan 26, 2019
@lock lock bot unassigned dgquintas Jan 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants