-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add meson build #3382
Comments
For reference previous cutter meson build support removed ~4years ago due to being incomplete, insufficiently maintained and partially depending on qmake project #2546 . I don't remember what was the exact state of meson build system on rizin side. If I am not mistaken there where quite a few meson build system changes that happened after the r2/rizin fork. I personally don't feel very excited about the idea of Cutter build system rewrite. If you want to further evaluate the amount of potential changes and work required on Cutter side my recommendation is instead of optional projects like RZ_LIBSWIFT or RZ_LIBYARA start with stuff like:
As for merging order if it ever gets that far, the more likely scenario (ignoring any additional libs) might be:
Are there any improvements on rizin side which would improve the compatibility with such setup, but do not affect the current setup or introduce duplicate work? |
Thanks for highlighting the previous meson-build integration. I wasn't aware of that transition. Generally, I don't see any deal-breaker in your points and I would be willing to try it (and therefore rewrite large parts of the build system). However, I'm of course highly biased. Therefore, first things first - here are my views on these points:
In the end.. If I were in your position and only got objections or claims to my concerns on an initiative like this, I would stop it straight away. I therefore propose to test and verify if meson is capable to fulfill the requirements with dedicated examples and tests. Why is it worth? I know that there are a whole bunch of arguments why meson-build should not be preferred. However, I personally could argue and provide examples against most of them. Mostly, because meson-build gave me fewer and shorter headaches (if at all), compared to other build-systems. |
No nothing was meant to be a total dealbreaker, and I have no doubt's it's possible to make it work if enough work gets put it in. This was meant more of as a warning that you have long way ahead and list of things to watch out and pay attention to if you decide to continue with it.
Qmake and the moc/ui stuff are two completely different things. The first one was a build system just like CMake or meson is. The later are just simple tools executed during the build process. Qt themselves have moved away from it in favor of CMake. And by dependency on qmake I was referring to fact that the old Cutter meson project was reading values out of Cutter qmake project file (as a hack do avoid some duplicate definitions between the qmake and meson projects). If the meson or CMake qt module under the hood invoke qmake for resolving some stuff, that by itself isn't a problem, and does so correctly without getting confused by multiple qt installs then that's not an issue.
Based on how little there is in meson.build of your cutter branch I highly doubt that.
By development builds I was referring to the builds that developers would do locally while working on Cutter.
Primary concerns with distro builds is:
Old meson versions is a separate topic . If there is a hard dependency on some feature which is only available in latest meson that's problematic. There needs to be some window of less than latest meson support. Even rolling distros don't update their packages instantly. But preferably decently fresh but not rolling distros like latest version or two Fedora should also be able use the meson they have.
Python2 support isn't needed at this point. Biggest thing to watch out here is distros like Ubuntu which can have multiple different python 3.x installed at the same time.
One more tiny concern (but not very important) is about the state of meson support by various IDEs. As a result of this discussion I checked the latest meson docs and was pleasantly surprised that things are better than they whey few years ago. At the same time I still have (personal) feeling that overall support by c++ ecosystem is better for CMake than meson. In QtCreator and VisualStudio CMake has first class support, and for CLion if I remember correctly that was the first build system they supported. In theory meson currently has some support for main IDEs, but at the same time QtCreator lists the support as " Many features available with Meson build or usually available from Qt Creator are missing", Visual Studio requires on meson generating a VS project instead of direct support (which is what CMake had long time ago). XCode situation is probably equal for both. VScode and CLion plugins are probably fine although I haven't had chance to properly evaluate them.
Go back to GHA ci scripts and keep reading everything relevant is there. If you only noticed x86-64 ubuntu latest you didn't read it carefully enough. Also where do you think release come from? Final words As a mainter (but I don't claim to represent the opinion of all maintainers or have the authority to do so, especially my the amount of my recent activity) I am happy enough with current state (even though there are parts that could be better) But I am also not completely against the possibility of having full meson build and if you showed up with a set of branches that have full feature parity with current setup, I would review it and even consider it for fully replacing existing one (only if the parity is actually there). Also I have no interest in maintaining half finished version of meson build or maintaining two build systems for Cutter in parallel. So decide for yourself if you are willing to put in a lot more time into this, considering a possibility that it will be rejected and thrown away if you don't reach the parity. Expect there to be lot of back and forth during the review process, and be prepared on working and testing on many different systems. |
Regarding your points:
My current plan on how to proceed from here:
|
Is your feature request related to a problem? Please describe.
This issue is not a feature request, but rather a collection and proposal to rework some parts of the build-system and about answering the following general question:
Will rizin/cutter use meson-build consistently?
I started to create the changes to rizin, cutter and rz-ghidra project as I wanted to build all three projects in one go with meson-build without utilizing git-submodules or any Cmake-Meson-build-glue-scripts. I realized that the meson-build integration is not consistent.
This makes things quite difficult, as it would require to install librz and rz-ghidra in order to debug or check them.
However, meson offers good features to prevent such as situation (such as wrap-mode force fallback, etc.).
I therefore created a code-state where it is absolutely possible to develop all three projects within one build folder with just one silly work-around to make the sleigh-language-defs available to cutter (install it temporarily in the build-dir, c.f. below).
Describe the solution you'd like
The idea is really easy written, but rather complicated and cumbersome to achieve. It was necessary to do the following things:
rizin_exe
target is not required, nor buildadd_global_arguments
againstadd_project_arguments
(addressed previously in: meson: do not useadd_global_arguments()
rizin#3706)meson_git_wrapper.py
from a subprojectv
-prefix)check_meson_subproject_py
-commands! These are redundant with mesonsforce_fallback
- andwrap_mode
-options and introduce incompatbilities.static_runtime
-option! This is redundant with mesons built inprefer_static
-optionThe linked branches could then be tested, by configuring a build-directory (in the cutter-branch) with:
meson setup -Dwrap_mode=forcefallback -Dprefix=$(pwd)/build/install build
and compile it with:
ninja -C build install
Describe alternatives you've considered
I'm not sure if this is in anyway desired or appreciated...
My meson-proposal lacks several features that are currently available in CMake (such as
RZ_LIBSWIFT
,RZ_LIBYARA
, etc.)I know this still has a far way to go. However, I think there are great opportunities! E.g. using sanitizer, toolchains, configurations, compiler-features or dependencies consistently over all parts of the project during development or even packaging. I really appreciated meson-build in the past and I hope there is appreciation for it here in the cutter/rizin community as well.
Additional context
Please note the list of branches that have been created to support this effort:
(NOTE: Branches are listed in the necessary order to merge them!)
Pull-Requests from these branches will be created, only if feedback to this issue is available.
Please note: The branches do not yet apply most of the developer-guidelines to the underlying projects (specifically regarding testing and documentation)
The text was updated successfully, but these errors were encountered: