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

Build fails on macOS if qt6 is installed #4365

Closed
elsiehupp opened this issue Mar 20, 2022 · 6 comments
Closed

Build fails on macOS if qt6 is installed #4365

elsiehupp opened this issue Mar 20, 2022 · 6 comments

Comments

@elsiehupp
Copy link
Member

How to use GitHub

  • Please use the 👍 reaction to show that you are affected by the same issue.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.

Expected behaviour

Build should succeed if the prerequisites are installed, regardless of whether additional packages are installed.

Actual behaviour

If Qt 6 is installed in addition to Qt 5, the build process will use it instead, leading to a number of compiler errors.

Steps to reproduce

  1. Follow the official macOS build instructions (which, incidentally, I personally wrote like a year ago).
  2. There will be a bunch of compile errors.

Note that the build will still fail even if Qt 5 is installed alongside Qt 6.

Workaround

I have confirmed that this issue can be mitigated by manually uninstalling Qt 6. First, install Qt 5 with the following command:

brew install qt5

Then uninstall Qt 6 with the following:

brew remove qt6

You may get a warning if Qt 6 is a dependency for another package, and while you can run brew uninstall --ignore-dependencies qt6 to override the warning, it will break the other package until you reinstall Qt 6 (which in turn will break the Nextcloud build process again—yay!).

Note: the build instructions say to install the prerequisites as follows:

% brew install git qt qtkeychain cmake openssl glib cmocka

However, at some point in the past year the qt formula on Homebrew changed from being an alias to qt@5 to being an alias to qt@6. So in addition to the user needing to run brew install qt5 and brew remove qt6 the macOS build instructions should probably be updated so that they no longer install Qt 6 by default.

I got this workaround from gnuradio/gnuradio#4578.

Client configuration

Client version: Git branch master
Operating system: macOS Monterey 12.1 (21C52)

Error output

(Everything above this works.)

[  9%] Building CXX object src/libsync/CMakeFiles/nextcloudsync.dir/nextcloudsync_autogen/mocs_compilation.cpp.o
In file included from /Users/elsiehupp/Repositories/nextcloud-desktop/build/src/libsync/nextcloudsync_autogen/mocs_compilation.cpp:2:
In file included from /Users/elsiehupp/Repositories/nextcloud-desktop/build/src/libsync/nextcloudsync_autogen/EWIEGA46WW/moc_abstractnetworkjob.cpp:10:
In file included from /Users/elsiehupp/Repositories/nextcloud-desktop/build/src/libsync/nextcloudsync_autogen/EWIEGA46WW/../../../../../src/libsync/abstractnetworkjob.h:19:
In file included from /usr/local/opt/qt@5/lib/QtCore.framework/Headers/QObject:1:
In file included from /usr/local/opt/qt@5/lib/QtCore.framework/Headers/qobject.h:46:
In file included from /usr/local/include/QtCore/qobjectdefs.h:48:
In file included from /usr/local/include/QtCore/qnamespace.h:44:
/usr/local/include/QtCore/qglobal.h:96:6: error: "Qt requires a C++17 compiler"
#    error "Qt requires a C++17 compiler"
     ^
/usr/local/include/QtCore/qglobal.h:773:43: error: no template named 'is_arithmetic_v' in namespace 'std'; did you mean 'is_arithmetic'?
         typename = std::enable_if_t<std::is_arithmetic_v<T> && std::is_arithmetic_v<U> &&
                                     ~~~~~^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/usr/include/c++/v1/type_traits:1117:50: note: 'is_arithmetic' declared here
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_arithmetic
                                                 ^
In file included from /Users/elsiehupp/Repositories/nextcloud-desktop/build/src/libsync/nextcloudsync_autogen/mocs_compilation.cpp:2:
In file included from /Users/elsiehupp/Repositories/nextcloud-desktop/build/src/libsync/nextcloudsync_autogen/EWIEGA46WW/moc_abstractnetworkjob.cpp:10:
In file included from /Users/elsiehupp/Repositories/nextcloud-desktop/build/src/libsync/nextcloudsync_autogen/EWIEGA46WW/../../../../../src/libsync/abstractnetworkjob.h:19:
In file included from /usr/local/opt/qt@5/lib/QtCore.framework/Headers/QObject:1:
In file included from /usr/local/opt/qt@5/lib/QtCore.framework/Headers/qobject.h:46:
In file included from /usr/local/include/QtCore/qobjectdefs.h:48:
In file included from /usr/local/include/QtCore/qnamespace.h:44:
/usr/local/include/QtCore/qglobal.h:773:70: error: no template named 'is_arithmetic_v' in namespace 'std'; did you mean 'is_arithmetic'?
         typename = std::enable_if_t<std::is_arithmetic_v<T> && std::is_arithmetic_v<U> &&
                                                                ~~~~~^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/usr/include/c++/v1/type_traits:1117:50: note: 'is_arithmetic' declared here
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_arithmetic
                                                 ^
