Skip to content

Commit 92c3e39

Browse files
kouassignUser
authored andcommitted
GH-46077: [CI][C++] Disable -Werror on macos-13 (#46106)
### Rationale for this change Our C++ build started failing with GitHub Actions runner macos-13 ([13.7.5 (22H527)](actions/runner-images#11962)): ```text FAILED: src/arrow/CMakeFiles/arrow_util.dir/util/utf8.cc.o /usr/local/bin/ccache /usr/bin/c++ -DARROW_HAVE_RUNTIME_AVX2 -DARROW_HAVE_RUNTIME_AVX512 -DARROW_HAVE_RUNTIME_BMI2 -DARROW_HAVE_RUNTIME_SSE4_2 -DARROW_HAVE_SSE4_2 -DARROW_WITH_TIMING_TESTS -DURI_STATIC_BUILD -I/Users/runner/work/arrow/arrow/build/cpp/src -I/Users/runner/work/arrow/arrow/cpp/src -I/Users/runner/work/arrow/arrow/cpp/src/generated -isystem /usr/local/Cellar/boost/1.87.0_1/include -isystem /usr/local/Cellar/brotli/1.1.0/include -isystem /usr/local/opt/lz4/include -fno-aligned-new -Qunused-arguments -fcolor-diagnostics -Wall -Wextra -Wdocumentation -DARROW_WARN_DOCUMENTATION -Wshorten-64-to-32 -Wno-missing-braces -Wno-unused-parameter -Wno-constant-logical-operand -Wno-return-stack-address -Wdate-time -Wno-unknown-warning-option -Wno-pass-failed -msse4.2 -g -Werror -O0 -ggdb -g1 -std=c++17 -mmacosx-version-min=12 -fPIC -MD -MT src/arrow/CMakeFiles/arrow_util.dir/util/utf8.cc.o -MF src/arrow/CMakeFiles/arrow_util.dir/util/utf8.cc.o.d -o src/arrow/CMakeFiles/arrow_util.dir/util/utf8.cc.o -c /Users/runner/work/arrow/arrow/cpp/src/arrow/util/utf8.cc In file included from /Users/runner/work/arrow/arrow/cpp/src/arrow/util/utf8.cc:28: In file included from /Users/runner/work/arrow/arrow/cpp/src/arrow/util/utf8_internal.h:28: In file included from /usr/local/include/xsimd/xsimd.hpp:57: /usr/local/include/xsimd/memory/xsimd_aligned_allocator.hpp:165:15: error: parameter 'hint' not found in the function declaration [-Werror,-Wdocumentation] * @ param hint unused parameter provided for standard compliance. ^~~~ /usr/local/include/xsimd/memory/xsimd_aligned_allocator.hpp:186:15: error: parameter 'n' not found in the function declaration [-Werror,-Wdocumentation] * @ param n number of objects earlier passed to allocate(). ^ ``` It's caused by warnings in XSimd headers. (There are similar warnings in RaipdJSON headers and so on.) In general, warnings in external libraries are ignored by `-isystem`. But `-isystem /usr/local/include` isn't used in the runner. I don't know what is the cause of this behavior change in the runner update. But CMake 3.31.6 -> 4.0.0 update may be related. ### What changes are included in this PR? Disable `-Werror` because it's difficult to suppress warnings all packages installed by Homebrew. ### Are these changes tested? Yes. ### Are there any user-facing changes? No. * GitHub Issue: #46077 Authored-by: Sutou Kouhei <kou@clear-code.com> Signed-off-by: Raúl Cumplido <raulcumplido@gmail.com>
1 parent 2f82cd8 commit 92c3e39

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

.github/workflows/cpp.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,19 @@ jobs:
255255
restore-keys: cpp-ccache-macos-${{ matrix.macos-version }}-
256256
- name: Build
257257
run: |
258+
if [ "${{ matrix.macos-version }}" = "13" ]; then
259+
# This is a workaround.
260+
#
261+
# Homebrew uses /usr/local as prefix. So packages
262+
# installed by Homebrew also use /usr/local/include. We
263+
# want to include headers for packages installed by
264+
# Homebrew as system headers to ignore warnings in them.
265+
# But "-isystem /usr/local/include" isn't used by CMake
266+
# because /usr/local/include is marked as the default
267+
# include path. So we disable -Werror to avoid build error
268+
# by warnings from packages installed by Homebrew.
269+
export BUILD_WARNING_LEVEL=PRODUCTION
270+
fi
258271
ci/scripts/cpp_build.sh $(pwd) $(pwd)/build
259272
- name: Test
260273
shell: bash

.github/workflows/python.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ jobs:
195195
brew uninstall pkg-config || :
196196
brew uninstall pkg-config@0.29.2 || :
197197
brew bundle --file=cpp/Brewfile
198+
198199
python -m pip install \
199200
-r python/requirements-build.txt \
200201
-r python/requirements-test.txt
@@ -218,6 +219,20 @@ jobs:
218219
- name: Build
219220
shell: bash
220221
run: |
222+
if [ "${{ matrix.macos-version }}" = "13" ]; then
223+
# This is a workaround.
224+
#
225+
# Homebrew uses /usr/local as prefix. So packages
226+
# installed by Homebrew also use /usr/local/include. We
227+
# want to include headers for packages installed by
228+
# Homebrew as system headers to ignore warnings in them.
229+
# But "-isystem /usr/local/include" isn't used by CMake
230+
# because /usr/local/include is marked as the default
231+
# include path. So we disable -Werror to avoid build error
232+
# by warnings from packages installed by Homebrew.
233+
export BUILD_WARNING_LEVEL=PRODUCTION
234+
fi
235+
221236
python -m pip install wheel
222237
ci/scripts/cpp_build.sh $(pwd) $(pwd)/build
223238
ci/scripts/python_build.sh $(pwd) $(pwd)/build

0 commit comments

Comments
 (0)