Skip to content
This repository has been archived by the owner on Mar 28, 2022. It is now read-only.

gcc build broken by .bazelrc #17

Open
while-false opened this issue Sep 24, 2021 · 4 comments
Open

gcc build broken by .bazelrc #17

while-false opened this issue Sep 24, 2021 · 4 comments
Assignees

Comments

@while-false
Copy link
Contributor

while-false commented Sep 24, 2021

We currently have two build lines in .bazelrc:

...
build --cxxopt='-std=c++17' 
build --cxxopt='-Werror=thread-safety-analysis' --cxxopt='-Werror=thread-safety-reference'
...

We probaly want that to be just one line. Worse however, the cxxopts in the second line are clang-specific and breaks building the package locally using gcc.

Suggested resolution is that we

  1. redefine the clang toolchain such that these flags are included only when compiling with clang
  2. update/add a coverage in our build tests for compiling using gcc
while-false pushed a commit that referenced this issue Sep 24, 2021
Update stout-eventuals in light of recent changes, in particular the
inclusion of Post and Get that relies on curl. The inclusion of curl
introduces two new repo dependencies included in this commit.

As outlined in issue #17, building `:grpc` locally using `gcc` is
currently broken by `.bazelrc`. This commit works around it by removing
the offending compiler flags, allowing the library to be built locally.
This is not a fix for the issue: we want those compiler flags in there,
conditionally.
while-false pushed a commit that referenced this issue Sep 24, 2021
Update stout-eventuals in light of recent changes, in particular the
inclusion of Post and Get that relies on curl. The inclusion of curl
introduces two new repo dependencies included in this commit.

As outlined in issue #17, building `:grpc` locally using `gcc` is
currently broken by `.bazelrc`. This commit works around it by removing
the offending compiler flags, allowing the library to be built locally.
This fixes local compilation but it does not fix the issue: we want
those compiler flags in there where possible, i.e., for `clang`.
while-false pushed a commit that referenced this issue Sep 24, 2021
Update stout-eventuals in light of recent changes, in particular the
inclusion of Post and Get that relies on curl. The inclusion of curl
introduces two new repo dependencies included in this commit.

As outlined in issue #17, building `:grpc` locally using `gcc` is
currently broken by `.bazelrc`. This commit works around it by removing
the offending compiler flags, allowing the library to be built locally.
This fixes local compilation but it does not fix the issue: we want
those compiler flags in there where possible, i.e., for `clang`.
@while-false
Copy link
Contributor Author

And here is another clang one from .bazelrc for the test build:
--cxxopt='-fstandalone-debug'

@rjhuijsman
Copy link
Contributor

The multi-line build rule was with the philosophy of "one purpose per line". So one line says "we're using C++17", and the next one says "we're enforcing thread safety". Seemed more readable and scaleable.

Not that this is the primary point of this issue. 😆

while-false pushed a commit that referenced this issue Sep 27, 2021
Update stout-eventuals in light of recent changes, in particular the
inclusion of Post and Get that relies on curl. The inclusion of curl
introduces two new repo dependencies included in this commit.

As outlined in issue #17, building `:grpc` locally using `gcc` is
currently broken by `.bazelrc`. This commit works around it by removing
the offending compiler flags, allowing the library to be built locally.
This fixes local compilation but it does not fix the issue: we want
those compiler flags in there where possible, i.e., for `clang`.
@while-false
Copy link
Contributor Author

The multi-line build rule was with the philosophy of "one purpose per line". So one line says "we're using C++17", and the next one says "we're enforcing thread safety". Seemed more readable and scaleable.

Not that this is the primary point of this issue.

Oh, I did not know that bazel accumulated the statements in this way. I assumed that redundant build lines would redefine the build and only the latest one would count. I can however verify that one indeed gets the accumulated behavior you describe. I learned something new - thanks.

But alas, as you also mention, the issue remain.

@CodingCanuck
Copy link
Contributor

@while-false can we close this? I thought that bazel built with gcc by default, so I assume we're building eventuals-grpc (now called eventuals) with gcc somehow, but I'm not sure if this referred to a build break that's not cover by bazel targets.

@rjhuijsman rjhuijsman removed their assignment Mar 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants