Navigation Menu

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 fails with protobuf 3.8.0 #913

Closed
ollieparanoid opened this issue Jul 5, 2019 · 3 comments · Fixed by #920
Closed

build fails with protobuf 3.8.0 #913

ollieparanoid opened this issue Jul 5, 2019 · 3 comments · Fixed by #920

Comments

@ollieparanoid
Copy link
Contributor

ollieparanoid commented Jul 5, 2019

Alpine Linux edge has just updated their protobuf from 3.6.1 to 3.8.0. postmarketOS builds on top of Alpine edge and it has mir 1.1.2 packaged. Due to the soname change from protobuf, mir needs to be rebuilt. But it does not build against protobuf 3.8.0:

[ 20%] Building CXX object src/server/scene/CMakeFiles/mirscene.dir/broadcasting_session_event_sink.cpp.o
In file included from /home/pmos/build/src/mir-1.1.2/src/server/frontend/session_mediator.cpp:19:
In file included from /home/pmos/build/src/mir-1.1.2/src/server/frontend/session_mediator.h:22:
In file included from /home/pmos/build/src/mir-1.1.2/src/server/frontend/display_server.h:22:
/home/pmos/build/src/mir-1.1.2/src/include/common/mir/protobuf/display_server.h:37:27: error: no type named 'Closure' in namespace 'google::protobuf'
        google::protobuf::Closure* done) = 0;
        ~~~~~~~~~~~~~~~~~~^
/home/pmos/build/src/mir-1.1.2/src/include/common/mir/protobuf/display_server.h:41:27: error: no type named 'Closure' in namespace 'google::protobuf'
        google::protobuf::Closure* done) = 0;
        ~~~~~~~~~~~~~~~~~~^
...

Mir's display_server.h has not been changed since the last two years, so I expect the current version of mir to behave the same way.

I've been reading through the protobuf source, and it seems that google::protobuf::Closure was removed between versions. Unfortunately the git log of protobuf is unreadable and I couldn't find anything useful online. Closure used to be defined in src/google/protobuf/stubs/common.h.

(CC: @z3ntu)

@ollieparanoid
Copy link
Contributor Author

ollieparanoid commented Jul 5, 2019

@MartijnBraam figured out, that the definition of the class has been moved from common.h to callback.h, so with this patch I can get past that particular compilation error:

--- a/src/include/common/mir/protobuf/display_server.h
+++ b/src/include/common/mir/protobuf/display_server.h
@@ -19,6 +19,7 @@
 #ifndef MIR_PROTOBUF_DISPLAY_SERVER_H_
 #define MIR_PROTOBUF_DISPLAY_SERVER_H_
 
+#include <google/protobuf/stubs/callback.h>
 #include "mir_protobuf.pb.h"
 
 namespace mir
   

@ollieparanoid
Copy link
Contributor Author

...and with similar patching in other files, I can get past all protobuf 3.8 related errors. Here is the full patch file: https://gitlab.com/postmarketOS/pmaports/blob/8f6a331ffd350897c4fc8c13fe65a59520534d2f/unity8/mir/0001-Fix-google-protobuf-closure-related-errors.patch

@wmww
Copy link
Contributor

wmww commented Jul 6, 2019

Thanks @ollieparanoid! Would you mind opening a pull request here on GitHub? That way our CI runs and the team can more easily review and merge it.

ollieparanoid pushed a commit to ollieparanoid/mir that referenced this issue Jul 9, 2019
Include google/protobuf/stubs/callback.h to get rid of build errors like
the following, when building against protobuf 3.8.0:

[ 20%] Building CXX object src/server/scene/CMakeFiles/mirscene.dir/broadcasting_session_event_sink.cpp.o
In file included from /home/pmos/build/src/mir-1.1.2/src/server/frontend/session_mediator.cpp:19:
In file included from /home/pmos/build/src/mir-1.1.2/src/server/frontend/session_mediator.h:22:
In file included from /home/pmos/build/src/mir-1.1.2/src/server/frontend/display_server.h:22:
/home/pmos/build/src/mir-1.1.2/src/include/common/mir/protobuf/display_server.h:37:27: error: no type named 'Closure' in namespace 'google::protobuf'
        google::protobuf::Closure* done) = 0;
        ~~~~~~~~~~~~~~~~~~^
/home/pmos/build/src/mir-1.1.2/src/include/common/mir/protobuf/display_server.h:41:27: error: no type named 'Closure' in namespace 'google::protobuf'
        google::protobuf::Closure* done) = 0;
        ~~~~~~~~~~~~~~~~~~^

Related: canonical#913
bors bot added a commit that referenced this issue Jul 16, 2019
920: Fix FTBFS with protobuf 3.8 r=wmww a=AlanGriffiths

Add header that needs to be explicitly included for protobuf 3.8. (Fixes #913)

Co-authored-by: Alan Griffiths <alan@octopull.co.uk>
@bors bors bot closed this as completed in #920 Jul 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants