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

Test building with Qt 6 #4908

Closed
wants to merge 8 commits into from
Closed

Conversation

cjmayo
Copy link
Contributor

@cjmayo cjmayo commented Dec 31, 2023

Builds master on Linux with:

-DCLANG_TIDY=OFF -DENABLE_CAIRO=yes -DENABLE_EGL=ON -DENABLE_GLX=OFF -DENABLE_SPNAV=yes -DENABLE_TESTS=no -DEXPERIMENTAL=no -DHEADLESS=no -DUSE_CCACHE=OFF -DUSE_GLAD=ON -DUSE_MIMALLOC=OFF -DENABLE_GAMEPAD=no -DENABLE_QTDBUS=yes

Draft because Qt6Gamepad doesn't exist, and I guess not everyone wants to switch right now.

@kintel kintel mentioned this pull request Dec 31, 2023
16 tasks
@cjmayo
Copy link
Contributor Author

cjmayo commented Jan 1, 2024

Availability of libqscintilla2_qt6 is the blocker. For Ubuntu need >= 23.04. Can't find it on Homebrew.
A win for MSYS2.

(It is in Debian and Fedora, alas not available on GitHub Actions).

@t-paul
Copy link
Member

t-paul commented Jan 1, 2024

We will need to support both Qt5 and Qt6 for a while anyway, at least for the Linux builds. Qt6-only will be a showstopper for the next couple of years or we would have to drop support for things like AppImages which seem to be quite popular.

I'll try to see if we can get the scintilla package for Ubuntu built via OBS, we have to do that for other libraries too.

I'm not sure Homebrew is a problem, as we have to custom build all the macOS libraries anyway. So the effort here is to figure out how and when to do that. On the plus side, it should be fine here to "just" switch over to Qt6 at some point.

@kintel
Copy link
Member

kintel commented Jan 1, 2024

@cjmayo also, just FYI: The tests run here don't exercise any Qt code paths, but they are good for validating builds.

@cjmayo
Copy link
Contributor Author

cjmayo commented Jan 6, 2024

Looks like brew.sh are waiting for Octave 9 before updating qscintilla2.

@kintel
Copy link
Member

kintel commented Jan 6, 2024

For macOS, let's start by building our own Qt6 and test based on that. We do such builds on CircleCI, but we don't currently run tests there.
Needs: update macosx-build-dependencies.sh to support Qt6.

@cjmayo cjmayo changed the title Port CMakeLists.txt to Qt 6 Test Building with Qt 6 Jan 8, 2024
@cjmayo cjmayo changed the title Test Building with Qt 6 Test building with Qt 6 Jan 8, 2024
@Neumann-A
Copy link

Do I read this PR correctly that only CMake changes are required to build OpenSCAD with Qt6? If so, I might try building it with vcpkg on windows.

@cjmayo
Copy link
Contributor Author

cjmayo commented Feb 3, 2024

Yes, the code changes are done, just needs the CMake update in #4929 (built with Qt 6 here).

When running N.B. there are some MS Windows only changes 05cf63e, and for multi-monitor setups d243e4f.

@cjmayo
Copy link
Contributor Author

cjmayo commented Mar 18, 2024

Homebrew switched qscintilla2 to Qt 6, finally a chance to build with macOS. Requires 10.15 so needs a CMake tweak, but with that builds OK.

With qscintilla2 on Qt 6, Qt 5 builds are broken https://github.com/openscad/openscad/actions/runs/8331011451/job/22796918667#step:5:89

@kintel
Copy link
Member

kintel commented Mar 18, 2024

With qscintilla2 on Qt 6, Qt 5 builds are broken

Argh! I'll take a look at that.

@kintel
Copy link
Member

kintel commented Mar 18, 2024

For now, I added a request here: Homebrew/homebrew-core#166414 (comment) - let's see where that goes.

@kintel
Copy link
Member

kintel commented Mar 22, 2024

Temporary workaround to downgrade QScintilla to the qt5 version: #5059

@kintel
Copy link
Member

kintel commented May 10, 2024

We should support both Qt5 and Qt6 builds on the CI, subject to CI capacity.
See #5129 for WIP to make that work on macOS.

@cjmayo cjmayo force-pushed the qt6-cmakelists branch 3 times, most recently from e852404 to 458b227 Compare May 14, 2024 19:02
@cjmayo
Copy link
Contributor Author

cjmayo commented May 14, 2024

I updated too early - Ubuntu 24.04 wasn't actually available (it was listed in the README...). I probably changed more than I needed to before I understood that.

But yes, this PR is not something ready for merging. Just testing building with Qt6 and some experiments (e.g. can build only using packages from Ubuntu 24.04).

Now that #5129 is merged there is Qt 6 build testing going on.

@cjmayo
Copy link
Contributor Author

cjmayo commented May 17, 2024

I'm still not able to get a green tick here - but not because of Qt 6:

MSYS2 - (as seen in other PRs/master) has updated to GCC 14 which cannot build Clipper2 1.3.0 that Manifold is pulling in. Probably could be worked around by installing a snapshot of Clipper2 before Manifold. I'm not personally interested in doing that, and even so looks like there are new test failures (other updated dependencies?):

The following tests FAILED:
	364 - cgalpngtest_minkowski3-erosion (Failed)
	587 - opencsgtest_minkowski3-erosion (Failed)
	640 - opencsgtest_issue1089 (Failed)

Ubuntu 24.04 - packages gcovr 7.0 which can't handle files longer than 9999 lines. I've experimented here with installing gcovr from PyPI but not only does 7.2 not work for me, I had no luck with 5.0 (packaged in 22.04), 5.1 or 5.2. Something about the different paths?

report saved:
 Testing/Temporary/__llvmpipe-_llvm-17.0.6,-256_fcir_report.html
do_coverage()
Generating code coverage report...
(WARNING) Deprecated option -p used, please use '--sort-key uncovered-percent' instead.
(INFO) - MainThread - Reading coverage data...
(ERROR) - Thread-1 (worker) - GCOV produced the following errors processing /home/runner/work/openscad/openscad/tests/data/scad/misc/.gcov/#home#runner#work#openscad#openscad#b#submodules#mimalloc#CMakeFiles#mimalloc-static.dir#Unity#unity_0_cxx.cxx.gcda:
	Trouble processing '/home/runner/work/openscad/openscad/tests/data/scad/misc/.gcov/#home#runner#work#openscad#openscad#b#submodules#mimalloc#CMakeFiles#mimalloc-static.dir#Unity#unity_0_cxx.cxx.gcda' with working directory '/home/runner/work/openscad/openscad'.
Stdout of gcov was >>None<< End of stdout
Stderr of gcov was >>None<< End of stderr
Exception was >>GCOV returncode was 5.<< End of stderr
Current processed gcov file was None.

I will pick out what I can for consideration separately.

@kintel
Copy link
Member

kintel commented May 17, 2024

If you could open a ticket for the gcc14 issue that would be cool.

The other tests look like flakes - have you tried just rerunning?

@cjmayo
Copy link
Contributor Author

cjmayo commented May 18, 2024

GCC 14 issue was reported (and apparently fixed): AngusJohnson/Clipper2#823

I got those specific test failures a few times, this last one is different. Haven't got a pass yet.

@kintel
Copy link
Member

kintel commented May 18, 2024

Could be that clipper isn't updated past that fix in Manifold yet, plus we haven't pulled Manifold in a while.

@cjmayo
Copy link
Contributor Author

cjmayo commented May 19, 2024

It is Manifold itself that is downloading Clipper2 1.3.0 specifically:

manifoldDeps.cmake

    FetchContent_Declare(Clipper2
        GIT_REPOSITORY https://github.com/AngusJohnson/Clipper2.git
        GIT_TAG Clipper2_1.3.0
        GIT_PROGRESS TRUE
        SOURCE_SUBDIR CPP
    )

I've got gcovr to not error anyway: #5144

@t-paul
Copy link
Member

t-paul commented May 19, 2024

We should be able to use the OBS packages to override that - https://build.opensuse.org/project/show/home:t-paul:polyclipping2 - right now that just builds main.

@cjmayo
Copy link
Contributor Author

cjmayo commented May 31, 2024

Let's call this one done. Everything usable now is merged or in its own PR.

@cjmayo cjmayo closed this May 31, 2024
@cjmayo cjmayo deleted the qt6-cmakelists branch May 31, 2024 18:44
@t-paul
Copy link
Member

t-paul commented May 31, 2024

Nice! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants