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

wlcs,mir_2_15: Fix GCC 14 compat #368425

Merged
merged 2 commits into from
Dec 27, 2024
Merged

Conversation

OPNA2608
Copy link
Contributor

wlcs:

  • Fetch upstream patch to partially fix GCC 14 compat
  • Force -O2 to fix issue with std::function in tests
    I do not pretend to even comprehend what's going on there, so I'll just attach the full error and state that enforcing -O0 - -O2 makes the issue go away, and forcing -O3 makes it re-appear. Maybe a regression in GCC?
Welcome to C++ hell
[ 39%] Building CXX object CMakeFiles/wlcs.asan.dir/tests/xdg_popup.cpp.o
In file included from /nix/store/l89iqc7am6i60y8vk507zwrzxf0wcd3v-gcc-14-20241116/include/c++/14-20241116/functional:59,
                 from /nix/store/jjk5d24nfk0z87cg78cv5mzy2yj5z2fa-gtest-1.15.2-dev/include/gtest/gtest-matchers.h:43,
                 from /nix/store/jjk5d24nfk0z87cg78cv5mzy2yj5z2fa-gtest-1.15.2-dev/include/gtest/internal/gtest-death-test-internal.h:47,
                 from /nix/store/jjk5d24nfk0z87cg78cv5mzy2yj5z2fa-gtest-1.15.2-dev/include/gtest/gtest-death-test.h:43,
                 from /nix/store/jjk5d24nfk0z87cg78cv5mzy2yj5z2fa-gtest-1.15.2-dev/include/gtest/gtest.h:64,
                 from /build/source/include/in_process_server.h:26,
                 from /build/source/tests/xdg_popup.cpp:29:
In constructor 'std::function<_Res(_ArgTypes ...)>::function(std::function<_Res(_ArgTypes ...)>&&) [with _Res = std::pair<int, int>; _ArgTypes = {int, int}]',
    inlined from 'constexpr void std::_Construct(_Tp*, _Args&& ...) [with _Tp = function<pair<int, int>(int, int)>; _Args = {function<pair<int, int>(int, int)>}]' at /nix/store/l89iqc7am6i60y8vk507zwrzxf0wcd3v-gcc-14-20241116/include/c++/14-20241116/bits/stl_construct.h:119:7,
    inlined from 'constexpr void std::_Optional_payload_base<_Tp>::_M_construct(_Args&& ...) [with _Args = {std::function<std::pair<int, int>(int, int)>}; _Tp = std::function<std::pair<int, int>(int, int)>]' at /nix/store/l89iqc7am6i60y8vk507zwrzxf0wcd3v-gcc-14-20241116/include/c++/14-20241116/optional:274:19,
    inlined from 'constexpr std::_Optional_payload_base<_Tp>::_Optional_payload_base(bool, std::_Optional_payload_base<_Tp>&&) [with _Tp = std::function<std::pair<int, int>(int, int)>]' at /nix/store/l89iqc7am6i60y8vk507zwrzxf0wcd3v-gcc-14-20241116/include/c++/14-20241116/optional:151:22,
    inlined from 'constexpr std::_Optional_payload_base<_Tp>::_Optional_payload_base(bool, std::_Optional_payload_base<_Tp>&&) [with _Tp = std::function<std::pair<int, int>(int, int)>]' at /nix/store/l89iqc7am6i60y8vk507zwrzxf0wcd3v-gcc-14-20241116/include/c++/14-20241116/optional:147:7,
    inlined from 'constexpr std::_Optional_payload<std::function<std::pair<int, int>(int, int)>, true, false, false>::_Optional_payload(bool, std::_Optional_payload_base<std::function<std::pair<int, int>(int, int)> >&&) [inherited from std::_Optional_payload_base<std::function<std::pair<int, int>(int, int)> >]' at /nix/store/l89iqc7am6i60y8vk507zwrzxf0wcd3v-gcc-14-20241116/include/c++/14-20241116/optional:395:42,
    inlined from 'constexpr std::_Optional_payload<std::function<std::pair<int, int>(int, int)>, false, false, false>::_Optional_payload(bool, std::_Optional_payload_base<std::function<std::pair<int, int>(int, int)> >&&) [inherited from std::_Optional_payload_base<std::function<std::pair<int, int>(int, int)> >]' at /nix/store/l89iqc7am6i60y8vk507zwrzxf0wcd3v-gcc-14-20241116/include/c++/14-20241116/optional:429:57,
    inlined from 'constexpr std::_Optional_base<_Tp, <anonymous>, <anonymous> >::_Optional_base(std::_Optional_base<_Tp, <anonymous>, <anonymous> >&&) [with _Tp = std::function<std::pair<int, int>(int, int)>; bool <anonymous> = false; bool <anonymous> = false]' at /nix/store/l89iqc7am6i60y8vk507zwrzxf0wcd3v-gcc-14-20241116/include/c++/14-20241116/optional:542:9,
    inlined from 'constexpr std::optional<std::function<std::pair<int, int>(int, int)> >::optional(std::optional<std::function<std::pair<int, int>(int, int)> >&&)' at /nix/store/l89iqc7am6i60y8vk507zwrzxf0wcd3v-gcc-14-20241116/include/c++/14-20241116/optional:703:11,
    inlined from 'constexpr {anonymous}::PositionerTestParams::PositionerTestParams({anonymous}::PositionerTestParams&&)' at /build/source/tests/xdg_popup.cpp:132:8,
    inlined from 'testing::internal::ValueArray<T ...> testing::Values(T ...) [with T = {{anonymous}::PositionerTestParams}]' at /nix/store/jjk5d24nfk0z87cg78cv5mzy2yj5z2fa-gtest-1.15.2-dev/include/gtest/gtest-param-test.h:336:20,
    inlined from 'std::string gtest_DefaultXdgPopupPositionerTest_EvalGenerateName_(const testing::TestParamInfo<{anonymous}::PositionerTestParams>&)' at /build/source/tests/xdg_popup.cpp:733:1:
/nix/store/l89iqc7am6i60y8vk507zwrzxf0wcd3v-gcc-14-20241116/include/c++/14-20241116/bits/std_function.h:405:42: error: '*(std::function<std::pair<int, int>(int, int)>*)((char*)&<unnamed> + offsetof(<unnamed>::PositionerTestParams, <unnamed>::PositionerTestParams::parent_position_func.std::optional<std::function<std::pair<int, int>(int, int)> >::<unnamed>.std::_Optional_base<std::function<std::pair<int, int>(int, int)>, false, false>::<unnamed>)).std::function<std::pair<int, int>(int, int)>::_M_invoker' may be used uninitialized [8;;https://gcc.gnu.org/onlinedocs/gcc-14.2.0/gcc/Warning-Options.html#index-Wmaybe-uninitialized-Werror=maybe-uninitialized8;;]
  405 |       : _Function_base(), _M_invoker(__x._M_invoker)
      |                                      ~~~~^~~~~~~~~~
In file included from /nix/store/jjk5d24nfk0z87cg78cv5mzy2yj5z2fa-gtest-1.15.2-dev/include/gtest/gtest.h:67:
/build/source/tests/xdg_popup.cpp: In function 'std::string gtest_DefaultXdgPopupPositionerTest_EvalGenerateName_(const testing::TestParamInfo<{anonymous}::PositionerTestParams>&)':
/build/source/tests/xdg_popup.cpp:737:136: note: '<anonymous>' declared here
  737 |         PositionerTestParams{"default values", (window_width - popup_width) / 2, (window_height - popup_height) / 2, PositionerParams()}
      |                                                                                                                                        ^
In member function 'bool std::_Function_base::_M_empty() const',
    inlined from 'std::function<_Res(_ArgTypes ...)>::operator bool() const [with _Res = std::pair<int, int>; _ArgTypes = {int, int}]' at /nix/store/l89iqc7am6i60y8vk507zwrzxf0wcd3v-gcc-14-20241116/include/c++/14-20241116/bits/std_function.h:574:25,
    inlined from 'std::function<_Res(_ArgTypes ...)>::function(std::function<_Res(_ArgTypes ...)>&&) [with _Res = std::pair<int, int>; _ArgTypes = {int, int}]' at /nix/store/l89iqc7am6i60y8vk507zwrzxf0wcd3v-gcc-14-20241116/include/c++/14-20241116/bits/std_function.h:407:6,
    inlined from 'constexpr void std::_Construct(_Tp*, _Args&& ...) [with _Tp = function<pair<int, int>(int, int)>; _Args = {function<pair<int, int>(int, int)>}]' at /nix/store/l89iqc7am6i60y8vk507zwrzxf0wcd3v-gcc-14-20241116/include/c++/14-20241116/bits/stl_construct.h:119:7,
    inlined from 'constexpr void std::_Optional_payload_base<_Tp>::_M_construct(_Args&& ...) [with _Args = {std::function<std::pair<int, int>(int, int)>}; _Tp = std::function<std::pair<int, int>(int, int)>]' at /nix/store/l89iqc7am6i60y8vk507zwrzxf0wcd3v-gcc-14-20241116/include/c++/14-20241116/optional:274:19,
    inlined from 'constexpr std::_Optional_payload_base<_Tp>::_Optional_payload_base(bool, std::_Optional_payload_base<_Tp>&&) [with _Tp = std::function<std::pair<int, int>(int, int)>]' at /nix/store/l89iqc7am6i60y8vk507zwrzxf0wcd3v-gcc-14-20241116/include/c++/14-20241116/optional:151:22,
    inlined from 'constexpr std::_Optional_payload_base<_Tp>::_Optional_payload_base(bool, std::_Optional_payload_base<_Tp>&&) [with _Tp = std::function<std::pair<int, int>(int, int)>]' at /nix/store/l89iqc7am6i60y8vk507zwrzxf0wcd3v-gcc-14-20241116/include/c++/14-20241116/optional:147:7,
    inlined from 'constexpr std::_Optional_payload<std::function<std::pair<int, int>(int, int)>, true, false, false>::_Optional_payload(bool, std::_Optional_payload_base<std::function<std::pair<int, int>(int, int)> >&&) [inherited from std::_Optional_payload_base<std::function<std::pair<int, int>(int, int)> >]' at /nix/store/l89iqc7am6i60y8vk507zwrzxf0wcd3v-gcc-14-20241116/include/c++/14-20241116/optional:395:42,
    inlined from 'constexpr std::_Optional_payload<std::function<std::pair<int, int>(int, int)>, false, false, false>::_Optional_payload(bool, std::_Optional_payload_base<std::function<std::pair<int, int>(int, int)> >&&) [inherited from std::_Optional_payload_base<std::function<std::pair<int, int>(int, int)> >]' at /nix/store/l89iqc7am6i60y8vk507zwrzxf0wcd3v-gcc-14-20241116/include/c++/14-20241116/optional:429:57,
    inlined from 'constexpr std::_Optional_base<_Tp, <anonymous>, <anonymous> >::_Optional_base(std::_Optional_base<_Tp, <anonymous>, <anonymous> >&&) [with _Tp = std::function<std::pair<int, int>(int, int)>; bool <anonymous> = false; bool <anonymous> = false]' at /nix/store/l89iqc7am6i60y8vk507zwrzxf0wcd3v-gcc-14-20241116/include/c++/14-20241116/optional:542:9,
    inlined from 'constexpr std::optional<std::function<std::pair<int, int>(int, int)> >::optional(std::optional<std::function<std::pair<int, int>(int, int)> >&&)' at /nix/store/l89iqc7am6i60y8vk507zwrzxf0wcd3v-gcc-14-20241116/include/c++/14-20241116/optional:703:11,
    inlined from 'constexpr {anonymous}::PositionerTestParams::PositionerTestParams({anonymous}::PositionerTestParams&&)' at /build/source/tests/xdg_popup.cpp:132:8,
    inlined from 'testing::internal::ValueArray<T ...> testing::Values(T ...) [with T = {{anonymous}::PositionerTestParams}]' at /nix/store/jjk5d24nfk0z87cg78cv5mzy2yj5z2fa-gtest-1.15.2-dev/include/gtest/gtest-param-test.h:336:20,
    inlined from 'std::string gtest_DefaultXdgPopupPositionerTest_EvalGenerateName_(const testing::TestParamInfo<{anonymous}::PositionerTestParams>&)' at /build/source/tests/xdg_popup.cpp:733:1:
/nix/store/l89iqc7am6i60y8vk507zwrzxf0wcd3v-gcc-14-20241116/include/c++/14-20241116/bits/std_function.h:247:37: error: '*(const std::_Function_base*)((char*)&<unnamed> + offsetof(<unnamed>::PositionerTestParams, <unnamed>::PositionerTestParams::parent_position_func.std::optional<std::function<std::pair<int, int>(int, int)> >::<unnamed>.std::_Optional_base<std::function<std::pair<int, int>(int, int)>, false, false>::<unnamed>)).std::_Function_base::_M_manager' may be used uninitialized [8;;https://gcc.gnu.org/onlinedocs/gcc-14.2.0/gcc/Warning-Options.html#index-Wmaybe-uninitialized-Werror=maybe-uninitialized8;;]
  247 |     bool _M_empty() const { return !_M_manager; }
      |                                     ^~~~~~~~~~
/build/source/tests/xdg_popup.cpp: In function 'std::string gtest_DefaultXdgPopupPositionerTest_EvalGenerateName_(const testing::TestParamInfo<{anonymous}::PositionerTestParams>&)':
/build/source/tests/xdg_popup.cpp:737:136: note: '<anonymous>' declared here
  737 |         PositionerTestParams{"default values", (window_width - popup_width) / 2, (window_height - popup_height) / 2, PositionerParams()}
      |                                                                                                                                        ^
In constructor 'std::function<_Res(_ArgTypes ...)>::function(std::function<_Res(_ArgTypes ...)>&&) [with _Res = std::pair<int, int>; _ArgTypes = {int, int}]',
    inlined from 'constexpr void std::_Construct(_Tp*, _Args&& ...) [with _Tp = function<pair<int, int>(int, int)>; _Args = {function<pair<int, int>(int, int)>}]' at /nix/store/l89iqc7am6i60y8vk507zwrzxf0wcd3v-gcc-14-20241116/include/c++/14-20241116/bits/stl_construct.h:119:7,
    inlined from 'constexpr void std::_Optional_payload_base<_Tp>::_M_construct(_Args&& ...) [with _Args = {std::function<std::pair<int, int>(int, int)>}; _Tp = std::function<std::pair<int, int>(int, int)>]' at /nix/store/l89iqc7am6i60y8vk507zwrzxf0wcd3v-gcc-14-20241116/include/c++/14-20241116/optional:274:19,
    inlined from 'constexpr std::_Optional_payload_base<_Tp>::_Optional_payload_base(bool, std::_Optional_payload_base<_Tp>&&) [with _Tp = std::function<std::pair<int, int>(int, int)>]' at /nix/store/l89iqc7am6i60y8vk507zwrzxf0wcd3v-gcc-14-20241116/include/c++/14-20241116/optional:151:22,
    inlined from 'constexpr std::_Optional_payload_base<_Tp>::_Optional_payload_base(bool, std::_Optional_payload_base<_Tp>&&) [with _Tp = std::function<std::pair<int, int>(int, int)>]' at /nix/store/l89iqc7am6i60y8vk507zwrzxf0wcd3v-gcc-14-20241116/include/c++/14-20241116/optional:147:7,
    inlined from 'constexpr std::_Optional_payload<std::function<std::pair<int, int>(int, int)>, true, false, false>::_Optional_payload(bool, std::_Optional_payload_base<std::function<std::pair<int, int>(int, int)> >&&) [inherited from std::_Optional_payload_base<std::function<std::pair<int, int>(int, int)> >]' at /nix/store/l89iqc7am6i60y8vk507zwrzxf0wcd3v-gcc-14-20241116/include/c++/14-20241116/optional:395:42,
    inlined from 'constexpr std::_Optional_payload<std::function<std::pair<int, int>(int, int)>, false, false, false>::_Optional_payload(bool, std::_Optional_payload_base<std::function<std::pair<int, int>(int, int)> >&&) [inherited from std::_Optional_payload_base<std::function<std::pair<int, int>(int, int)> >]' at /nix/store/l89iqc7am6i60y8vk507zwrzxf0wcd3v-gcc-14-20241116/include/c++/14-20241116/optional:429:57,
    inlined from 'constexpr std::_Optional_base<_Tp, <anonymous>, <anonymous> >::_Optional_base(std::_Optional_base<_Tp, <anonymous>, <anonymous> >&&) [with _Tp = std::function<std::pair<int, int>(int, int)>; bool <anonymous> = false; bool <anonymous> = false]' at /nix/store/l89iqc7am6i60y8vk507zwrzxf0wcd3v-gcc-14-20241116/include/c++/14-20241116/optional:542:9,
    inlined from 'constexpr std::optional<std::function<std::pair<int, int>(int, int)> >::optional(std::optional<std::function<std::pair<int, int>(int, int)> >&&)' at /nix/store/l89iqc7am6i60y8vk507zwrzxf0wcd3v-gcc-14-20241116/include/c++/14-20241116/optional:703:11,
    inlined from 'constexpr {anonymous}::PositionerTestParams::PositionerTestParams({anonymous}::PositionerTestParams&&)' at /build/source/tests/xdg_popup.cpp:132:8,
    inlined from 'testing::internal::ValueArray<T ...> testing::Values(T ...) [with T = {{anonymous}::PositionerTestParams}]' at /nix/store/jjk5d24nfk0z87cg78cv5mzy2yj5z2fa-gtest-1.15.2-dev/include/gtest/gtest-param-test.h:336:20,
    inlined from 'std::string gtest_DefaultXdgPopupPositionerTest_EvalGenerateName_(const testing::TestParamInfo<{anonymous}::PositionerTestParams>&)' at /build/source/tests/xdg_popup.cpp:733:1:
/nix/store/l89iqc7am6i60y8vk507zwrzxf0wcd3v-gcc-14-20241116/include/c++/14-20241116/bits/std_function.h:409:13: error: '*(const std::_Any_data*)((char*)&<unnamed> + offsetof(<unnamed>::PositionerTestParams, <unnamed>::PositionerTestParams::parent_position_func.std::optional<std::function<std::pair<int, int>(int, int)> >::<unnamed>.std::_Optional_base<std::function<std::pair<int, int>(int, int)>, false, false>::<unnamed>))' may be used uninitialized [8;;https://gcc.gnu.org/onlinedocs/gcc-14.2.0/gcc/Warning-Options.html#index-Wmaybe-uninitialized-Werror=maybe-uninitialized8;;]
  409 |             _M_functor = __x._M_functor;
      |             ^~~~~~~~~~
/build/source/tests/xdg_popup.cpp: In function 'std::string gtest_DefaultXdgPopupPositionerTest_EvalGenerateName_(const testing::TestParamInfo<{anonymous}::PositionerTestParams>&)':
/build/source/tests/xdg_popup.cpp:737:136: note: '<anonymous>' declared here
  737 |         PositionerTestParams{"default values", (window_width - popup_width) / 2, (window_height - popup_height) / 2, PositionerParams()}
      |                                                                                                                                        ^
In constructor 'std::function<_Res(_ArgTypes ...)>::function(std::function<_Res(_ArgTypes ...)>&&) [with _Res = std::pair<int, int>; _ArgTypes = {int, int}]',
    inlined from 'constexpr void std::_Construct(_Tp*, _Args&& ...) [with _Tp = function<pair<int, int>(int, int)>; _Args = {function<pair<int, int>(int, int)>}]' at /nix/store/l89iqc7am6i60y8vk507zwrzxf0wcd3v-gcc-14-20241116/include/c++/14-20241116/bits/stl_construct.h:119:7,
    inlined from 'constexpr void std::_Optional_payload_base<_Tp>::_M_construct(_Args&& ...) [with _Args = {std::function<std::pair<int, int>(int, int)>}; _Tp = std::function<std::pair<int, int>(int, int)>]' at /nix/store/l89iqc7am6i60y8vk507zwrzxf0wcd3v-gcc-14-20241116/include/c++/14-20241116/optional:274:19,
    inlined from 'constexpr std::_Optional_payload_base<_Tp>::_Optional_payload_base(bool, std::_Optional_payload_base<_Tp>&&) [with _Tp = std::function<std::pair<int, int>(int, int)>]' at /nix/store/l89iqc7am6i60y8vk507zwrzxf0wcd3v-gcc-14-20241116/include/c++/14-20241116/optional:151:22,
    inlined from 'constexpr std::_Optional_payload_base<_Tp>::_Optional_payload_base(bool, std::_Optional_payload_base<_Tp>&&) [with _Tp = std::function<std::pair<int, int>(int, int)>]' at /nix/store/l89iqc7am6i60y8vk507zwrzxf0wcd3v-gcc-14-20241116/include/c++/14-20241116/optional:147:7,
    inlined from 'constexpr std::_Optional_payload<std::function<std::pair<int, int>(int, int)>, true, false, false>::_Optional_payload(bool, std::_Optional_payload_base<std::function<std::pair<int, int>(int, int)> >&&) [inherited from std::_Optional_payload_base<std::function<std::pair<int, int>(int, int)> >]' at /nix/store/l89iqc7am6i60y8vk507zwrzxf0wcd3v-gcc-14-20241116/include/c++/14-20241116/optional:395:42,
    inlined from 'constexpr std::_Optional_payload<std::function<std::pair<int, int>(int, int)>, false, false, false>::_Optional_payload(bool, std::_Optional_payload_base<std::function<std::pair<int, int>(int, int)> >&&) [inherited from std::_Optional_payload_base<std::function<std::pair<int, int>(int, int)> >]' at /nix/store/l89iqc7am6i60y8vk507zwrzxf0wcd3v-gcc-14-20241116/include/c++/14-20241116/optional:429:57,
    inlined from 'constexpr std::_Optional_base<_Tp, <anonymous>, <anonymous> >::_Optional_base(std::_Optional_base<_Tp, <anonymous>, <anonymous> >&&) [with _Tp = std::function<std::pair<int, int>(int, int)>; bool <anonymous> = false; bool <anonymous> = false]' at /nix/store/l89iqc7am6i60y8vk507zwrzxf0wcd3v-gcc-14-20241116/include/c++/14-20241116/optional:542:9,
    inlined from 'constexpr std::optional<std::function<std::pair<int, int>(int, int)> >::optional(std::optional<std::function<std::pair<int, int>(int, int)> >&&)' at /nix/store/l89iqc7am6i60y8vk507zwrzxf0wcd3v-gcc-14-20241116/include/c++/14-20241116/optional:703:11,
    inlined from 'constexpr {anonymous}::PositionerTestParams::PositionerTestParams({anonymous}::PositionerTestParams&&)' at /build/source/tests/xdg_popup.cpp:132:8,
    inlined from 'testing::internal::ValueArray<T ...> testing::Values(T ...) [with T = {{anonymous}::PositionerTestParams}]' at /nix/store/jjk5d24nfk0z87cg78cv5mzy2yj5z2fa-gtest-1.15.2-dev/include/gtest/gtest-param-test.h:336:20,
    inlined from 'testing::internal::ParamGenerator<{anonymous}::PositionerTestParams> gtest_DefaultXdgPopupPositionerTest_EvalGenerator_()' at /build/source/tests/xdg_popup.cpp:733:1:
/nix/store/l89iqc7am6i60y8vk507zwrzxf0wcd3v-gcc-14-20241116/include/c++/14-20241116/bits/std_function.h:405:42: error: '*(std::function<std::pair<int, int>(int, int)>*)((char*)&<unnamed> + offsetof(<unnamed>::PositionerTestParams, <unnamed>::PositionerTestParams::parent_position_func.std::optional<std::function<std::pair<int, int>(int, int)> >::<unnamed>.std::_Optional_base<std::function<std::pair<int, int>(int, int)>, false, false>::<unnamed>)).std::function<std::pair<int, int>(int, int)>::_M_invoker' may be used uninitialized [8;;https://gcc.gnu.org/onlinedocs/gcc-14.2.0/gcc/Warning-Options.html#index-Wmaybe-uninitialized-Werror=maybe-uninitialized8;;]
  405 |       : _Function_base(), _M_invoker(__x._M_invoker)
      |                                      ~~~~^~~~~~~~~~
/build/source/tests/xdg_popup.cpp: In function 'testing::internal::ParamGenerator<{anonymous}::PositionerTestParams> gtest_DefaultXdgPopupPositionerTest_EvalGenerator_()':
/build/source/tests/xdg_popup.cpp:737:136: note: '<anonymous>' declared here
  737 |         PositionerTestParams{"default values", (window_width - popup_width) / 2, (window_height - popup_height) / 2, PositionerParams()}
      |                                                                                                                                        ^
In member function 'bool std::_Function_base::_M_empty() const',
    inlined from 'std::function<_Res(_ArgTypes ...)>::operator bool() const [with _Res = std::pair<int, int>; _ArgTypes = {int, int}]' at /nix/store/l89iqc7am6i60y8vk507zwrzxf0wcd3v-gcc-14-20241116/include/c++/14-20241116/bits/std_function.h:574:25,
    inlined from 'std::function<_Res(_ArgTypes ...)>::function(std::function<_Res(_ArgTypes ...)>&&) [with _Res = std::pair<int, int>; _ArgTypes = {int, int}]' at /nix/store/l89iqc7am6i60y8vk507zwrzxf0wcd3v-gcc-14-20241116/include/c++/14-20241116/bits/std_function.h:407:6,
    inlined from 'constexpr void std::_Construct(_Tp*, _Args&& ...) [with _Tp = function<pair<int, int>(int, int)>; _Args = {function<pair<int, int>(int, int)>}]' at /nix/store/l89iqc7am6i60y8vk507zwrzxf0wcd3v-gcc-14-20241116/include/c++/14-20241116/bits/stl_construct.h:119:7,
    inlined from 'constexpr void std::_Optional_payload_base<_Tp>::_M_construct(_Args&& ...) [with _Args = {std::function<std::pair<int, int>(int, int)>}; _Tp = std::function<std::pair<int, int>(int, int)>]' at /nix/store/l89iqc7am6i60y8vk507zwrzxf0wcd3v-gcc-14-20241116/include/c++/14-20241116/optional:274:19,
    inlined from 'constexpr std::_Optional_payload_base<_Tp>::_Optional_payload_base(bool, std::_Optional_payload_base<_Tp>&&) [with _Tp = std::function<std::pair<int, int>(int, int)>]' at /nix/store/l89iqc7am6i60y8vk507zwrzxf0wcd3v-gcc-14-20241116/include/c++/14-20241116/optional:151:22,
    inlined from 'constexpr std::_Optional_payload_base<_Tp>::_Optional_payload_base(bool, std::_Optional_payload_base<_Tp>&&) [with _Tp = std::function<std::pair<int, int>(int, int)>]' at /nix/store/l89iqc7am6i60y8vk507zwrzxf0wcd3v-gcc-14-20241116/include/c++/14-20241116/optional:147:7,
    inlined from 'constexpr std::_Optional_payload<std::function<std::pair<int, int>(int, int)>, true, false, false>::_Optional_payload(bool, std::_Optional_payload_base<std::function<std::pair<int, int>(int, int)> >&&) [inherited from std::_Optional_payload_base<std::function<std::pair<int, int>(int, int)> >]' at /nix/store/l89iqc7am6i60y8vk507zwrzxf0wcd3v-gcc-14-20241116/include/c++/14-20241116/optional:395:42,
    inlined from 'constexpr std::_Optional_payload<std::function<std::pair<int, int>(int, int)>, false, false, false>::_Optional_payload(bool, std::_Optional_payload_base<std::function<std::pair<int, int>(int, int)> >&&) [inherited from std::_Optional_payload_base<std::function<std::pair<int, int>(int, int)> >]' at /nix/store/l89iqc7am6i60y8vk507zwrzxf0wcd3v-gcc-14-20241116/include/c++/14-20241116/optional:429:57,
    inlined from 'constexpr std::_Optional_base<_Tp, <anonymous>, <anonymous> >::_Optional_base(std::_Optional_base<_Tp, <anonymous>, <anonymous> >&&) [with _Tp = std::function<std::pair<int, int>(int, int)>; bool <anonymous> = false; bool <anonymous> = false]' at /nix/store/l89iqc7am6i60y8vk507zwrzxf0wcd3v-gcc-14-20241116/include/c++/14-20241116/optional:542:9,
    inlined from 'constexpr std::optional<std::function<std::pair<int, int>(int, int)> >::optional(std::optional<std::function<std::pair<int, int>(int, int)> >&&)' at /nix/store/l89iqc7am6i60y8vk507zwrzxf0wcd3v-gcc-14-20241116/include/c++/14-20241116/optional:703:11,
    inlined from 'constexpr {anonymous}::PositionerTestParams::PositionerTestParams({anonymous}::PositionerTestParams&&)' at /build/source/tests/xdg_popup.cpp:132:8,
    inlined from 'testing::internal::ValueArray<T ...> testing::Values(T ...) [with T = {{anonymous}::PositionerTestParams}]' at /nix/store/jjk5d24nfk0z87cg78cv5mzy2yj5z2fa-gtest-1.15.2-dev/include/gtest/gtest-param-test.h:336:20,
    inlined from 'testing::internal::ParamGenerator<{anonymous}::PositionerTestParams> gtest_DefaultXdgPopupPositionerTest_EvalGenerator_()' at /build/source/tests/xdg_popup.cpp:733:1:
/nix/store/l89iqc7am6i60y8vk507zwrzxf0wcd3v-gcc-14-20241116/include/c++/14-20241116/bits/std_function.h:247:37: error: '*(const std::_Function_base*)((char*)&<unnamed> + offsetof(<unnamed>::PositionerTestParams, <unnamed>::PositionerTestParams::parent_position_func.std::optional<std::function<std::pair<int, int>(int, int)> >::<unnamed>.std::_Optional_base<std::function<std::pair<int, int>(int, int)>, false, false>::<unnamed>)).std::_Function_base::_M_manager' may be used uninitialized [8;;https://gcc.gnu.org/onlinedocs/gcc-14.2.0/gcc/Warning-Options.html#index-Wmaybe-uninitialized-Werror=maybe-uninitialized8;;]
  247 |     bool _M_empty() const { return !_M_manager; }
      |                                     ^~~~~~~~~~
/build/source/tests/xdg_popup.cpp: In function 'testing::internal::ParamGenerator<{anonymous}::PositionerTestParams> gtest_DefaultXdgPopupPositionerTest_EvalGenerator_()':
/build/source/tests/xdg_popup.cpp:737:136: note: '<anonymous>' declared here
  737 |         PositionerTestParams{"default values", (window_width - popup_width) / 2, (window_height - popup_height) / 2, PositionerParams()}
      |                                                                                                                                        ^
In constructor 'std::function<_Res(_ArgTypes ...)>::function(std::function<_Res(_ArgTypes ...)>&&) [with _Res = std::pair<int, int>; _ArgTypes = {int, int}]',
    inlined from 'constexpr void std::_Construct(_Tp*, _Args&& ...) [with _Tp = function<pair<int, int>(int, int)>; _Args = {function<pair<int, int>(int, int)>}]' at /nix/store/l89iqc7am6i60y8vk507zwrzxf0wcd3v-gcc-14-20241116/include/c++/14-20241116/bits/stl_construct.h:119:7,
    inlined from 'constexpr void std::_Optional_payload_base<_Tp>::_M_construct(_Args&& ...) [with _Args = {std::function<std::pair<int, int>(int, int)>}; _Tp = std::function<std::pair<int, int>(int, int)>]' at /nix/store/l89iqc7am6i60y8vk507zwrzxf0wcd3v-gcc-14-20241116/include/c++/14-20241116/optional:274:19,
    inlined from 'constexpr std::_Optional_payload_base<_Tp>::_Optional_payload_base(bool, std::_Optional_payload_base<_Tp>&&) [with _Tp = std::function<std::pair<int, int>(int, int)>]' at /nix/store/l89iqc7am6i60y8vk507zwrzxf0wcd3v-gcc-14-20241116/include/c++/14-20241116/optional:151:22,
    inlined from 'constexpr std::_Optional_payload_base<_Tp>::_Optional_payload_base(bool, std::_Optional_payload_base<_Tp>&&) [with _Tp = std::function<std::pair<int, int>(int, int)>]' at /nix/store/l89iqc7am6i60y8vk507zwrzxf0wcd3v-gcc-14-20241116/include/c++/14-20241116/optional:147:7,
    inlined from 'constexpr std::_Optional_payload<std::function<std::pair<int, int>(int, int)>, true, false, false>::_Optional_payload(bool, std::_Optional_payload_base<std::function<std::pair<int, int>(int, int)> >&&) [inherited from std::_Optional_payload_base<std::function<std::pair<int, int>(int, int)> >]' at /nix/store/l89iqc7am6i60y8vk507zwrzxf0wcd3v-gcc-14-20241116/include/c++/14-20241116/optional:395:42,
    inlined from 'constexpr std::_Optional_payload<std::function<std::pair<int, int>(int, int)>, false, false, false>::_Optional_payload(bool, std::_Optional_payload_base<std::function<std::pair<int, int>(int, int)> >&&) [inherited from std::_Optional_payload_base<std::function<std::pair<int, int>(int, int)> >]' at /nix/store/l89iqc7am6i60y8vk507zwrzxf0wcd3v-gcc-14-20241116/include/c++/14-20241116/optional:429:57,
    inlined from 'constexpr std::_Optional_base<_Tp, <anonymous>, <anonymous> >::_Optional_base(std::_Optional_base<_Tp, <anonymous>, <anonymous> >&&) [with _Tp = std::function<std::pair<int, int>(int, int)>; bool <anonymous> = false; bool <anonymous> = false]' at /nix/store/l89iqc7am6i60y8vk507zwrzxf0wcd3v-gcc-14-20241116/include/c++/14-20241116/optional:542:9,
    inlined from 'constexpr std::optional<std::function<std::pair<int, int>(int, int)> >::optional(std::optional<std::function<std::pair<int, int>(int, int)> >&&)' at /nix/store/l89iqc7am6i60y8vk507zwrzxf0wcd3v-gcc-14-20241116/include/c++/14-20241116/optional:703:11,
    inlined from 'constexpr {anonymous}::PositionerTestParams::PositionerTestParams({anonymous}::PositionerTestParams&&)' at /build/source/tests/xdg_popup.cpp:132:8,
    inlined from 'testing::internal::ValueArray<T ...> testing::Values(T ...) [with T = {{anonymous}::PositionerTestParams}]' at /nix/store/jjk5d24nfk0z87cg78cv5mzy2yj5z2fa-gtest-1.15.2-dev/include/gtest/gtest-param-test.h:336:20,
    inlined from 'testing::internal::ParamGenerator<{anonymous}::PositionerTestParams> gtest_DefaultXdgPopupPositionerTest_EvalGenerator_()' at /build/source/tests/xdg_popup.cpp:733:1:
/nix/store/l89iqc7am6i60y8vk507zwrzxf0wcd3v-gcc-14-20241116/include/c++/14-20241116/bits/std_function.h:409:13: error: '*(const std::_Any_data*)((char*)&<unnamed> + offsetof(<unnamed>::PositionerTestParams, <unnamed>::PositionerTestParams::parent_position_func.std::optional<std::function<std::pair<int, int>(int, int)> >::<unnamed>.std::_Optional_base<std::function<std::pair<int, int>(int, int)>, false, false>::<unnamed>))' may be used uninitialized [8;;https://gcc.gnu.org/onlinedocs/gcc-14.2.0/gcc/Warning-Options.html#index-Wmaybe-uninitialized-Werror=maybe-uninitialized8;;]
  409 |             _M_functor = __x._M_functor;
      |             ^~~~~~~~~~
/build/source/tests/xdg_popup.cpp: In function 'testing::internal::ParamGenerator<{anonymous}::PositionerTestParams> gtest_DefaultXdgPopupPositionerTest_EvalGenerator_()':
/build/source/tests/xdg_popup.cpp:737:136: note: '<anonymous>' declared here
  737 |         PositionerTestParams{"default values", (window_width - popup_width) / 2, (window_height - popup_height) / 2, PositionerParams()}
      |                                                                                                                                        ^
cc1plus: all warnings being treated as errors
make[2]: *** [CMakeFiles/wlcs.asan.dir/build.make:868: CMakeFiles/wlcs.asan.dir/tests/xdg_popup.cpp.o] Error 1

mir_2_15:

  • Backport multiple upstream changes to fix GCC 14 compat

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 25.05 Release Notes (or backporting 24.11 and 25.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@github-actions github-actions bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 labels Dec 26, 2024
@@ -38,6 +48,9 @@ stdenv.mkDerivation (finalAttrs: {
wayland-scanner # needed by cmake
];

# Whatever default optimisation level is in use here (can reproduce with -O3) breaks std::function usage in some tests
env.NIX_CFLAGS_COMPILE = "-O2";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems like -Werror is enabled.

Suggested change
env.NIX_CFLAGS_COMPILE = "-O2";
env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isGNU "-Wno-error=maybe-uninitialized";

I was able to get it to compile with out disabling the warning but it is weird.

5x.diff
diff --git a/tests/xdg_popup.cpp b/tests/xdg_popup.cpp
index 99c2a0b..41ee16d 100644
--- a/tests/xdg_popup.cpp
+++ b/tests/xdg_popup.cpp
@@ -734,6 +734,10 @@ INSTANTIATE_TEST_SUITE_P(
     Default,
     XdgPopupPositionerTest,
     testing::Values(
+        PositionerTestParams{"default values", (window_width - popup_width) / 2, (window_height - popup_height) / 2, PositionerParams()},
+        PositionerTestParams{"default values", (window_width - popup_width) / 2, (window_height - popup_height) / 2, PositionerParams()},
+        PositionerTestParams{"default values", (window_width - popup_width) / 2, (window_height - popup_height) / 2, PositionerParams()},
+        PositionerTestParams{"default values", (window_width - popup_width) / 2, (window_height - popup_height) / 2, PositionerParams()},
         PositionerTestParams{"default values", (window_width - popup_width) / 2, (window_height - popup_height) / 2, PositionerParams()}
     ));
 

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be this upstream issue? The explained situation there seems to be around LTO, but the error points at the same line…

canonical/wlcs#346

Considering that the "fix" there was to just disable LTO in the Debian build code, and there are references to this being a compiler/linker issue, let's go with disabling the warning for now until upstream (whichever one that may be here) sorts that out.

@ofborg ofborg bot added the 11.by: package-maintainer This PR was created by the maintainer of the package it changes label Dec 27, 2024
@OPNA2608
Copy link
Contributor Author

@ofborg build mir mir.passthru.tests mir_2_15 mir_2_15.passthru.tests

@OPNA2608 OPNA2608 added the 12.approvals: 1 This PR was reviewed and approved by one reputable person label Dec 27, 2024
@OPNA2608 OPNA2608 merged commit 57986b9 into NixOS:master Dec 27, 2024
43 of 46 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 11.by: package-maintainer This PR was created by the maintainer of the package it changes 12.approvals: 1 This PR was reviewed and approved by one reputable person
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants