-
Notifications
You must be signed in to change notification settings - Fork 24
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
Fetch Qt instead of require it to be preinstalled #25
Comments
This is a good suggestion, thanks for filing it. There are some pros/cons to each approach, so I think it would be good to aim for supporting both. A few thoughts:
Ideally, I think it would be nice to provide two options with rules_qt:
|
I created an experiment here using Qt6. The idea here is to use a prebuild version of Qt and use dynamic linking. |
FYI I’ve started working on a rule set like bazel_rules_qt that builds qt from source. https://github.com/jheaff1/rules_qt/tree/build_qt_on_linux It’s still very much a work in progress |
maybe there's a middle ground? Our system has a prebuilt qt that we grab for CI. It looks like BAZEL_RULES_QT_DIR env allow me to override the default include path. But not the moc path or the libs directory, is there any reason why that couldn't be pushed through the rest of the system? That would at least provide a workable way to build the package portablely. |
Vertexwahn/rules_qt6 fetches on Windows and Linux a prebuild version of Qt6 - no need to preinstall anything - on macOS it is still required to preinstall Qt6 ( It would be really cool if someone would mange it to build Qt from scratch with Bazel. That would eliminate all the prebuild/prefetch things and only build the necessary things. I see this as a long term solution. A better short time solution would be to use aqt in a Bazel rule to install a prebuild version of Qt (and maybe brew on macOS if not doable with aqt). This seems for me most promising and doable in shorttime. Preinstalling something should be avoided in my opinion. There might be users that have no idea of Qt or work on different systems (as I do) and do not want to repeat install instructions every time. Also Bzlmod should be talken in consideration. |
I’ve built Qt from source using Bazel and was in the process of making a rule set for it but sadly I don’t have time to work on it anymore here is a branch that can build Qt for Linux using Bazel. I also have a messy private repo that can build Qt for windows and android. If people are interested I could make that public https://github.com/jheaff1/rules_qt/commits/build_qt_on_linux |
Aside from aqt, one could use this script to install qt without user interaction: https://github.com/qbs/qbs/blob/master/scripts/install-qt.sh |
@jheaff1 Did not realize that your rules work already on linux - would be nice if you share also the qt and android variant - maybe in own branches - not sure if I will ever have time to apply this to rules_qt6, but if someone wants to improve Qt Bazel support that direction does not sound to bad... |
If you want to use those rules you have to install Qt on every developer machine and configure your CI to pre-install Qt. For instance, when using Azure you have to do something similar as described here
The requirement of a pre-installed Qt version is really anyoing.
Get rid of this!
Fetch a pre-build version of Qt via Bazel.
The text was updated successfully, but these errors were encountered: