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

feat: support both qt5 and qt6 #1187

Open
wants to merge 10 commits into
base: rolling
Choose a base branch
from
Open

Conversation

wep21
Copy link
Contributor

@wep21 wep21 commented Apr 13, 2024

rework on #707

@wep21 wep21 requested a review from ahcorde as a code owner April 13, 2024 18:02
@wep21 wep21 force-pushed the support-both-qt5-6 branch 3 times, most recently from c9d9a3e to b9e5b58 Compare April 14, 2024 04:12
Copy link
Contributor

@ahcorde ahcorde left a comment

Choose a reason for hiding this comment

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

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Windows Build Status

@wep21
Copy link
Contributor Author

wep21 commented Apr 15, 2024

windows script uses Qt5_DIR here.

@wep21 wep21 requested a review from ahcorde April 15, 2024 14:30
@wep21
Copy link
Contributor Author

wep21 commented Apr 15, 2024

@ahcorde I appreciate it if you could rerun ci.

@ahcorde
Copy link
Contributor

ahcorde commented Apr 15, 2024

  • Windows Build Status

@wep21
Copy link
Contributor Author

wep21 commented Apr 15, 2024

@ahcorde The ci still failed, so I modified to use env.

@ahcorde
Copy link
Contributor

ahcorde commented Apr 15, 2024

  • Windows Build Status

@wep21
Copy link
Contributor Author

wep21 commented Apr 15, 2024

@ahcorde I'm sorry for the inconvenience, there was a small mistake in statement, so I fixed it.

@ahcorde
Copy link
Contributor

ahcorde commented Apr 15, 2024

  • Windows Build Status

@wep21
Copy link
Contributor Author

wep21 commented Apr 16, 2024

I'm sorry, but I have no idea why the windows ci failed. It may take some time to fix the issue.

@clalancette
Copy link
Contributor

I'm sorry, but I have no idea why the windows ci failed. It may take some time to fix the issue.

One thing you should know about our Qt installation on Windows; it is using a very old version of Qt, version 5.12.10: https://github.com/ros-infrastructure/ros2-cookbooks/blob/8ac2ddf1ceec864211971478bf3d515fbe71298e/cookbooks/ros2_windows/recipes/qt5.rb#L74

That's because after that version, Qt stopped providing downloadable executable files for Windows, so we had no way to auto-install it.

In any case, that very old version may not have the QT CMake target that you are currently expecting. It is worth investigating in that direction.

@MichaelOrlov
Copy link

@ahcorde Could you please help to handle this issue. On the latest waffle triage meeting we decided to move it to the backlog with the following notes:

Failure on Windows. Windows setup script hardcoded installation for qt5 only. Qt5 doesn't support the new style find_package(QT NAMES QT6 QT5) https://github.com/ros2/rviz/pull/1187/files#diff-f058f5df521489857a0241a6838777373aa24c99a073c3cd9cf2eee427b167eaR26-R27. A proper way to handle it would be to use conda package manager. It seems a lot of work will need to switch to conda.

@wep21
Copy link
Contributor Author

wep21 commented Apr 27, 2024

I added workaround for windows ci again. I appreciate it if someone could rerun ci.

@MichaelOrlov
Copy link

Re-run Windows CI after attempting to fix the build errors.

  • Windows Build Status

@wep21
Copy link
Contributor Author

wep21 commented Apr 27, 2024

The error says

qt_wrap_cpp called with incorrect number of arguments

so I added the following workaround for windows ci

  function(qt_wrap_cpp out)
    qt5_wrap_cpp(_sources ${ARGN})
    set("${out}" ${_sources} PARENT_SCOPE)
  endfunction()

@ahcorde
Copy link
Contributor

ahcorde commented Apr 29, 2024

Re-run Windows CI after attempting to fix the build errors.

  • Windows Build Status

@wep21
Copy link
Contributor Author

wep21 commented Apr 29, 2024

I also updated workaround in rviz_rendering_tests which I forgot to modify.
cc @ahcorde @MichaelOrlov

@ahcorde
Copy link
Contributor

ahcorde commented Apr 29, 2024

Re-run Windows CI after attempting to fix the build errors.

  • Windows Build Status

@wep21
Copy link
Contributor Author

wep21 commented Apr 30, 2024

note: need to fix this error

mock_display.obj : error LNK2001: unresolved external symbol "public: virtual struct QMetaObject const * __cdecl rviz_common::MockDisplay::metaObject(void)const " (?metaObject@MockDisplay@rviz_common@@UEBAPEBUQMetaObject@@XZ) [C:\ci\ws\build\rviz_common\rviz_common_display_test.vcxproj]

@wep21 wep21 force-pushed the support-both-qt5-6 branch from 9176ecf to dd8dd84 Compare May 5, 2024 14:44
@clalancette clalancette mentioned this pull request May 10, 2024
2 tasks
@srmainwaring
Copy link

Great to see Qt6 support for rviz. The package.xml still have a dependency on Qt5:

<build_depend>qtbase5-dev</build_depend>

Is there a preferred method to optionally include either Qt5 or Qt6 dependencies (or include them both but make them optional)?

@clalancette
Copy link
Contributor

Is there a preferred method to optionally include either Qt5 or Qt6 dependencies (or include them both but make them optional)?

We have conditionals in package.xml, but they can really only select on an environment variable.

In reality, though, there will only be one "supported" configuration at a time. That is, we can leave these as Qt5 dependencies for now, and then when we officially switch over, we can change these to Qt6 dependencies. For users of the other one (that is not officially supported), they can still build from source, they just won't be able to successfully run rosdep.

@wep21 wep21 force-pushed the support-both-qt5-6 branch from cc5a861 to 7e7252e Compare May 18, 2024 05:57
@wep21
Copy link
Contributor Author

wep21 commented May 18, 2024

@ahcorde @clalancette I appreciate it if you could rerun windows ci.

@ahcorde
Copy link
Contributor

ahcorde commented May 20, 2024

  • Windows Build Status

@ahcorde
Copy link
Contributor

ahcorde commented May 20, 2024

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Windows Build Status
  • Windows Debug Build Status

@ahcorde ahcorde requested a review from clalancette May 20, 2024 13:34
@clalancette
Copy link
Contributor

Can we make sure to run Windows Debug as well? Otherwise, this is great!

@ahcorde
Copy link
Contributor

ahcorde commented May 20, 2024

Can we make sure to run Windows Debug as well? Otherwise, this is great!

Sure, added to the list

@ahcorde
Copy link
Contributor

ahcorde commented May 21, 2024

  • Windows Debug Build Status

@wep21
Copy link
Contributor Author

wep21 commented May 23, 2024

@clalancette @ahcorde Is it possible to go ahead to merge?

@ahcorde
Copy link
Contributor

ahcorde commented May 23, 2024

@wep21 not really, there are some failing tests on Windows Debug.

I will take a look too

@wep21 wep21 force-pushed the support-both-qt5-6 branch 2 times, most recently from e4b41d5 to 3f4704b Compare June 18, 2024 11:08
Copy link
Contributor

@ahcorde ahcorde left a comment

Choose a reason for hiding this comment

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

I was able to compile rviz2 with qt6, just using the comparison that I mentioned in the comment

@@ -31,7 +31,17 @@ find_package(ament_cmake REQUIRED)
# do find_package(rviz_ogre_vendor) first to make sure the custom OGRE is found
find_package(rviz_ogre_vendor REQUIRED)

find_package(Qt5 REQUIRED COMPONENTS Widgets)
if(MSVC)
Copy link
Contributor

Choose a reason for hiding this comment

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

instead of using in the condition windows why don't use the Qt version instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

addressed here 3977093

@wep21 wep21 force-pushed the support-both-qt5-6 branch from 3f4704b to d32501f Compare June 28, 2024 16:15
@wep21 wep21 requested a review from ahcorde June 28, 2024 17:10
@ahcorde
Copy link
Contributor

ahcorde commented Jul 17, 2024

  • Windows Build Status

@wep21
Copy link
Contributor Author

wep21 commented Jul 18, 2024

Building rosidl_generator_py seems to fail.

@ahcorde
Copy link
Contributor

ahcorde commented Jul 18, 2024

  • Windows Build Status

@wep21 wep21 force-pushed the support-both-qt5-6 branch from 3977093 to 444cfdf Compare October 14, 2024 00:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants