Git Product home page Git Product logo

Comments (7)

korfuri avatar korfuri commented on June 27, 2024 1

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.

pcj avatar pcj commented on June 27, 2024 1

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.

pcj avatar pcj commented on June 27, 2024

Looping in @korfuri who has experience with c++/travis/bazel too. Thanks!

from rules_protobuf.

jcanizales avatar jcanizales commented on June 27, 2024

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.

jcanizales avatar jcanizales commented on June 27, 2024

Ah, but now that I think about it my Travis build is on OS X, not Linux!

from rules_protobuf.

pcj avatar pcj commented on June 27, 2024

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.

korfuri avatar korfuri commented on June 27, 2024

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 tomain'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 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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.