Skip to content

Commit

Permalink
Move -Werror to our test/dev bazelrc files. (#17938)
Browse files Browse the repository at this point in the history
    * Move -Werror to our test/dev bazelrc files.

    Putting it into BUILD files unintentionally forces it on all our downstream users.  Instead, we just want to enable this during testing and let them choose for themselves in their builds.

    Note, that this expands the scope of -Werror to our entire repo for CI, so a bunch of fixes and opt-outs had to be applied to get this change passing.

    Closed #14714

    PiperOrigin-RevId: 666903224

    * Fix extra warnings on 28.x

    * Fix zlib issues on macos

    * Second try at zlib/macos issues

    * Only disable deprecated-non-prototype on macos-14
  • Loading branch information
zhangskz committed Sep 18, 2024
1 parent cc228f1 commit f38b4f4
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
build --cxxopt=-std=c++17 --host_cxxopt=-std=c++17

build --copt="-Werror" --copt="-Wno-sign-compare" --copt="-Wno-sign-conversion" --copt="-Wno-error=sign-conversion" --copt="-Wno-deprecated-declarations"


build:dbg --compilation_mode=dbg

build:opt --compilation_mode=opt
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/test_objectivec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ jobs:
- OS: macos-14
PLATFORM: "visionos"
XCODE: "15.2"
EXTRA_FLAGS: --copt="-Wno-deprecated-non-prototype"
name: CocoaPods ${{ matrix.PLATFORM }} ${{ matrix.CONFIGURATION }}
runs-on: ${{ matrix.OS }}
steps:
Expand All @@ -91,7 +92,7 @@ jobs:
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
bazel-cache: cocoapods/${{ matrix.XCODE }}
bash: |
./regenerate_stale_files.sh $BAZEL_FLAGS --xcode_version="${{ matrix.XCODE }}"
./regenerate_stale_files.sh $BAZEL_FLAGS ${{ matrix.EXTRA_FLAGS }} --xcode_version="${{ matrix.XCODE }}"
pod lib lint --verbose \
--configuration=${{ matrix.CONFIGURATION }} \
--platforms=${{ matrix.PLATFORM }} \
Expand Down
2 changes: 1 addition & 1 deletion ci/Linux.bazelrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import common.bazelrc

build --cxxopt=-std=c++14 --host_cxxopt=-std=c++14
build --copt="-Werror" --copt="-Wno-sign-compare" --copt="-Wno-sign-conversion" --copt="-Wno-error=sign-conversion"
build --copt="-Werror" --copt="-Wno-sign-compare" --copt="-Wno-sign-conversion" --copt="-Wno-error=sign-conversion" --copt="-Wno-deprecated-declarations"
2 changes: 1 addition & 1 deletion ci/macOS.bazelrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import common.bazelrc

build --cxxopt=-std=c++14 --host_cxxopt=-std=c++14
build --copt="-Werror" --copt="-Wno-sign-compare" --copt="-Wno-sign-conversion" --copt="-Wno-error=sign-conversion"
build --copt="-Werror" --copt="-Wno-sign-compare" --copt="-Wno-sign-conversion" --copt="-Wno-error=sign-conversion" --copt="-Wno-deprecated-declarations"
common --repo_env=BAZEL_NO_APPLE_CPP_TOOLCHAIN=1

0 comments on commit f38b4f4

Please sign in to comment.