Posts

Showing posts with the label meson

This Weekend in Meson++ (January 15th)

 It's been a while, so this is going to cover more than a weekend, but I've hit some nice milestones, and it's pretty exciting.  Let's talk about phi nodes. I'm not an expert on phi's, but basically they're a way to represent values that change in branched code, without actually computing them. In a way it's a sort of "promise" of a value. if y₁ X₁ = true else X₂ = false endif X₃ = ϕ(X₁, X₃) In this case, until we can resolve Y  we can't know what X  is, it could be true  or false.  The Phi node lets us represent that by creating a new version of X , which is either true or false. Then, when we can prune the branches down to one value of X , we can propagate out the value of X that wasn't erased. This is pretty much the thing that makes SSA possible, and what makes it awesome. This then makes two more important passes really easy, constant folding and constant propagation. The First pass allows us to take variable aliases and ...

Introducing Meson++

I've been semi-quietly working on a new project for the last few months on and off, and today I've gotten far enough that I want to talk about it more widely: Meson++ . Meson++ is now capable of compiling very simply projects, if they meet the following criteria:  they use only C++ they don't have any external dependencies they only build executables they don't do any code generation you're okay using ninja you're using clang or gcc This may seem like a lot of restrictions, and it is, but there's a lot of code that has gone into getting to this point. I'd like to thank stackoverflow for answering a lot of questions. Motivation My primary motivation is to solve bootstrapping issues, imagine if python wanted to use Meson, currently that would create a bootstrap loop, where you need an old version of python to run an old version of Meson, etc. Or, imagine you want to build something like your compiler with Meson, now you need to build python bef...

Cython as a first class language in Meson

 Today some work I've been considering doing for a long time, but finally got around to, landed and will be available in Meson 0.59.0: cython as a first class language. This means starting with meson 0.59.0 You'll be able to write: project('mypackage', 'cython', meson_version : '>= 0.59.0') py = import('py').find_installation('python3'). py.extension_module( 'mypackage', ['mypackage.pyx', 'lib/other.pyx', 'lib/in_c.c'], dependencies : py.dependency(), install : true ) with no extra generators of custom_targets involved. You can even mix C and cython together like this and Meson should do the right thing automatically. This was made possibly by the people who worked on Vala support in Meson (which works very similarly to cython, transpiling a higher level language to C for compilation by your C compiler), and both upstream cython developers and the people at SciPy for testing and finding bug...

Mesa now has only two build systems

Mesa has only two build systems For the first time since I started the project to use Meson in Mesa, we now only have two build systems in tree, the fewest we’ve had since we started. Yesterday the SCons build system for Mesa was removed, VMWare felt confident enough in Meson to ship a product using Meson instead (both on Windows and Linux). This commit , removed 3600 lines of code and dropped Mesa down to just Meson and Android.mk build files. For reference autotools was removed in 2019 , and accounted for 13,000 lines of code. The first Meson build definition landed in Mesa in 2017, and the process has been a wild ride for me since then. I’ve written wrappers for LLVM dependency handling; fixed Meson on Solaris/OpenIndiana, Haiku, FreeBSD, OpenBSD, and GNU/Hurd; added and fixed hundreds of bugs in Meson; and generally put a ton of effort into the process. It’s very exciting to see one of the big promises of using Meson for Mesa pay off, we’re down to only 2 in tree build systems...

All the Bugs are My Fault

All the Bugs are my Fault Meson 0.57.0 came out a little over two weeks ago now. It’s a big exciting release with a ton of work that went into it. I’ve already talked about all the Rust changes that I worked on for it. I also did a fair bit of refactoring to clean up and simplify some internal data structures, and to make our environment variable handling consistent and centralized. Unfortunately this led to some bugs, in fact, it led to almost all the regressions reported for Meson 0.57.0. I’ll admit that I struggle a lot with anxiety and with the feeling that I do more harm than good, so seeing that huge list of regressions was not particularly encouraging. What was encouraging though is the level of professionalism that came with the bug reports. Each reporter simply reported the problems, there was no angry name-calling, no frustrations vented, even though some issues were serious regressions (one was pretty harmless, but the rest were not). I’ve made some bug reports that I’ve ...

Rust in Meson — 0.57 Edition

Rust in Meson 0.57 Most people by now have heard of the meson build system I hope (at least anyone who would bother to read this blog post), and Rust is the cool new language everyone wants to use because it guards against specific kinds of memory bugs and has some neat features. The question of course is how to add rust to your existing project using C, C++ or another language. The answer of course, should be build your project with meson. I’m not going to go into whether using Rust is a good idea, whether it’s going to solve all of your problems, eat your puppy, or any of that. Rust, like everything else we do in programming comes with a set of trade-offs. I’ll say though, for the record, that I like Rust as a programming language form the relatively small amount of it I’ve done. So here’s a run down of what’s coming in the meson 0.57.0 release for Rust. Meson level handling for rust editions. Rust editions, for the uninitiated, are roughly equivalent to standards in C and C++. ...