Bug #113123 | Compilation fails with LLVM 17 and XCode 15.3 | ||
---|---|---|---|
Submitted: | 17 Nov 2023 14:09 | Modified: | 3 Jul 9:43 |
Reporter: | Laurynas Biveinis (OCA) | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Compiling | Severity: | S3 (Non-critical) |
Version: | 8.0.37, 8.4.0 | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[17 Nov 2023 14:09]
Laurynas Biveinis
[17 Nov 2023 14:12]
Laurynas Biveinis
FAILED: unittest/gunit/CMakeFiles/merge_small_tests-t.dir/mem_root_deque-t.cc.o /opt/homebrew/opt/llvm@17/bin/clang++ -DBOOST_NO_CXX98_FUNCTION_BASE -DDATA_DIR=\"/Users/laurynas/vilniusdb/mysql-8.0.35/_build-debug-llvm-17/unittest/gunit\" -DDISABLE_PSI_COND -DDISABLE_PSI_FILE -DDISABLE_PSI_MEMORY -DDISABLE_PSI_METADATA -DDISABLE_PSI_MUTEX -DDISABLE_PSI_RWLOCK -DDISABLE_PSI_STAGE -DERRMSG_DIR=\"/Users/laurynas/vilniusdb/mysql-8.0.35/_build-debug-llvm-17/share\" -DEXTRA_CODE_FOR_UNIT_TESTING -DHAVE_CONFIG_H -DHAVE_TLSv13 -DLZ4_DISABLE_DEPRECATE_WARNINGS -DMYSQL_SERVER -DRAPIDJSON_NO_SIZETYPEDEFINE -DRAPIDJSON_SCHEMA_USE_INTERNALREGEX=0 -DRAPIDJSON_SCHEMA_USE_STDREGEX=1 -D_USE_MATH_DEFINES -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/Users/laurynas/vilniusdb/mysql-8.0.35/_build-debug-llvm-17 -I/Users/laurynas/vilniusdb/mysql-8.0.35/_build-debug-llvm-17/include -I/Users/laurynas/vilniusdb/mysql-8.0.35 -I/Users/laurynas/vilniusdb/mysql-8.0.35/include -isystem /Users/laurynas/vilniusdb/mysql-8.0.35/extra/rapidjson/include -isystem /opt/homebrew/opt/openssl@1.1/include -isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/usr/include/editline -isystem /opt/homebrew/include -isystem /Users/laurynas/vilniusdb/mysql-8.0.35/include/boost_1_77_0/patches -isystem /Users/laurynas/vilniusdb/mysql-boost/boost_1_77_0 -isystem /Users/laurynas/vilniusdb/mysql-8.0.35/extra/googletest/googletest-release-1.12.0/googlemock -isystem /Users/laurynas/vilniusdb/mysql-8.0.35/extra/googletest/googletest-release-1.12.0/googlemock/include -isystem /Users/laurynas/vilniusdb/mysql-8.0.35/extra/googletest/googletest-release-1.12.0/googletest -isystem /Users/laurynas/vilniusdb/mysql-8.0.35/extra/googletest/googletest-release-1.12.0/googletest/include -isystem /Users/laurynas/vilniusdb/mysql-8.0.35/extra/zlib/zlib-1.2.13 -isystem /Users/laurynas/vilniusdb/mysql-8.0.35/_build-debug-llvm-17/extra/zlib/zlib-1.2.13 -std=c++17 -fno-omit-frame-pointer -ftls-model=initial-exec -ffp-contract=off -Wall -Wextra -Wformat-security -Wvla -Wundef -Wmissing-format-attribute -Woverloaded-virtual -Wcast-qual -Wno-null-conversion -Wno-unused-private-field -Wconditional-uninitialized -Wdeprecated -Wno-deprecated-declarations -Wno-shorten-64-to-32 -Wextra-semi -Wheader-hygiene -Wnon-virtual-dtor -Wundefined-reinterpret-cast -Wrange-loop-analysis -Winconsistent-missing-destructor-override -Winconsistent-missing-override -Wshadow-field -Werror -DSAFE_MUTEX -DENABLED_DEBUG_SYNC -ffp-contract=off -g -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk -fPIE -fcolor-diagnostics -Wshadow-uncaptured-local -MD -MT unittest/gunit/CMakeFiles/merge_small_tests-t.dir/mem_root_deque-t.cc.o -MF unittest/gunit/CMakeFiles/merge_small_tests-t.dir/mem_root_deque-t.cc.o.d --language=c++ -o unittest/gunit/CMakeFiles/merge_small_tests-t.dir/mem_root_deque-t.cc.o -c /Users/laurynas/vilniusdb/mysql-8.0.35/unittest/gunit/mem_root_deque-t.cc In file included from /Users/laurynas/vilniusdb/mysql-8.0.35/unittest/gunit/mem_root_deque-t.cc:25: In file included from /Users/laurynas/vilniusdb/mysql-8.0.35/extra/googletest/googletest-release-1.12.0/googlemock/include/gmock/gmock.h:56: In file included from /Users/laurynas/vilniusdb/mysql-8.0.35/extra/googletest/googletest-release-1.12.0/googlemock/include/gmock/gmock-actions.h:137: In file included from /opt/homebrew/opt/llvm@17/bin/../include/c++/v1/algorithm:1803: In file included from /opt/homebrew/opt/llvm@17/bin/../include/c++/v1/__algorithm/nth_element.h:15: /opt/homebrew/opt/llvm@17/bin/../include/c++/v1/__algorithm/sort.h:289:52: error: invalid operands to binary expression ('const mem_root_deque<std::string>::Iterator<std::string>' and 'difference_type' (aka 'long')) 289 | const _RandomAccessIterator __leftmost = __first - difference_type(1); (void)__leftmost; // can be unused when assertions are disabled | ~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~ ... /Users/laurynas/vilniusdb/mysql-8.0.35/unittest/gunit/mem_root_deque-t.cc:109:8: note: in instantiation of function template specialization 'std::sort<mem_root_deque<std::string>::Iterator<std::string>>' requested here 109 | std::sort(d.begin(), d.end()); | ^ ... /Users/laurynas/vilniusdb/mysql-8.0.35/include/mem_root_deque.h:387:14: note: candidate function not viable: 'this' argument has type 'const mem_root_deque<std::string>::Iterator<std::string>', but method is not marked const 387 | Iterator operator-(difference_type offset) { | ^
[17 Nov 2023 14:13]
Laurynas Biveinis
/opt/homebrew/opt/llvm@17/bin/../include/c++/v1/__algorithm/sort.h:290:44: error: invalid operands to binary expression ('const mem_root_deque<std::string>::Iterator<std::string>' and 'difference_type' (aka 'long')) 290 | for (_RandomAccessIterator __i = __first + difference_type(1); __i != __last; ++__i) { | ~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~ ... /Users/laurynas/vilniusdb/mysql-8.0.35/include/mem_root_deque.h:382:14: note: candidate function not viable: 'this' argument has type 'const mem_root_deque<std::string>::Iterator<std::string>', but method is not marked const 382 | Iterator operator+(difference_type offset) { | ^
[17 Nov 2023 14:13]
Laurynas Biveinis
/Users/laurynas/vilniusdb/mysql-8.0.35/unittest/gunit/strings_utf8-t.cc:200:26: error: identifier '_sl' preceded by whitespace in a literal operator declaration is deprecated [-Werror,-Wdeprecated-literal-operator] 200 | StringLiteral operator"" _sl(const char *ptr, size_t size) { | ~~~~~~~~~~~^~~ | operator""_sl
[17 Nov 2023 14:13]
Laurynas Biveinis
/Users/laurynas/vilniusdb/mysql-8.0.35/unittest/gunit/libmysqlgcs/xcom/gcs_xcom_control_interface-t.cc:1214:17: error: reference cannot be bound to dereferenced null pointer in well-defined C++ code; comparison may be assumed to always evaluate to true [-Werror,-Wtautological-undefined-compare] 1214 | ASSERT_TRUE((¤t_view_id) != nullptr); | ^~~~~~~~~~~~~~~ ~~~~~~~
[17 Nov 2023 14:24]
Laurynas Biveinis
Bug 113123 fix for 8.0.35 (*) I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.
Contribution: bug113123-8.0.35.patch (application/octet-stream, text), 1.71 KiB.
[17 Nov 2023 16:41]
MySQL Verification Team
Hi Mr. Biveinis, Thank you for your bug report. We have attempted to build MySQL on macOS Sonoma from Cellar, with LLVM 17.0.5 and we have got the same errors. Verified as described. Thank you for your patch.
[28 Nov 2023 14:25]
Laurynas Biveinis
The exact same errors occur on 8.2.0, and the exact same patch fixes them there.
[28 Nov 2023 14:29]
MySQL Verification Team
Hi Laurynas, This is just to inform you that this bug report was already verified for 8.0, 8.1 and 8.2 !!!!! Hence, there is nothing else necessary to do about this.
[29 Nov 2023 20:45]
Laurynas Biveinis
That's awesome, but neither me nor the Verification Team posted anything about 8.1 nor 8.2 versions before
[22 Jan 12:43]
Laurynas Biveinis
At least the first two errors are still present on 8.0.36.
[22 Jan 13:08]
MySQL Verification Team
Thank you, Mr. Beiveinis. Since this bug is not fixed yet, this was actually expected.
[4 May 17:58]
Laurynas Biveinis
Same error on 8.0.37, but now with XCode too, meaning that MySQL 8.0.37 is unbuildable with the current macOS toolchain: $ clang --version Apple clang version 15.0.0 (clang-1500.3.9.4) Target: arm64-apple-darwin23.4.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
[4 May 18:00]
Laurynas Biveinis
Editing the title accordingly
[6 May 7:44]
Laurynas Biveinis
Same with 8.4.0
[9 May 9:34]
MySQL Verification Team
Hi Mr. Biveinis, We use our own command-line versions for the building, but there are still problems on the ARM. Regarding XCode GUI we do not use it very much, which is one of the reasons why this report is verified.
[9 May 9:39]
Laurynas Biveinis
I never said anything about GUI. It is the command-line XCode toolchain I am using.
[9 May 9:46]
MySQL Verification Team
Sorry, Lapsus lingaue ........ We use cmake command line version ........ But, yes, this is still a bug, albeit a fully verified one.
[28 May 13:58]
Laurynas Biveinis
Bug 113123 fix for 8.4.0 (*) I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.
Contribution: bug113123-8.4.0.patch (application/octet-stream, text), 931 bytes.
[28 May 13:58]
Laurynas Biveinis
Only mem_root_deque.h patch is needed for 8.4.0
[28 May 14:01]
MySQL Verification Team
Thank you , very much, Laurynas.
[3 Jun 17:02]
Tor Didriksen
you cannot expect older mysql versions (8.0.x) to build warning-free with bleeding-edge compilers. We are currently upgrading to clang 18 on linux, and have seen the same warnings in 8.4, fixed internally. I will have a look and see what needs to be backported to 8.0 In general we only backport critical bugfixes. A broken build with -Werror is imho not critical.
[4 Jun 10:06]
MySQL Verification Team
Thank you, Tor.
[4 Jun 10:37]
Laurynas Biveinis
I am very happy to add "-Wno-..." options for newer compilers on older versions, but please note that it's a hard error in this case with no -Wno- option. Please also note that the proposed fixes appear to be very low-risk too.
[2 Jul 3:43]
Laurynas Biveinis
8.0.38 builds with LLVM 17 and with XCode 15.3 successfully
[2 Jul 9:19]
MySQL Verification Team
Hi Mr. Biveinis, Thank you for the feedback. That means that this bug can be closed. We will not close it without your approval.
[3 Jul 4:31]
Laurynas Biveinis
8.4.1 and 9.0.0 build with XCode 15.3 fine (9.0.0 needs -Wno-unused-lambda-capture) This bug is OK to close, thank you!
[3 Jul 9:43]
MySQL Verification Team
Thank you Mr. Biveinis, This bug report is now closed.