EEE
The systemd project has officially introduced support for developing programs in Rust, following the merger of a pull request submitted by Linux kernel developer Christian Brauner. The change, merged into the project’s main branch, establishes a new development option for systemd while keeping its existing C-based architecture intact.
And before anyone assumes systemd is preparing a complete rewrite in Rust, that’s not the case. The maintainers agreed on a deliberately limited approach: Rust may be used only for new, standalone components that other parts of systemd do not depend on. Existing C code will remain untouched.
Another important decision concerns the build process. Rather than introducing Cargo, Rust’s standard package manager and build tool, systemd continues to use Meson for all builds. This keeps Rust development integrated into the project’s existing build infrastructure.
The implementation also places strict limits on dependencies. Rust programs use the no_std approach, meaning they do not rely on Rust’s standard library or external third-party crates. Instead, they interact with systemd’s existing C libraries through generated bindings.
For memory management, systemd provides its own Rust implementations of common container types, with allocation failures handled explicitly rather than causing the program to abort. The new infrastructure also includes wrappers for logging, command-line argument handling, event processing, and error management, allowing Rust utilities to behave consistently with their C counterparts.
Rust support is optional and automatically detected during configuration. Developers wishing to enable it need Rust 1.85 or later, bindgen 0.71.1 or later, and Meson 1.4 or later. Systems without the required toolchain can continue building systemd without Rust support.
Interestingly, initial tests show that a stripped Rust command-line utility occupies about 32 KB, compared to 20 KB for its C equivalent built with link-time optimization. This gives an early indication of the additional overhead, though the comparison involves only a small test program.
The first planned real-world application of this infrastructure is systemd-keyring-setup, a new utility intended to help manage certificates in Linux kernel keyrings. Its implementation is being developed separately, alongside additional Rust wrappers for systemd’s shared libraries.
For Linux distributions, the change introduces packaging considerations. Builds that enable all available features will need the appropriate Rust compiler and bindgen dependencies or must disable Rust support to avoid build failures.
Whether Rust becomes widely used within systemd will depend on future development, but the necessary groundwork is now in place.



