-
Notifications
You must be signed in to change notification settings - Fork 403
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 system #297
Conversation
Neither the commit nor the pull request has any details on what meson is and why this is a valuable addition. I'm generally not opposed to including things that make it easier for folks to integrate, but there's an associated cost with adding another build system. Hence I'd really like to get some justification for why this is useful and necessary. |
Sorry, I guess meson is not (yet) well known among kernel people.
I certainly wouldn't call it "necessary". It surely is more common for desktop stuff (gnome, x11, mesa), but some low level projects (systemd, qemu) have adopted it too. Since liburing is a rather small codebase, the speed and simplicity advantages in this case are not so huge as with other projects:
|
18cc3e9
to
7404408
Compare
Can you add that description to the actual commit message? And also please remember to add your Signed-off-by line to the bottom of the commit as well. |
@axboe Done. |
Meson is a fast and simple build system. Adoption started mainly in the desktop space (Gnome, X11, Mesa) to replace autotools, but since then, some low level projects (systemd, qemu) have switched to it too. Since liburing is a rather small codebase, the difference in speed and simplicity are not as huge as with other projects. Nonetheless, there are still some advantages: * It comes with some nice features (e.g. out-of-source builds), that one would need to implement in shell otherwise. * Other projects that use Meson could integrate liburing easily into their build system by using Meson's subproject() functionality. * Meson provides some useful editor/IDE integration, e.g. by generating compile_commands.json for clangd. * Distribution packagers are provided with a "standard" build system, with well known options/features/behavior, that is actively developed. Signed-off-by: Peter Eszlari <[email protected]>
I'm not familiar with Meson, but just wanted to mention that I find the existing |
code = '''#include <linux/fs.h> | ||
int main(int argc, char **argv) | ||
{ | ||
__kernel_rwf_t x; | ||
x = 0; | ||
return x; | ||
} | ||
''' | ||
has__kernel_rwf_t = cc.compiles(code, name : '__kernel_rwf_t') |
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.
code = '''#include <linux/fs.h> | |
int main(int argc, char **argv) | |
{ | |
__kernel_rwf_t x; | |
x = 0; | |
return x; | |
} | |
''' | |
has__kernel_rwf_t = cc.compiles(code, name : '__kernel_rwf_t') | |
has__kernel_rwf_t = cc.has_type('__kernel_rwf_t', prefix: '#include <linux/fs.h>') |
code = '''#include <linux/time.h> | ||
#include <linux/time_types.h> | ||
int main(int argc, char **argv) | ||
{ | ||
struct __kernel_timespec ts; | ||
ts.tv_sec = 0; | ||
ts.tv_nsec = 1; | ||
return 0; | ||
} | ||
''' | ||
has__kernel_timespec = cc.compiles(code, name : '__kernel_timespec') |
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.
code = '''#include <linux/time.h> | |
#include <linux/time_types.h> | |
int main(int argc, char **argv) | |
{ | |
struct __kernel_timespec ts; | |
ts.tv_sec = 0; | |
ts.tv_nsec = 1; | |
return 0; | |
} | |
''' | |
has__kernel_timespec = cc.compiles(code, name : '__kernel_timespec') | |
has__kernel_timespec = cc.has_members('struct __kernel_timespec', 'tv_sec', 'tv_nsec', prefix : '#include <linux/time.h>') |
cpp = meson.get_compiler('cpp') | ||
|
||
code = '''#include <iostream> | ||
int main(int argc, char **argv) | ||
{ | ||
std::cout << "Test"; | ||
return 0; | ||
} | ||
''' | ||
has_cxx = cpp.compiles(code, name : 'C++') |
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.
Doesn't meson fail if cpp is in the project description but isn't available? If C++ should be optional there might be another way. I remember that we optionally add objective c in JackTrip if we compile on Darwin.
code = '''#include <ucontext.h> | ||
int main(int argc, char **argv) | ||
{ | ||
ucontext_t ctx; | ||
getcontext(&ctx); | ||
return 0; | ||
} | ||
''' | ||
has_ucontext = cc.compiles(code, name : 'ucontext') |
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.
code = '''#include <ucontext.h> | |
int main(int argc, char **argv) | |
{ | |
ucontext_t ctx; | |
getcontext(&ctx); | |
return 0; | |
} | |
''' | |
has_ucontext = cc.compiles(code, name : 'ucontext') | |
has_ucontext = cc.has_type('ucontext_t', prefix: '#include <ucontext.h>') |
The meson build files for liburing-2.0 are taken from https://github.com/fischerling/liburing/tree/2.0-meson and are based upon axboe/liburing#297
I have a two branches introducing meson as a build system on top of master as well as liburing-2.0 containing the suggested changes from @ntonnaett. @eszlari if you are still interested in this PR feel free to use my changes otherwise I would open a new pull request with my branch. |
The meson build files for liburing-2.0 are taken from https://github.com/fischerling/liburing/tree/2.0-meson and are based upon axboe/liburing#297
The meson build files for liburing-2.0 are taken from https://github.com/fischerling/liburing/tree/2.0-meson and are based upon axboe/liburing#297
The meson build files for liburing-2.0 are taken from https://github.com/fischerling/liburing/tree/2.0-meson and are based upon axboe/liburing#297
The meson build files for liburing-2.0 are taken from https://github.com/fischerling/liburing/tree/2.0-meson and are based upon axboe/liburing#297
The meson build files for liburing-2.0 are taken from https://github.com/fischerling/liburing/tree/2.0-meson and are based upon axboe/liburing#297
The meson build files for liburing-2.0 are taken from https://github.com/fischerling/liburing/tree/2.0-meson and are based upon axboe/liburing#297
The meson build files for liburing-2.0 are taken from https://github.com/fischerling/liburing/tree/2.0-meson and are based upon axboe/liburing#297
The meson build files for liburing-2.0 are taken from https://github.com/fischerling/liburing/tree/2.0-meson and are based upon axboe/liburing#297
The meson build files for liburing-2.0 are taken from https://github.com/fischerling/liburing/tree/2.0-meson and are based upon axboe/liburing#297
The meson build files for liburing-2.0 are taken from https://github.com/fischerling/liburing/tree/2.0-meson and are based upon axboe/liburing#297
The meson build files for liburing-2.0 are taken from https://github.com/fischerling/liburing/tree/2.0-meson and are based upon axboe/liburing#297
The meson build files for liburing-2.0 are taken from https://github.com/fischerling/liburing/tree/2.0-meson and are based upon axboe/liburing#297
meson file for each folder is probably too much (I mean for include dir mostly). |
What is the reason to drop the include/meson.build file? To reduce the diff because someone complained in #438? |
For anyone interested I updated the meson build code for liburing-2.2 at fischerling/liburing/meson-liburing-2.2 and submitted a pull request to update the version included in the meson wrapdb. |
for example, but I suppose the smallest diff it's better anyway, I believe Meson Build is not a Makefile replacement as is and creating a new file on each level is legacy. |
I prefer the idea of upstreaming current PR instead do it for wrapdb. |
I also prefer having the meson changes upstream. But since this PR has no real activity or interest, using the meson wrapdb solves all my problems by making liburing easy consumable from other meson projects. @axboe Do you consider changing the build system at all? Should I open a new PR with the meson changes based on liburing-2.2? |
It's not that I'm vehemently against changing the build system, but my main issue is that it's something that I have to support. And I don't know anything about meson, but to be honest, I know very little about On top of that, then you get people that take that side very seriously, and then I end up in a situation where everybody wants their favorite build system added. And that is certainly a path I'm not interested in at all. Whatever we end up doing, a single build system that is maintainable and broadly usable by everyone is important. The latter really is key, too. The hand rolled configure and basic makefiles are definitely a bit archaic, but It Works and is simpler to build and grok for everyone. Which is why I haven't changed it so far. |
Guess I didn't answer the specific question - yes, let's see a meson patch for the current branch and we can take a closer look at this. |
And further, I'm not at all interested in a dump-and-run build system conversion. If you submit one and are asking for it to be merged, I fully expect YOU to know be the build system maintainer for liburing. It's a small project and should not be a lot of work, but you need to put up with my stupid questions and have time to devote to it. Initially I'm sure a bit more than in the long run, but you are on the hook for that. That means I need a way to contact you that isn't github (as that's purely a secondary thing for me), eg I need to know who you are and what your email is, and others do too. Hence if you do go forward with this, make sure this information is in the git tree somehow. Thanks! |
I would also be happy to maintain or help maintain a meson build system going forward. |
'-Wno-unused-parameter',
'-Wno-sign-compare',
'-fomit-frame-pointer', Hardcoding warning and optimistation flags is alway bad practice. It would be good to update version in PR to be able to test that with last release. |
If I am not alone maintaining and being responsible for the meson code as @tp-m comment shows, I would also happily maintain and provide help for a build system based on meson. |
I also can help with Meson.
luckily, the Meson is a very simple build system and one or two days is enough to start working with. |
No description provided.