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

[Qt6|6.1.0] Add new ports. #14333

Merged
merged 243 commits into from
Jun 1, 2021
Merged

[Qt6|6.1.0] Add new ports. #14333

merged 243 commits into from
Jun 1, 2021

Conversation

Neumann-A
Copy link
Contributor

@Neumann-A Neumann-A commented Oct 31, 2020

closes #15029

Current Status:

  • added all 6.1.0 ports which I know of (does it work? Who knows?)

Current questions:

  • Port naming? qt6-qtbase? Only qtbase? (since qt wants to get rid of the version number anyway)
  • Features? Too many? Will never be all tested. (at least I will only be going for the default set.)

Depends:

@Neumann-A Neumann-A changed the title [Qt6-beta2] WIP: For people you want to try it out or help. [Qt6-beta2] WIP: For people who want to try it out or help. Nov 1, 2020
@JackBoosY JackBoosY added the info:reviewed Pull Request changes follow basic guidelines label May 15, 2021
@ras0219
Copy link
Contributor

ras0219 commented May 20, 2021

Port naming? qt6-qtbase? Only qtbase? (since qt wants to get rid of the version number anyway)

there is no way to install two different qt versions into the same prefix. They install the same headers and libraries.

What about setting INSTALL_INCLUDEDIR etc. like Linux distributions do it?
https://github.com/archlinux/svntogit-packages/blob/packages/qt6-base/trunk/PKGBUILD

Does not work. breaks vcpkg VS IDE integration and probably the qt VS addin completly. Does not solve the cmake config issue and probably the library naming issue.

A few points:

Almost certainly, code will want to be written to consume either Qt5 xor Qt6 xor QtNext. In this case, metaports are the correct approach to allow users to customize the specific Qt version selected. There may need to be some cmake hackery to "force" the selected Qt version in find_package() to match the selected major version in the vcpkg install. This might mean a set of qt-xyz ports that depend upon qtN-xyz as well as qt-version-select which contains share/qt/vcpkg-cmake-wrapper.cmake that forces all find_package(Qt N ...) calls to get forwarded to the currently selected Qt version. There might be other ways to do this, but this is the one that comes to mind immediately.

In the output txt files, I'm seeing headers like:

qt5compat:qt6/QtCore5Compat/6.1.0/QtCore5Compat/private/cp949codetbl_p.h
qt5compat:qt6/QtCore5Compat/6.1.0/QtCore5Compat/private/qbig5codec_p.h
qt5compat:qt6/QtCore5Compat/6.1.0/QtCore5Compat/private/qbinaryjson_p.h
qtbase:qt6/QtConcurrent/qtaskbuilder.h
qtbase:qt6/QtConcurrent/qtconcurrent_global.h
qtbase:qt6/QtConcurrent/qtconcurrentcompilertest.h
qtbase:qt6/QtConcurrent/qtconcurrentfilter.h
qtbase:qt6/QtConcurrent/qtconcurrentfilterkernel.h
qtbase:qt6/QtConcurrent/qtconcurrentfunctionwrappers.h
qtbase:qt6/QtConcurrent/qtconcurrentiteratekernel.h
qtbase:qt6/QtCore/6.1.0/QtCore/private/minimum-linux_p.h
qtbase:qt6/QtCore/6.1.0/QtCore/private/qabstractanimation_p.h
qtbase:qt6/QtCore/6.1.0/QtCore/private/qabstracteventdispatcher_p.h
qtbase:qt6/QtCore/6.1.0/QtCore/private/qabstractfileengine_p.h
qtbase:qt6/QtCore/6.1.0/QtCore/private/qabstractitemmodel_p.h
qtbase:qt6/QtCore/6.1.0/QtCore/private/qabstractproxymodel_p.h

Are users expected to use #include <qt6/QtConcurrent/qtaskbuilder.h>? These look like they don't conflict with qt5.

If the intent is for users to use QtConcurrent/qtaskbuilder.h, then the header files should be named as such and should generate an install conflict with the corresponding qt5 port. We will need to transition the vcpkg core catalog over to using qt6 across the board before merging this into the core catalog. Until then, this probably should be hosted as a private registry (Owned by @Neumann-A ?) and listed on #17161. That private registry should also likely contain metaport replacements for the qt5 names that point them at qt6?

@Neumann-A
Copy link
Contributor Author

Usage should be find_package(Qt N ...) since that is what Qt tries to achieve (https://www.qt.io/blog/versionless-cmake-targets-qt-5.15). Current Qt5 usage is typically find_package(Qt5 ...). In version less mode the version can be controlled by QT_DEFAULT_MAJOR_VERSION. Neither Qt5 nor this PR for Qt6 sets Qt up in a way that allows version less find_package yet.

usage is e.g. #include <QtWidgets> if done correctly. The current MSBuild integration does not support that in any way correctly!!! (MSBuild requires #include <QtGui/QtWidgets>)
I already moved the Qt5 headers in another PR to a subfolder qt5 since this was suggested in one of the comments and a reference to linux distros doing it that way.

Copy link
Contributor

@ras0219 ras0219 left a comment

Choose a reason for hiding this comment

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

Almost there -- I think we should switch the version schemes over to semver to better support versioning in the future.

After that change. LGTM

ports/qtactiveqt/vcpkg.json Outdated Show resolved Hide resolved
@JackBoosY JackBoosY added requires:author-response and removed info:reviewed Pull Request changes follow basic guidelines labels May 27, 2021
@JackBoosY
Copy link
Contributor

Thanks for your hard work!

@JackBoosY JackBoosY added info:reviewed Pull Request changes follow basic guidelines and removed requires:author-response labels Jun 1, 2021
@JackBoosY
Copy link
Contributor

Ping @strega-nil @strega-nil-ms for merge this PR.

- easier than rewriting history
- qt6svg usage will probably be tested by paraview/vtk in the future
@strega-nil-ms strega-nil-ms merged commit 36000a1 into microsoft:master Jun 1, 2021
@strega-nil-ms
Copy link
Contributor

Thank you @Neumann-A for seeing this through :)

@Neumann-A
Copy link
Contributor Author

@FranciscoPombal Do I break something for you if I directly delete this branch?

@FranciscoPombal
Copy link
Contributor

@Neumann-A Nope, feel free to delete it. Kudos!

@Neumann-A Neumann-A deleted the qt6-base branch June 1, 2021 19:26
FranciscoPombal added a commit to FranciscoPombal/qBittorrent that referenced this pull request Jul 4, 2021
This was tested with the experimental vcpkg Qt6 port:
microsoft/vcpkg#14333
as well as with the official Qt6 MSVC binary distribution

Working with upstream on the vcpkg port of Qt6 is the priority since
that is what will be used in CI.

What works:

- Dynamic and static Debug and Release builds on MSVC with vcpkg.
In all 4 cases, installation works correctly, as well as running from the
build directory right after the build.

- Dynamic Release and Debug builds on MSVC without vcpkg (using zlib,
  boost and libtorrent compiled from source + qt and openssl precompiled
  binaries from the official MSVC Qt distribution). Again, running from
  the build directory and installing works.

Current issues when building with the vcpkg Qt6 port:

- The problem with CMAKE_FIND_PACKAGE_PREFER_CONFIG (marked with a TODO)
has been reported to Qt: https://bugreports.qt.io/browse/QTBUG-93604
The workaround is trivial (just commented out a single line) and
harmless for now.

What was not tested/touched:

- Building with MinGW
- Static builds without vcpkg

Minor changes:

- Bumped minimum Qt version to 6.1.0
- Bumped minimum CMake version to 3.20 due to usage of cmake_path()
- The Qt6 Tools component is required for the Qt6::windeployqt target
endif()

if(NOT "open62541" IN_LIST FEATURES AND NOT "gds" IN_LIST FEATURES)
list(APPEND FEATURE_OPTIONS -DCMAKE_DISABLE_FIND_PACKAGE_WrapOpenSSL=ON)
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you know why you have added this?

Copy link
Contributor

Choose a reason for hiding this comment

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

Because of that the core build is failing with

CMake Warning at /Users/leanderSchulten/git_projekte/vcpkg/scripts/buildsystems/vcpkg.cmake:852 (_find_package):
  Found package configuration file:

    /Users/leanderSchulten/git_projekte/vcpkg/vcpkg_installed/arm64-osx/share/Qt6Network/Qt6NetworkConfig.cmake

  but it set Qt6Network_FOUND to FALSE so package "Qt6Network" is considered
  to be NOT FOUND.  Reason given by package:

  Qt6Network could not be found because dependency WrapOpenSSL could not be
  found.

Call Stack (most recent call first):
  /Users/leanderSchulten/git_projekte/vcpkg/vcpkg_installed/arm64-osx/share/Qt6/Qt6Config.cmake:157 (find_package)
  /Users/leanderSchulten/git_projekte/vcpkg/scripts/buildsystems/vcpkg.cmake:852 (_find_package)
  CMakeLists.txt:14 (find_package)


CMake Error at /Users/leanderSchulten/git_projekte/vcpkg/scripts/buildsystems/vcpkg.cmake:852 (_find_package):
  Found package configuration file:

    /Users/leanderSchulten/git_projekte/vcpkg/vcpkg_installed/arm64-osx/share/Qt6/Qt6Config.cmake

  but it set Qt6_FOUND to FALSE so package "Qt6" is considered to be NOT
  FOUND.  Reason given by package:

  Failed to find required Qt component "Network".

  Expected Config file at
  "/Users/leanderSchulten/git_projekte/vcpkg/vcpkg_installed/arm64-osx/share/Qt6Network/Qt6NetworkConfig.cmake"
  exists

  

  Configuring with --debug-find-pkg=Qt6Network might reveal details why the
  package was not found.

  Configuring with -DQT_DEBUG_FIND_PACKAGE=ON will print the values of some
  of the path variables that find_package uses to try and find the package.

Call Stack (most recent call first):
  CMakeLists.txt:14 (find_package)


-- Configuring incomplete, errors occurred!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

To be sure that all features configure options depending on it get deactivated. However, it was only meant to deactivate toplevel optional calls but that is not how it works. Since then i already removed more than one CMAKE_DISABLE_FIND_PACKAGE_ from the qt ports so if you find another one just remove it but make sure the features are controlled via some other means.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:new-port The issue is requesting a new library to be added; consider making a PR! info:reviewed Pull Request changes follow basic guidelines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[New Port Request] qt6