“self-confined” I think my weak English showed up again. I mean projects that has all dependencies in the project itself. And don’t get me wrong, I’m not suggesting to write Regex Parser, GUI system and other huge tasks and put them in the project. If you need those, then its better to use the libraries that are available, with Cargo.
Not every program needs all those dependencies and features. Also relying on those dependencies, that rely on other dependencies and so on can also be a security nightmare. My point is to have those projects that are much more simple, maybe even part of other projects like Python (just a random idea, don’t over analyze that).
Ok, that’s vendoring.
So for example, Rust
regexcrate also tries to prevent duplicating efforts so it also has its own dependencies (like “memchr”, some library for fast dictionary matching, some regex-* modules it’s split into, etc)… Rust packages are very modular with the goal of keeping very simply reusable pieces, and this is what makes something like cargo necessary. If you want to vendorregexby including it into your code, you also need to include those tiny modules.You are right having big dependency trees has risks, but I’d argue that avoiding a dedicated package manager that helps you manage those risks makes that security nightmare worse.
Cargo generates a
Cargo.lockfile that guarantees the version you want will be used, but it also allows devs to runcargo audit, to scan the dependencies against a live database of vulnerabilities. You don’t get any of that when you vendor, and you’ll have to manually actively monitor your dependencies for vulnerabilities anyway. It’s not like including the code of the dependencies in your repo makes the problem go away.Incorrect. Vendoring done right (via
replace-with, as done bycargo vendor) is not mutually exclusive with the rest of the tooling. You can have both.True. But you still need to configure cargo there, the vendoring he’s talking about is one where cargo is not used.
And both are still not mutually exclusive. Just like how in C or C++ projects you can both use a proper build system, and still have Makefile(s) around (as fallback, or used as simple runners, or also for tooling reasons).
Putting vendoring aside, using and not using
cargois itself not an either or. Some projects that incorporate Rust as a non-primary language can still use their own build system, and yet still optionally have cargo around for tooling reasons (e.g. to make LSP just work without much hassle), both at the same time. See this demo for an example (mesonfor actual building,cargofor tooling/development).I also have no idea why you exchanged this long with a person who clearly lacks basic knowledge. But maybe I grew more abrasive and less patient than the average person with my greying hair.
You are agreeing with me. I didn’t mean they were mutually exclusive. What I said is that avoiding a dedicated tool like cargo that helps you manage those risks makes the security issues worse.
Yeah sure.
The problem with those people is that they don’t actually know how any software is really built. Even in their simple “Makefile” supposed utopia, tools like
pkg-config, just to name one example, could be running from behind their backs, and they wouldn’t know what that is, that it’s getting executed, and what purpose is it serving in the build process.That’s true if you try to replicate the same program without Cargo. But that’s not what I am suggesting. If you don’t need regex and all the dependencies, then you don’t need Cargo. And this could encourage to write programs without all these dependencies. Also Cargo is deeply integrated into Rust, but Rust is not deeply integrated (speak no dependency) to Cargo. I know of all the features and why Cargo is fantastic, I love it myself.
But one has nothing to do with the other. My suggestion is for tools and code that doesn’t need these dependencies. I am not suggesting to replicate the same work or features as when doing huge applications with Cargo and dependencies. We can write programs with stdlib only, hell even without stdlib (technically, I’m not suggesting this as the new normal).
Ok, then we are back to what I said earlier, unlike python / c++, you are likely gonna need dependencies in rust.
regexwas just an example…Perhaps you can manage without dependencies if you use rustc for very basic things or for pieces in an otherwise C project (like Linux), or maybe for some particular rare scenarios that require it being “freestanding”, but you’d be in the minority. If this was a significant usecase then we would indeed have a
rustcpackage in archlinux… in the meantime you would need to homebrew yourself a rustc aur package if you really want to have rustc without having cargo.Using Rust as some freestanding - side thing is not the common usecase, I don’t think adding a rustc package would make that usecase more popular. We do have a rustc package in Debian, I believe. And it’s not like having to install cargo in archlinux somehow makes it mandatory to use it.
As I said, not if you don’t need dependencies.
Because there is no infrastructure supporting this. Why would anyone write Rustc only programs, if there is no such package and widespread availability?
As I said, there’s only a minority of cases where that’s possible and/or advisable.
Because people still need to write such programs for those minority use cases (and if there was no need, then they should not write them).
And rustc is in fact widely available. Whenever there’s need for no-dependencies “freestanding” software (which has a specific meaning, it’s not the same as your “self-confined”) or rust being on the side (ie. like Linux kernel), people have no problems to use rustc (if it fits their toolchain better). It being packaged together with cargo does not stop rust devs from using rustc when it’s appropriate to do so.
I find it hard to believe that you legitimately do think that the one thing stopping people from using rustc for these usecases is that archlinux happens to include cargo in the same “rust” package that provides rustc.
Did you know that there’s no g++ package in archlinux either? it’s bundled in the gcc package… do you think that means that there’s no widespread availability of g++ in Archlinux?
Debian does have a dedicated rustc package, is writting “rustc only programs” more widespread in Debian?
I’m not saying it stops people from using rustc only. I think there is a huge misunderstanding here. Currently, its just highly specialized use cases where they have to use rustc only without even the standard library (I think the Linux Kernel doesn’t use the stdlib). What I say is, that the current infrastructure and distributions doesn’t treat rustc+stdlib as its own thing, that nobody will target it and everyone assumes Cargo.
In example there is no rustc+stdlib compiler as a package by distributions. This should be a standard package by all distributions in my opinion, just like we have C compilers doing the most basic thing. From packaging standpoint. This would encourage people to do such projects, as if you just require basic tools that are not always installed, but can be assumed to easily install. It also should have less dependencies than Cargo and rustfmt in example, or even rustup.
I think the g++ comparison doesn’t hold here, because it’s not the only way of using the language. Rust on the other hand has only one other way of doing this, it’s the dependency heavy and full package with cargo and the rest, even usually downloading dependencies and and so on. It’s a full package manager. If g++ was the only alternative to such a system, I think it would have more widespread adoption.
Well it needs to be a standard in most common distributions. No one wants to rely on something that is found in one distribution only.
That’s just what you believe, not something you can prove. In fact, if anything, it’s easier to assume rustc is present than it is to assume cargo is present, because cargo needs rustc, but rustc does not need cargo… so if you really were looking for the most universal cross-distro assumption, then it would make more sense to assume rustc (which has to be installed to have cargo anyway) than to assume cargo.
I’m not sure what do you even mean by “use”… are you saying if I find a way to “use” rust without achlinux rust package then it’s ok for it to bundle cargo?
A lot of things aren’t standard across distros. The way the 32bit variants of gcc are packaged between distros is also not a universal standard… do you think nobody wants to rely on it only because you need to check what name for the package corresponds to your distro?
How many distros do you need to follow the same approach to consider it “standard”?
Debian doing this means that essentially all apt-get based distros follow the same approach of separating rust and cargo (Ubuntu, Mint, and all the variations).
Also in Fedora / RHEL / AlmaLinux / Rocky Linux… “rust” contains rustc, cargo is split to its separate “cargo” subpackage.
Also Alpine Linux, cargo is a separate package from rust.
Void Linux, also cargo separate package from rust,
NixOS, has pkgs.rustc and pkgs.cargo as separate derivations.
No. Because if there was rustc+stdlib as a package to install, then we could make the argument. But if Cargo is the only package available with rustc, then there is no point in making this argument. In most distributions there aren’t rustc+stdlib only package.
The point is, not having Cargo and all the other rest of the systems to install when installing rustc. Sorry, but am I talking Chinese? (and yes, I get impatient.)
I explained it following that quote. I’m trying. You bring g++ as an argument why its not widespread adopted. Because g++ is not the only alternative to something like a package manager like Cargo. Nobody “needs” g++. There are many ways of compiling Cpp, even without using a package manager. So nobody has to use g++ to avoid something like Cargo and all the other stuff.