[问题简述] libfuse-test测试test_examples.pytest_passthrough_hp编译失败,编译报错日志如下: 编译报错日志: [1/2] Compiling C++ object example/passthrough_hp.p/passthrough_hp.cc.o FAILED: example/passthrough_hp.p/passthrough_hp.cc.o clang++ -Iexample/passthrough_hp.p -Iexample -I../example -Iinclude -I../include -Ilib -I../lib -I. -I.. -fcolor-diagnostics -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -O2 -g -D_REENTRANT -DHAVE_CONFIG_H -D_GNU_SOURCE -Wall -Wextra -Wno-sign-compare -std=c++11 -Wmissing-declarations -Wwrite-strings -fno-strict-aliasing -pthread -MD -MQ example/passthrough_hp.p/passthrough_hp.cc.o -MF example/passthrough_hp.p/passthrough_hp.cc.o.d -o example/passthrough_hp.p/passthrough_hp.cc.o -c ../example/passthrough_hp.cc In file included from ../example/passthrough_hp.cc:77: ../example/cxxopts.hpp:488:42: error: no member named 'numeric_limits' in namespace 'std' if (u > static_cast<U>(-std::numeric_limits<T>::min())) ~~~~~^ ../example/cxxopts.hpp:488:57: error: 'T' does not refer to a value if (u > static_cast<U>(-std::numeric_limits<T>::min())) ^ ../example/cxxopts.hpp:479:26: note: declared here template <typename T> ^ ../example/cxxopts.hpp:488:61: error: no member named 'min' in the global namespace if (u > static_cast<U>(-std::numeric_limits<T>::min())) ~~^ ../example/cxxopts.hpp:495:41: error: no member named 'numeric_limits' in namespace 'std' if (u > static_cast<U>(std::numeric_limits<T>::max())) ~~~~~^ ../example/cxxopts.hpp:495:56: error: 'T' does not refer to a value if (u > static_cast<U>(std::numeric_limits<T>::max())) ^ ../example/cxxopts.hpp:479:26: note: declared here template <typename T> ^ ../example/cxxopts.hpp:495:60: error: no member named 'max' in the global namespace if (u > static_cast<U>(std::numeric_limits<T>::max())) ~~^ ../example/cxxopts.hpp:515:29: error: no member named 'numeric_limits' in namespace 'std' SignedCheck<T, std::numeric_limits<T>::is_signed>()(negative, value, text); ~~~~~^ ../example/cxxopts.hpp:515:44: error: 'T' does not refer to a value SignedCheck<T, std::numeric_limits<T>::is_signed>()(negative, value, text); ^ ../example/cxxopts.hpp:511:26: note: declared here template <typename T, typename U> ^ ../example/cxxopts.hpp:515:59: error: expected expression SignedCheck<T, std::numeric_limits<T>::is_signed>()(negative, value, text); ^ ../example/cxxopts.hpp:556:34: error: no member named 'numeric_limits' in namespace 'std' constexpr auto umax = std::numeric_limits<US>::max(); ~~~~~^ ../example/cxxopts.hpp:556:49: error: unexpected type name 'US': expected expression constexpr auto umax = std::numeric_limits<US>::max(); ^ ../example/cxxopts.hpp:556:54: error: no member named 'max' in the global namespace constexpr auto umax = std::numeric_limits<US>::max(); ~~^ ../example/cxxopts.hpp:557:39: error: no member named 'numeric_limits' in namespace 'std' constexpr bool is_signed = std::numeric_limits<T>::is_signed; ~~~~~^ ../example/cxxopts.hpp:557:54: error: 'T' does not refer to a value constexpr bool is_signed = std::numeric_limits<T>::is_signed; ^ ../example/cxxopts.hpp:536:24: note: declared here template <typename T> ^ ../example/cxxopts.hpp:557:56: error: no member named 'is_signed' in the global namespace; did you mean simply 'is_signed'? constexpr bool is_signed = std::numeric_limits<T>::is_signed; ^~~~~~~~~~~ is_signed ../example/cxxopts.hpp:557:22: note: 'is_signed' declared here constexpr bool is_signed = std::numeric_limits<T>::is_signed; ^ ../example/cxxopts.hpp:600:40: error: non-type template argument is not a constant expression std::integral_constant<bool, is_signed>()); ^~~~~~~~~ ../example/cxxopts.hpp:600:40: note: initializer of 'is_signed' is unknown ../example/cxxopts.hpp:557:22: note: declared here constexpr bool is_signed = std::numeric_limits<T>::is_signed; ^ 16 errors generated. ninja: build stopped: subcommand failed. [复验步骤]: git clone https://github.com/libfuse/libfuse.git cd libfuse mkdir build cd build export PATH=/usr/local/bin/:$PATH meson .. ninja-build ninja-build install modprobe fuse modprobe cuse python3 -m pytest test/ [期望结果] case pass [实际结果] 用例编译失败 [测试环境] # uname -r 5.10.134-583.git.ead5e8d2a.an8.x86_64 # cat /proc/cmdline BOOT_IMAGE=(hd0,gpt2)/vmlinuz-5.10.134-583.git.ead5e8d2a.an8.x86_64 root=UUID=16fce93c-18ec-415d-aa04-13b074e4132b ro console=tty0 console=ttyS0,115200 cgroup.memory=nokmem crashkernel=0M-2G:0M,2G-8G:192M,8G-:256M # python -V Python 3.6.8 # yum list python3-pytest Last metadata expiration check: 0:49:44 ago on Fri 24 Feb 2023 01:56:12 PM CST. Installed Packages python3-pytest.noarch 3.4.2-11.el8 @AppStream # yum list meson Last metadata expiration check: 1 day, 4:05:22 ago on Thu 23 Feb 2023 09:43:56 AM CST. Installed Packages meson.noarch 0.58.2-2.an8 @AppStream # yum list ninja-build Last metadata expiration check: 1 day, 4:05:41 ago on Thu 23 Feb 2023 09:43:56 AM CST. Installed Packages ninja-build.x86_64 1.8.2-1.0.1.an8 @AppStream # yum list clang Last metadata expiration check: 1 day, 4:05:52 ago on Thu 23 Feb 2023 09:43:56 AM CST. Installed Packages clang.x86_64 13.0.1-2.0.2.module+an8.7.0+10996+1588f068 @AppStream [出现频率] 必现 [原因分析]: 该用例原来一直都是pass的,使用的clang包13.0.1-2.0.1,最近升级clang包到13.0.1-2.0.2之后出现了编译失败,疑似新的clang包跟用例不兼容导致。
这个问题在an8 5.10.134-14_rc1机器上也是存在的。
麻烦帮忙确认一下是不是clang包到13.0.1-2.0.2之后引入的问题。
# yum list meson Failed to set locale, defaulting to C.UTF-8 Last metadata expiration check: 0:12:46 ago on Mon Mar 6 11:09:28 2023. Installed Packages meson.noarch 0.58.2-2.an8 @AppStream # yum list ninja-build Failed to set locale, defaulting to C.UTF-8 Last metadata expiration check: 0:12:53 ago on Mon Mar 6 11:09:28 2023. Installed Packages ninja-build.x86_64 1.8.2-1.0.1.an8 @AppStream [root@iZ0jl51utxqd6gypbts8lyZ build]# yum list clang Failed to set locale, defaulting to C.UTF-8 Last metadata expiration check: 0:12:56 ago on Mon Mar 6 11:09:28 2023. Installed Packages clang.x86_64 13.0.1-2.0.2.module+an8.7.0+10996+1588f068 @AppStream
使用最新的 clang 13.0.1-2.0.2.module+an8.7.0+10996+1588f068 可以编译成功,没有复现
跟Xu Jingbo沟通了一下,又重新尝试了几次,找到了问题复现的规律,经排查真正编译失败的原因是机器缺少gcc-c++和libstdc++-devel包,安装了之后编译成功,删除之后会编译失败,且报错与该bug单一样;只是原来报错信息中的clang打印造成了一定的误导,又恰好机器上的clang做了升级的动作,所以综合分析下来与clang的升级无关,只是缺少包导致的,非问题,该bug单关闭