In file included from /Users/elsiehupp/Repositories/nextcloud-desktop/build/src/libsync/nextcloudsync_autogen/mocs_compilation.cpp:2:
In file included from /Users/elsiehupp/Repositories/nextcloud-desktop/build/src/libsync/nextcloudsync_autogen/EWIEGA46WW/moc_abstractnetworkjob.cpp:10:
In file included from /Users/elsiehupp/Repositories/nextcloud-desktop/build/src/libsync/nextcloudsync_autogen/EWIEGA46WW/../../../../../src/libsync/abstractnetworkjob.h:19:
In file included from /usr/local/opt/qt@5/lib/QtCore.framework/Headers/QObject:1:
In file included from /usr/local/opt/qt@5/lib/QtCore.framework/Headers/qobject.h:46:
In file included from /usr/local/include/QtCore/qobjectdefs.h:48:
In file included from /usr/local/include/QtCore/qnamespace.h:44:
/usr/local/include/QtCore/qglobal.h:773:87: error: expected '>'
         typename = std::enable_if_t<std::is_arithmetic_v<T> && std::is_arithmetic_v<U> &&
                                                                                      ^
/usr/local/include/QtCore/qglobal.h:773:37: note: to match this '<'
         typename = std::enable_if_t<std::is_arithmetic_v<T> && std::is_arithmetic_v<U> &&
                                    ^
/usr/local/include/QtCore/qglobal.h:773:65: error: expected ',' or '>' in template-parameter-list
         typename = std::enable_if_t<std::is_arithmetic_v<T> && std::is_arithmetic_v<U> &&
                                                                ^
/usr/local/include/QtCore/qglobal.h:774:66: error: expected unqualified-id
                                     std::is_floating_point_v<T> == std::is_floating_point_v<U> &&
                                                                 ^
/usr/local/include/QtCore/qglobal.h:785:35: error: no type named 'Promoted' in namespace 'QTypeTraits::detail'
using Promoted = typename detail::Promoted<T, U>::type;
                 ~~~~~~~~~~~~~~~~~^~~~~~~~
/usr/local/include/QtCore/qglobal.h:785:43: error: expected ';' after alias declaration
using Promoted = typename detail::Promoted<T, U>::type;
                                          ^
/usr/local/include/QtCore/qglobal.h:797:31: error: no template named 'Promoted' in namespace 'QTypeTraits'
constexpr inline QTypeTraits::Promoted<T, U> qMin(const T &a, const U &b)
                 ~~~~~~~~~~~~~^
/usr/local/include/QtCore/qglobal.h:799:28: error: no template named 'Promoted' in namespace 'QTypeTraits'
    using P = QTypeTraits::Promoted<T, U>;
              ~~~~~~~~~~~~~^
/usr/local/include/QtCore/qglobal.h:800:5: error: unknown type name 'P'
    P _a = a;
    ^
/usr/local/include/QtCore/qglobal.h:801:5: error: unknown type name 'P'
    P _b = b;
    ^
/usr/local/include/QtCore/qglobal.h:805:31: error: no template named 'Promoted' in namespace 'QTypeTraits'
constexpr inline QTypeTraits::Promoted<T, U> qMax(const T &a, const U &b)
                 ~~~~~~~~~~~~~^
/usr/local/include/QtCore/qglobal.h:807:28: error: no template named 'Promoted' in namespace 'QTypeTraits'
    using P = QTypeTraits::Promoted<T, U>;
              ~~~~~~~~~~~~~^
/usr/local/include/QtCore/qglobal.h:808:5: error: unknown type name 'P'
    P _a = a;
    ^
/usr/local/include/QtCore/qglobal.h:809:5: error: unknown type name 'P'
    P _b = b;
    ^
/usr/local/include/QtCore/qglobal.h:813:31: error: no template named 'Promoted' in namespace 'QTypeTraits'
constexpr inline QTypeTraits::Promoted<T, U> qBound(const T &min, const U &val, const T &max)
                 ~~~~~~~~~~~~~^
/usr/local/include/QtCore/qglobal.h:816:31: error: no template named 'Promoted' in namespace 'QTypeTraits'
constexpr inline QTypeTraits::Promoted<T, U> qBound(const T &min, const T &val, const U &max)
                 ~~~~~~~~~~~~~^
/usr/local/include/QtCore/qglobal.h:819:31: error: no template named 'Promoted' in namespace 'QTypeTraits'
constexpr inline QTypeTraits::Promoted<T, U> qBound(const U &min, const T &val, const T &max)
                 ~~~~~~~~~~~~~^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make[2]: *** [src/libsync/CMakeFiles/nextcloudsync.dir/nextcloudsync_autogen/mocs_compilation.cpp.o] Error 1
make[1]: *** [src/libsync/CMakeFiles/nextcloudsync.dir/all] Error 2
make: *** [all] Error 2

(After this the build process exits back to the command prompt.)

@github-actions
Copy link

This bug report did not receive an update in the last 4 weeks. Please take a look again and update the issue with new details, otherwise the issue will be automatically closed in 2 weeks. Thank you!

@github-actions
Copy link

github-actions bot commented May 1, 2022

This bug report is getting automatically closed due to no answer since the issue has been staled. Thank you!

@github-actions github-actions bot closed this as completed May 1, 2022
@elsiehupp elsiehupp reopened this May 1, 2022
@github-actions
Copy link

This bug report is getting automatically closed due to no answer since the issue has been staled. Thank you!

@github-actions
Copy link

This bug report did not receive an update in the last 4 weeks. Please take a look again and update the issue with new details, otherwise the issue will be automatically closed in 2 weeks. Thank you!

@github-actions github-actions bot added the stale label Jun 14, 2022
@elsiehupp
Copy link
Member Author

Still waiting...

@elsiehupp elsiehupp removed the stale label Jun 15, 2022
@camilasan
Copy link
Member

Still waiting...

We still need to make changes so we can use Qt6.

I will close this one in favor of #4461.

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.

2 participants