Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI][C++] Failed to build array_run_end_test.cc on Debian 10 #34308

Closed
kou opened this issue Feb 23, 2023 · 0 comments · Fixed by #34317
Closed

[CI][C++] Failed to build array_run_end_test.cc on Debian 10 #34308

kou opened this issue Feb 23, 2023 · 0 comments · Fixed by #34317

Comments

@kou
Copy link
Member

kou commented Feb 23, 2023

Describe the bug, including details regarding any error messages, version, and platform.

https://github.com/ursacomputing/crossbow/actions/runs/4248256583/jobs/7387221716#step:5:1617

FAILED: src/arrow/CMakeFiles/arrow-array-test.dir/array/array_run_end_test.cc.o 
/usr/local/bin/sccache /usr/lib/ccache/g++  -DARROW_HAVE_RUNTIME_AVX2 -DARROW_HAVE_RUNTIME_AVX512 -DARROW_HAVE_RUNTIME_BMI2 -DARROW_HAVE_RUNTIME_SSE4_2 -DARROW_HAVE_SSE4_2 -DARROW_HDFS -DARROW_MIMALLOC -DARROW_WITH_BROTLI -DARROW_WITH_BZ2 -DARROW_WITH_LZ4 -DARROW_WITH_RE2 -DARROW_WITH_SNAPPY -DARROW_WITH_TIMING_TESTS -DARROW_WITH_UTF8PROC -DARROW_WITH_ZLIB -DARROW_WITH_ZSTD -DGMOCK_LINKED_AS_SHARED_LIBRARY=1 -DGTEST_LINKED_AS_SHARED_LIBRARY=1 -DURI_STATIC_BUILD -Isrc -I/arrow/cpp/src -I/arrow/cpp/src/generated -isystem /arrow/cpp/thirdparty/flatbuffers/include -isystem /arrow/cpp/thirdparty/hadoop/include -isystem orc_ep-install/include -isystem zstd_ep-install/include -isystem protobuf_ep-install/include -isystem awssdk_ep-install/include -isystem /usr/include/x86_64-linux-gnu -isystem xsimd_ep/src/xsimd_ep-install/include -isystem jemalloc_ep-prefix/src -isystem mimalloc_ep/src/mimalloc_ep/include/mimalloc-2.0 -isystem googletest_ep-prefix/include -Wno-noexcept-type  -fdiagnostics-color=always  -Wall -Wno-conversion -Wno-sign-conversion -Wunused-result -fno-semantic-interposition -msse4.2  -g -Werror -O0 -ggdb -fPIE   -pthread -std=c++17 -MD -MT src/arrow/CMakeFiles/arrow-array-test.dir/array/array_run_end_test.cc.o -MF src/arrow/CMakeFiles/arrow-array-test.dir/array/array_run_end_test.cc.o.d -o src/arrow/CMakeFiles/arrow-array-test.dir/array/array_run_end_test.cc.o -c /arrow/cpp/src/arrow/array/array_run_end_test.cc
/arrow/cpp/src/arrow/array/array_run_end_test.cc: In member function 'virtual void arrow::{anonymous}::TestRunEndEncodedArray_Printing_Test::TestBody()':
/arrow/cpp/src/arrow/array/array_run_end_test.cc:580:9: error: converting to 'std::__cxx11::basic_stringstream<char>' from initializer list would use explicit constructor 'std::__cxx11::basic_stringstream<_CharT, _Traits, _Alloc>::basic_stringstream(std::ios_base::openmode) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; std::ios_base::openmode = std::_Ios_Openmode]' [-Werror]
   ss = {};
         ^
/arrow/cpp/src/arrow/array/array_run_end_test.cc:580:9: note: in C++11 and above a default constructor can be explicit
/arrow/cpp/src/arrow/array/array_run_end_test.cc:598:9: error: converting to 'std::__cxx11::basic_stringstream<char>' from initializer list would use explicit constructor 'std::__cxx11::basic_stringstream<_CharT, _Traits, _Alloc>::basic_stringstream(std::ios_base::openmode) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; std::ios_base::openmode = std::_Ios_Openmode]' [-Werror]
   ss = {};
         ^
/arrow/cpp/src/arrow/array/array_run_end_test.cc:598:9: note: in C++11 and above a default constructor can be explicit
/arrow/cpp/src/arrow/array/array_run_end_test.cc:619:9: error: converting to 'std::__cxx11::basic_stringstream<char>' from initializer list would use explicit constructor 'std::__cxx11::basic_stringstream<_CharT, _Traits, _Alloc>::basic_stringstream(std::ios_base::openmode) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; std::ios_base::openmode = std::_Ios_Openmode]' [-Werror]
   ss = {};
         ^
/arrow/cpp/src/arrow/array/array_run_end_test.cc:619:9: note: in C++11 and above a default constructor can be explicit
cc1plus: all warnings being treated as errors

The following patch will fix this:

diff --git a/cpp/src/arrow/array/array_run_end_test.cc b/cpp/src/arrow/array/array_run_end_test.cc
index 6b244f3932..9cf4c41056 100644
--- a/cpp/src/arrow/array/array_run_end_test.cc
+++ b/cpp/src/arrow/array/array_run_end_test.cc
@@ -577,7 +577,7 @@ TEST_P(TestRunEndEncodedArray, Printing) {
 
   ASSERT_OK_AND_ASSIGN(auto string_array,
                        RunEndEncodedArray::Make(30, run_end_values, string_values));
-  ss = {};
+  ss.str("");
   ASSERT_OK(PrettyPrint(*string_array, {}, &ss));
   ASSERT_EQ(ss.str(),
             "\n"
@@ -595,7 +595,7 @@ TEST_P(TestRunEndEncodedArray, Printing) {
             "  ]");
 
   auto sliced_array = string_array->Slice(15, 6);
-  ss = {};
+  ss.str("");
   ASSERT_OK(PrettyPrint(*sliced_array, {}, &ss));
   ASSERT_EQ(ss.str(),
             "\n"
@@ -616,7 +616,7 @@ TEST_P(TestRunEndEncodedArray, Printing) {
                        RunEndEncodedArray::Make(0, ArrayFromJSON(run_end_type, "[]"),
                                                 ArrayFromJSON(binary(), "[]")));
 
-  ss = {};
+  ss.str("");
   ASSERT_OK(PrettyPrint(*empty_array, {}, &ss));
   ASSERT_EQ(ss.str(),
             "\n"

Component(s)

C++, Continuous Integration

@kou kou added the Type: bug label Feb 23, 2023
kou added a commit to kou/arrow that referenced this issue Feb 23, 2023
…old g++

    FAILED: src/arrow/CMakeFiles/arrow-array-test.dir/array/array_run_end_test.cc.o
    g++ ... -std=c++17 -c /arrow/cpp/src/arrow/array/array_run_end_test.cc
    /arrow/cpp/src/arrow/array/array_run_end_test.cc: In member
    function 'virtual void
    arrow::{anonymous}::TestRunEndEncodedArray_Printing_Test::TestBody()':
    /arrow/cpp/src/arrow/array/array_run_end_test.cc:580:9: error:
    converting to 'std::__cxx11::basic_stringstream<char>' from
    initializer list would use explicit constructor
    'std::__cxx11::basic_stringstream<
       _CharT,
       _Traits,
       _Alloc
     >::basic_stringstream(std::ios_base::openmode)
     [with _CharT = char;
           _Traits = std::char_traits<char>;
           _Alloc = std::allocator<char>;
            std::ios_base::openmode = std::_Ios_Openmode]' [-Werror]
       ss = {};
             ^
    ...
    cc1plus: all warnings being treated as errors
kou added a commit that referenced this issue Feb 24, 2023
#34317)

### Rationale for this change

Error log:

    FAILED: src/arrow/CMakeFiles/arrow-array-test.dir/array/array_run_end_test.cc.o
    g++ ... -std=c++17 -c /arrow/cpp/src/arrow/array/array_run_end_test.cc
    /arrow/cpp/src/arrow/array/array_run_end_test.cc: In member
    function 'virtual void
    arrow::{anonymous}::TestRunEndEncodedArray_Printing_Test::TestBody()':
    /arrow/cpp/src/arrow/array/array_run_end_test.cc:580:9: error:
    converting to 'std::__cxx11::basic_stringstream<char>' from
    initializer list would use explicit constructor
    'std::__cxx11::basic_stringstream<
       _CharT,
       _Traits,
       _Alloc
     >::basic_stringstream(std::ios_base::openmode)
     [with _CharT = char;
           _Traits = std::char_traits<char>;
           _Alloc = std::allocator<char>;
            std::ios_base::openmode = std::_Ios_Openmode]' [-Werror]
       ss = {};
             ^
    ...
    cc1plus: all warnings being treated as errors

### What changes are included in this PR?

This pull request uses `str("")` instead of `= {}` like other tests.

### Are these changes tested?

Yes.

### Are there any user-facing changes?

No.
* Closes: #34308

Authored-by: Sutou Kouhei <kou@clear-code.com>
Signed-off-by: Sutou Kouhei <kou@clear-code.com>
@kou kou added this to the 12.0.0 milestone Feb 24, 2023
fatemehp pushed a commit to fatemehp/arrow that referenced this issue Feb 24, 2023
…old g++ (apache#34317)

### Rationale for this change

Error log:

    FAILED: src/arrow/CMakeFiles/arrow-array-test.dir/array/array_run_end_test.cc.o
    g++ ... -std=c++17 -c /arrow/cpp/src/arrow/array/array_run_end_test.cc
    /arrow/cpp/src/arrow/array/array_run_end_test.cc: In member
    function 'virtual void
    arrow::{anonymous}::TestRunEndEncodedArray_Printing_Test::TestBody()':
    /arrow/cpp/src/arrow/array/array_run_end_test.cc:580:9: error:
    converting to 'std::__cxx11::basic_stringstream<char>' from
    initializer list would use explicit constructor
    'std::__cxx11::basic_stringstream<
       _CharT,
       _Traits,
       _Alloc
     >::basic_stringstream(std::ios_base::openmode)
     [with _CharT = char;
           _Traits = std::char_traits<char>;
           _Alloc = std::allocator<char>;
            std::ios_base::openmode = std::_Ios_Openmode]' [-Werror]
       ss = {};
             ^
    ...
    cc1plus: all warnings being treated as errors

### What changes are included in this PR?

This pull request uses `str("")` instead of `= {}` like other tests.

### Are these changes tested?

Yes.

### Are there any user-facing changes?

No.
* Closes: apache#34308

Authored-by: Sutou Kouhei <kou@clear-code.com>
Signed-off-by: Sutou Kouhei <kou@clear-code.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant