-
Notifications
You must be signed in to change notification settings - Fork 74
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
use vcpkg for Windows & macOS builds; add Qt6 builds; use sccache #107
Conversation
2218664
to
f176ea8
Compare
qmltestrunner fails to import the QtQuick module on macOS. I suspect this has something to do with statically linking Qt. I tried specifying the Windows tests are failing to link symbols that look like they should come from Windows Qt6 tests are hanging indefinitely. |
776c64e
to
20af347
Compare
So the macOS part sounds interesting, which part are we static linking to Qt ? I thought we should be statically linking the Rust library into the C++ library or executable and then that is dynamic linking to Qt ? Or is something going wrong / missing on macOS ? For Windows, as you've managed to get things building quite far, I'll try and setup an environment so I can investigate what is failing on Windows (as none of us have tried it yet 😅 ), and as you have noted parts there are potential issues in cxx_qt.cpp are being changed in #105 so it'll likely be after that. |
vcpkg defaults to building everything statically on macOS (as well as Linux, though we're not using vcpkg for Linux builds).
I haven't tested static linking on another OS or dynamic linking on macOS, but that may be worth a try. |
Note that this branch will automatically download the dependencies with vcpkg when configuring CMake using my read-only PAT. This takes a while (several minutes) during which there isn't much feedback from vcpkg, but don't worry, it hasn't frozen. |
I suspect this may be a bug in qmltestrunner's build system rather than in cxx-qt. |
f47b6ca
to
b1e755b
Compare
How shall we proceed with this PR? I think it would be reasonable to disable the tests for Windows, merge this, then you could fix the Windows tests in a future PR. If you want to speed up the CI runs, manually cancel the earlier runs from https://github.com/KDAB/cxx-qt/actions. The earlier runs will take many hours before they finish because they didn't hit the GitHub Packages cache. I don't have permission to cancel CI runs on this repo. |
c1d9ab3
to
5314485
Compare
I'll try and have a closer look at this tomorrow, I wonder about splitting things into smaller changes as we have multiple things going on here. eg there could be the following pull requests (?)
|
The rewrite of the GitHub Actions workflow file and adding vcpkg for macOS & Windows is all done together in one commit. If you insist I could split it up, but IMO that wouldn't be worth the trouble. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's looking good, left some more comments for clarifications :-)
0731fa6
to
0f28bcb
Compare
Well, this is strange. Explicitly setting
|
I think all review comments have been addressed at this point. I also added documentation to README.md explaining how the build system works. |
Right sounds like a bug to report upstream :-) |
OK, lets go with this! |
@Be-ing Thanks for your contribution! I wasn't expecting to have this working for a while! :-) I'll try updating the tokens, I wonder if the "username" is my account or the org account if the token is from my personal account 🤔 ... |
Yes, it's confusing, but the user for the GitHub Packages NuGet source is the organization ( For example you can see the packages I built on my fork: https://github.com/Be-ing?tab=packages |
Thanks :-) |
The CI build on the
Yep, I've done this for two different cross platform C++ applications before, which took months of work, so I figured I'd help out with this cool project. In my experience this setup with vcpkg, GitHub Actions, and GitHub Packages has been the most practical way to maintain cross platform C++ applications. Don't hesitate to ping me if you have any questions maintaining it. The same build process works both on CI and for local development, so you don't get ugly surprises when developers try to get started contributing nor weird issues in CI builds that developers can't reproduce locally. Also, vcpkg works on Linux, so you can maintain packaging for Windows and macOS from Linux without needing to actually use Windows or macOS much. P.S. I just sent an application to [email protected]. It would be great to continue working together on this project. :) |
Thanks! It's all in main now :-) I'll tag you if we have any further issues thanks! And good luck ! :-) |
This builds Qt with vcpkg and caches the C++ dependencies on GitHub Packages. The builds work on Linux, Windows, and macOS for both Qt5 and Qt6, however the tests only pass on Linux. It uses sccache for both C++ and Rust to speed up the builds.
Currently it is using GitHub Packages under my GitHub user because that is what I have write access to. GITHUB_TOKEN can only have write access to the KDAB organization's GitHub Packages for a pull request from a branch on the upstream repository; it only has read access for pull requests from forked repositories. When this is merged,
Be-ing
should be replaced withKDAB
in theAuthenticate to GitHub Packages
step of the GitHub Actions workflow and a GitHub Personal Access Token with read-only permission to packages generated for anonymous access in CMakeLists.txt.Fixes #78, #79