8bitdemongirl

Lily, Leah, Luma & Bleat

  • she/her, it/its, they/them

Nsfw writer & electronic musician, plural system of ~7 (so far), 24 years old
Icon by https://furry.energy/@YemmieArts
Current icon =/= current fronting member/s



bruxisma
@bruxisma

but if you or a loved one are having to deal with CMake issues, please hit me up in my asks. I am unironically a world leading expert in CMake and build systems. It's not even my special interest, I'm just really good at it because I've always been the person who managed the build system at every job I've worked at.

My last job I was the sole dedicated engineer supporting the build system for an organization of about 800 engineers, with a monorepo of about 20MM lines of C++, C, and more that was experiencing about 400 PRs a day.

I'm not even charging money. I just hate seeing people suffer when I know you don't have to.


StrawberryDaquiri
@StrawberryDaquiri
This page's posts are visible only to users who are logged in.

You must log in to comment.

in reply to @bruxisma's post:

not sure if this counts but i'm trying to do nds homebrew in rust, and everything feels like cow tools. seledreams rust crates don't build, devkitpro is too complicated to use for anything, blocksds depends on wonderful-toolchain which can't even build from the source properly, custom gcc is needed and a lot of the build tooling revolves around it, etc. i don't think there's cmake at any step but if you can help me pull this stuff apart and get a reasonable working rust build actually from source it would be very appreciated

So I have some really bad news here, and it's that the entire homebrew space is very messy. devkitpro is known for being one of the least complex. The reason I don't even bother with the homebrew space anymore is because it's nearly impossible to have control over your tools and any desire to change them is met with resistance in the form of "but it works fine the way it is" or "maybe you shouldn't do this" (I once spent about 6 months with no knowledge of toolchains trying to get the PSP homebrew dev kit to work in like 2010. It was awful)

As an example, I've been trying to help an old coworker of mine get some CMake stuff setup for even older platforms like the SNES and Wiz so he can focus on writing code across multiple platforms and it's been extremely difficult. Sadly, most of the fault lies with the creators of these toolchains and them also being focused on "getting it to work" and then finding a point where they think they're done, instead of making the toolchain work in a non Makefile, non C or C++ focused ecosystem. In some cases they don't even have a standard directory layout making tools like gcc, clang, etc. require additional flags to be added everywhere.

As you've already seen there's a large focus on "just use pacman" because Arch linux wrote an ok build system that works fine for the one case where it works, but breaks down if you want to use it outside of that.

My only recommendation here is any issues you run with with cargo-nds should be filed as issues on the repository, especially as it seems that seledreams is moderately behind upstream.

I'm sorry I can't help further on this, but the people who could make it better are the creators of the various homebrew toolchains. 😔

I actually have a question for you!

I am aware that CMake Debuggers existing, but none have worked on a platform that I work for. I work with ~reasonably complex CMake systems (LLVM), and I've been wondering if there's a way to halt CMake non-parallel execution at a given point? Some sort of built-in evaluation breakpoint? Some way to hack it into the CMake source code itself? Any way to have a suspended CMake process at a known statement, which can be resumed later after one inspects the current project state.

so the only CMake debugger that works at this point is anything that supports the debugger adapter protocol (which was added just before the new year). I don't know of anyone who has integrated this beyond Jetbrains or VSCode. To date, I don't think there's even a neovim plugin (though, to be frank... I'm tempted to write one >_>)

In terms of builtin breakpoints, there is sadly none. The best you can do is use variable_watch in conjunction with maybe calling cmake_print_variables which is specified under CMakePrintHelpers, though it has an issue of "what if the variable is not defined?" I had fixed this in my :still in development for the 6 years" CMake library IXM, however CMake has been slowly adding features that made my blog post Everything You Never Wanted To Know About CMake less relevant with each release (thank god, honestly), so the stuff that's in a as-yet-to-be-released version is very slimmed down at this point.

That said, my heart goes out to anyone who works on the LLVM CMake stuff because it's a hot mess and I honestly don't know how I could convince them to let me rewrite most of it to be simpler and easier to understand (and not break shit on windows, which it does. all. the. fucking. time. 😭)

Anyhow to sum up, your best bet is to maybe call cmake_print_variables with some system("pause") equivalent via execute_process where you've turned the shell on.

(Someone had at one point written a script that would execute bash or python and set every CMake variable to the equivalent in python/bash, but it is SO SLOW in large programs 😭)

Debugger Adapter Protocol is a good starting point, but sadly not at the state that I need it! Thanks for the hint! variable_watch is also very cool!

I actually do happen to know the owner of the CMake in LLVM personally (we talk every few weeks), who agrees frequently it's a mess but has insisted it's more usable than trying to convert it all to Bazel/GN/Meson. I haven't questioned the state of the world here in general--it's not the worst CMake project I've worked on.

But I've been in the middle of fixing some of LLDB's CMake for a few weeks idly, and I had thought "wow, I wish I could just... stop here and look around".

I'm aware of the get_cmake_property trick to get all the variable values, cmake_print_variables with that may just work.

I have never worked on a Windows system professionally (or casually in 15 years), but it seems system("pause") it's just an input request like "read" or "getchar"? But I could try! I'm curious if it just reads from stdin when not specified.

I'm inclined to agree with them. Bazel/Meson/GN all have their issues outside of a few specific workflows and the work you have to do to support esoteric development environments for the average person is painful. If you could put me in touch with them, maybe the two of us could hash something out and maybe come up with a revamp plan to clean things up, because holy moly does it need it. 🙂

Of if you're looking for properties, have I got the function for you in the same module. cmake_print_properties, though it doesn't do globals.

Yeah, effectively you could be as lazy as just having a python script that calls input if you wanted. The important part is that you execute something to halt execution until you press enter or do something that makes execute_process continue, as CMake's configure stage is single threaded. 🙂

The people you probably want to reach out to here for LLVM CMake are Petr Hosek, Louis Dionne, and Michał Górny. I mostly talk to Petr who is has been very friendly, and would probably the one who can give points of contribution. He's been working on a runtimes revamp for a while.

Contacting them directly should work, but I think a lot of this discussion is over email threads, Google groups, the LLVM Discourse + Discord. The build channel in the Discord is fairly dead, mind you.

oh lol, I know Louis Dionne. He and I hit the C++ conference circuit and the standards process around the same time. Poor guy has to touch CMake just to get his template metaprogramming fix just like me know. smh 😔 (this is, of course, a joke)

I tend not to go into large discords anymore because it can get so overwhelming. That said, I'll try to reach out to Petr when I can then. There's a non-zero chance he knows who I am 😅

Got some lunch with Petr to talk about the state of CMake in LLVM and talked about improving it. If you do reach out, you can say I sent you to him and he'll know the context.

So it turns out, as far as he knows, he's the last actual person who owns it and he just doesn't have the time to fix everything. There's just so much history and cruft and brokenness just for one person.

So, welcome to reach out to contribute, though I don't think we can offer you a full time engineering job to do it, sadly :\

I'll try to get in touch, and honestly good to know there's space to improve the situation :D!

FWIW, I'm not actually looking for a full time engineering job! I'm on build systems stuff at Adobe, I just wish it was easier to work with LLVM because we've got so many C++ standards and people in that orbit here 🙂

My original post isn't a jobs post, it's a "hey I do this shit as a hobby, please let me help people, the CMake out there is awful 😭"

Hi, sorry for the necro comment, but I finally got around to pinging Petr via email. Assuming my protonmail address doesn't go to trash/spam automatically. (I couldn't find a better avenue to get in touch with him 😅)

Hmmm. This week has been pretty busy according to the shared calendar (back to back meetings), so could just have missed it.

This cohost thread is not the best place to give email addresses out in the open. Do you have a private message system you prefer?

If you want to go through with this, at least.

After reading your blog post I'm starting to think that jai's idea of using jai to build jai projects is the correct way to go. Maybe instead of cmake we should just write C programs to build C programs.

This is all well and good until you need to integrate tools from other languages and then you get the issue that Rust has where you're running someone else's build.rs on your system and they have 0 concept of someone using a Windows machine, or that you might have an environment variable for customization, so on and so forth.

If you're really unlucky you have 0 control over the build system like Go, and then you're using magic comments to compile C code and bind it to golang. 😔