Comments (7)
cc1: error: unrecognized command line option '-std=c11'
sounds like you are using an old, old g++. That's a common problem with Travis: its default gcc is quite old. I haven't used Bazel on Travis in a while, but IIRC the only way to make that work with Bazel is to provide a custom CROSSTOOL that specifies /usr/bin/g++-4.8 instead of just /usr/bin/g++ as the compiler.
See https://github.com/korfuri/bazel-travis/blob/master/tools/custom_crosstool/CROSSTOOL for instance for how I did it in my old bazel-travis demo.
There may be a much easier way nowadays, Bazel has evolved a lot since I last used it.
from rules_protobuf.
Well that's a bit embarrassing! Thanks for your help though, that did the trick. The build is passing now. Closing this issue.
from rules_protobuf.
Looping in @korfuri who has experience with c++/travis/bazel too. Thanks!
from rules_protobuf.
Hi Paul, no need to ask humbly, I'm very happy to help :) Although I don't think I'll be very useful in this specific situation. I do have Travis compiling a C++ gRPC server and it never gave me an issue. I haven't looked much inside the Makefile
at the root of the https://github.com/grpc/grpc repo, but make interop_server
triggers that build. It brings the BoringSSL sources from a submodule.
from rules_protobuf.
Ah, but now that I think about it my Travis build is on OS X, not Linux!
from rules_protobuf.
I'm now using the trusty beta "mega" image which is selected via dist: trusty
+ sudo: required
flags. This has more modern c++ toolchain incl. gcc4.8. It appears to be building the grpc dependencies and boringssl without issue. No custom CROSSTOOL needed.
The client build is failing however with the following problem:
ERROR: /home/travis/build/pubref/rules_protobuf/examples/helloworld/cpp/BUILD:55:1: Linking of rule '//examples/helloworld/cpp:client' failed: gcc failed: error executing command
(cd /home/travis/.cache/bazel/execroot/rules_protobuf && \
exec env - \
/usr/bin/gcc -o bazel-out/local-fastbuild/bin/examples/helloworld/cpp/client -Wl,-no-as-needed -B/usr/bin -B/usr/bin -pass-exit-codes '-Wl,--build-id=md5' '-Wl,--hash-style=gnu' -Wl,-S -Wl,@bazel-out/local-fastbuild/bin/examples/helloworld/cpp/client-2.params): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1.
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
collect2: error: ld returned 1 exit status
It may be a botched attempt to abstract the client interface into a header file for use in a gtest by a non-c++ programmer (me). Works on osx however.
@jcanizales @korfuri Does this still look like a toolchain problem or just bad C++ programming?
https://travis-ci.org/pubref/rules_protobuf/jobs/151816356
from rules_protobuf.
Just bad C++ programming here ;) you're missing a main() function.
In your "travis" branch, you commented the main() out of greeter_client.cc
when you split that to a cc_library instead of a cc_binary, but
//examples/helloworld/cpp:client (the new cc_binary) doesn't have a srcs
list. You should move the main() that is commented in greeter_client.cc to
another file, say greeter_client_main.cc, and add that file to the srcs of
:client.
On Fri, Aug 12, 2016 at 7:33 AM Paul Cody Johnston [email protected]
wrote:
I'm now using the trusty beta "mega" image which is selected via dist:
trusty + sudo: required flags. This has more modern c++ toolchain incl.
gcc4.8. It appears to be building the grpc dependencies and boringssl
without issue. No custom CROSSTOOL needed.The client build is failing however with the following problem:
ERROR: /home/travis/build/pubref/rules_protobuf/examples/helloworld/cpp/BUILD:55:1: Linking of rule '//examples/helloworld/cpp:client' failed: gcc failed: error executing command
(cd /home/travis/.cache/bazel/execroot/rules_protobuf &&
exec env -
/usr/bin/gcc -o bazel-out/local-fastbuild/bin/examples/helloworld/cpp/client -Wl,-no-as-needed -B/usr/bin -B/usr/bin -pass-exit-codes '-Wl,--build-id=md5' '-Wl,--hash-style=gnu' -Wl,-S -Wl,@bazel-out/local-fastbuild/bin/examples/helloworld/cpp/client-2.params): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1.
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crt1.o: In function_start': (.text+0x20): undefined reference to
main'collect2: error: ld returned 1 exit statusIt may be a botched attempt to abstract the client interface into a header
file for use in a gtest by a non-c++ programmer (me). Works on osx however.@jcanizales https://github.com/jcanizales @korfuri
https://github.com/korfuri Does this still look like a toolchain
problem or just bad C++ programming?https://travis-ci.org/pubref/rules_protobuf/jobs/151816356
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#2 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABEnp7jWOYieM_bmVJqIQDzFdwz3zZgTks5qfIQigaJpZM4Jc-kC
.
from rules_protobuf.
Related Issues (20)
- Can't build GRPC when using cpp_proto_repositories HOT 5
- py_proto_library fails when taking input from a genrule HOT 1
- Not work with rules_go v0.13.0 HOT 3
- Dart support? HOT 4
- Go rules HOT 1
- Can't resolve @go_googleapis//google/api HOT 1
- Custom protoc generators HOT 1
- using imports in py_proto_compile fails: _pb2.py and pb2_grpc.py not created HOT 1
- gogo_proto_library with the "well known types" (google/protobuf) HOT 12
- Non repeatable build for grpc_cli HOT 1
- Update rules_protobuf to rules_go 0.16.0 HOT 7
- Addition of protoc-gen-grpc-web HOT 2
- 32-bit C++ compilation HOT 3
- including well known protos in ruby_proto_compile HOT 4
- support latest grpc version HOT 1
- Bazel deprecated native http_archive rule HOT 2
- Unable to load package for 'org_pubref_rules_protobuf/java/rules.bzl' HOT 1
- name 'FileType' is not defined HOT 2
- BUG: Error in label: label() got unexpected keyword argument 'single_file' HOT 2
- file '//protobuf:rules.bzl' does not contain symbol 'proto_compile'
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rules_protobuf.