![](https://mastodon.top/system/accounts/avatars/109/052/938/988/286/704/original/13d1bd813e6c4bb2.jpg)
2024-04-21 19:07:32
Faster linking times on nightly on Linux using `rust-lld` #rust
https://blog.rust-lang.org/2024/05/17/enabling-rust-lld-on-linux.html
I like to minimize the size of binaries I build. Unremovable debugging strings annoyed me, so I've added an option to completely neuter `Debug::fmt` in #Rustlang
https://github.com/rust-lang/rust/pull
#RustLang / Cargo support in #Gentoo has received a lot of optimizations over time.
Does that sound like a good thing? I'm afraid it isn't: it's just saying how *bad* the ecosystem is, that we have to keep adding hacks to make it even remotely usable.
For a start, we immediately gave up on packaging the dependencies separately. After all, we're talking about a humongous effort, creating thousands of Gentoo packages whose only purpose would be delivering sources that would be only linked statically into executables. Lot of effort, lot of space waste, no gain. Instead, every Rust package carries a huge list of crates it needs, and a humongous Manifest listing yet another set of copies of checksums for these crates.
We are strongly relying on mirroring crates on Gentoo mirror infrastructure. Why? Because crates.io is uselessly slow. On top of that, Portage normally does fetching in series, so grabbing hundreds of crates takes half an eternity. In fact, I've even made #PyCargoEbuild use aria2 to fetch new crates from crates.io in parallel to work around this.
I have recently added a hack to unpack crates in parallel, because even unpacking all of them is awfully slow. Ironically, the crates that seem to take most of the time to unpack are these responsible for Windows support.
PyCargoEbuild also has a function to repack all dependent crates into a single tarball that we redistribute. Why? Because some packages have so many dependencies that listing them all makes ebuilds and their Manifests humongous. For every package like that, *all* Gentoo users suffer a significant growth in repository size, even if they are never going to use the package in question. So instead of listing and fetching crates, we fetch a ready-made crate tarball. Which is also much smaller than all crates combined, and therefore faster to fetch and unpack (though I haven't compared this to parallel unpacking).
Oh, perhaps I should have mentioned first that Cargo is one of the few ecosystems that simply cannot be packaged without creating dedicated tools to prepare and update the ebuilds.
But yeah, Rust is awesome.
Envconfig is a #Rust library that helps to initialize configuration structure from environment variables
https://docs.rs/envconfig/latest/envconfig/
Oh right, I wrote a new #rustlang blog post about testing.
Rust Unit and Integration Testing in #RustRover
This is quite fascinating: #Rust
Accumulating Results in #Rust With Validated
https://beachape.com/blog/2016/10/24/accumulating-results-in-rust-with-validated/
I'm happy to announce I will be speaking at #RustFestZurich this year. My talk is about Linon, a graphical #RustLang application I began writing during my MSc studies at @…
Jest sobie zespół o nazwie Monolord, i ten zespół ma piosenkę (i album) pod tytułem "#Rust". Całkiem dobry kawałek muzyki. A do tego słowa "Jest tylko ból, nienawiść, chciwość i smutek" doskonale pasują do moich odczuć jako programisty (nieużywającego Mono, ani Rusta).
These is one of these days when it occurs to you: "hey, packages using #Python and #RustLang, may have *both* Python and Cargo-level tests." And then you spend a lot of time going over all Rust-enabled dev-python/* packages and adding `cargo_src_test` where appropriate.
As it turns out, many of them did. Most of these don't actually link to libpython, so I suppose it's fine to test them once. Pydantic-core does, so I test per-impl (but also can't test on PyPy). Cryptography has Rust-level tests that don't even build (they fail at linking).
#Gentoo
Frunk, #FunctionalProgramming toolbelt in #Rust
https://github.com/lloydmeta/frunk
We're excited to share how #OpenTelemetry enhances observability in #Rust applications later today! 🦀
We'll be diving into setup and practical examples. Perfect for Rustaceans looking to elevate their monitoring game. Stay tuned for the full article!
New #RustLang projects are popping up all over the place. Many of them quickly reach feature parity with their non-Rust predecessors, then beat them both in functionality and performance. Seeing all this, it's hard not to think of Rust as a language that makes rapid development and deployment possible, and that outperforms other programming languages.
While I won't argue that Rust has its advantages, that's not the real reason here. In my opinion, it's all about its popularity. All the cool kids use Rust nowadays, and cool kids are precisely the kind of people who have time and energy to develop stuff rapidly. Add to that corporations investing in the next boom, and delivering a full-time paid workforce and funding, the culture of code reuse (i.e. sharing lots of crates), and last but not least, the benefit of starting from scratch.
Old folk like us, who barely manage enough energy to keep things alive, can't compete with that. However, we have one advantage. We don't care about being cool anymore. We aren't going to pack our bags and run after the next shiny thing, whenever the next best thing since sliced bread gets invented.
#Gentoo #OpenSource
Parsing structured environment variables in #Rust
https://blog.frankel.ch/structured-env-vars-rust/
The Mediocre Programmer's Guide to #Rust
https://www.hezmatt.org/~mpalmer/blog/2024/05/01/the-mediocre-programmers-guide-to-rust.html…
Ok, so I'm trying something out…
#XEMU #Xbox #OriginalXbox #Rust
What’s neat about #JetBrains #Fleet is the polyglot nature of it. I'm writing a #rustlang library that I later consume in a
Crate itertools: extra iterator adaptors, functions and macros for #Rust
https://docs.rs/itertools/latest/itertools/
There's a band called Monolord, and they have a song (and an album) called "#Rust". And it's pretty good. And the lyrics "There's only pain, hate, greed and sorrow" definitely fits my feelings as a (not Rust, neither Mono) programmer.
#DoomMetal #StonerMetal #metal #MusicRecommendation
Am I missing something or is it basically impossible to have `cargo update` actually select dependencies that are acceptable for the specific minimal `rust-version`? Like, even if you install old #RustLang version, `cargo update` from this version will update `Cargo.lock` to dependencies that require a newer Rust version and render the package non-buildable?
So yeah, I suppose you either end up requiring newer Rust (but you don't really know which version, since you don't know what's the highest minimal requirement in your dependencies), or you update `Cargo.lock` by hand. Such a great tooling!
#Gentoo
Please don't use #Mercurial. It's not well-maintained software.
People like to point out that Mercurial works great for a few BigTech corporations. That's great for them. The side effect is that the development is focused on these corporations, and if you find a bug that doesn't affect them, you better be ready to provide a fix yourself.
#Python 3. The first release with Python 3 was made *two months* before Python 2 went EOL.
#RustLang. Funny thing is, Mercurial with Rust extensions enabled still doesn't work on Python 3.12. Apparently, they've chosen to use some NIH Python/Rust bridge rather than PyO3.
#Gentoo
It's been a while since I've complained about #RustLang itself, so…
Cargo insists on interacting with #git repositories. At the same time, cargo insists on vendoring an old version of #LibGit2 (1.6.2 FWICS). So, if your system is using a new git version (2.44.0), you won't be able to `cargo build`:
```
error: failed to determine package fingerprint for build script for uv v0.1.38 (/tmp/uv/crates/uv)
Caused by:
failed to determine the most recently modified file in /tmp/uv/crates/uv
Caused by:
failed to determine list of files in /tmp/uv/crates/uv
Caused by:
failed to open git index at /tmp/uv/.git/
Caused by:
invalid data in index - calculated checksum does not match expected; class=Index (10)
```
You have to clone everything with `-c index.skipHash=false` to work around this.
But yeah, I'm sure there's a great benefit to using an outdated vendored C library that NIHs git.
#Gentoo #NIH
#RustLang is doing great!
You've probably heard that #uv is the future of #Python packaging. Unfortunately, it indirectly depends on "ring" crate. Ring uses a lot of non-portable C/Assembly, effectively meaning that uv only runs on a handful of architectures (much fewer than Rust itself, and I've been complaining about Rust…).
Well, there are some good news. Rustls 0.23 no longer uses ring by default, so there's hope. But to realize that hope, first all dependency graph must switch to the new Rustls version, people need to make releases, update their locks…
Yes, it's a great design!
#Gentoo
Time for your daily dose of #RustLang complaints. Yep, the ecosystem is doing great.
#UV depends on tokio-tar library. Tokio-tar is broken on #PowerPC, doesn't have a bug tracker (!) and seems to be quite dead, with a bunch of PRs ignored since 2022 (last activity mid-2023). Nevertheless, I've filed a PR to fix PowerPC, with little hope that it'll be merged, released and that we could get UV working on PowerPC.
On top of that, it seems that tokio-tar was forked in early 2021 from async-tar. It doesn't seem to have synced the few commits from 2021, and async-tar is dead since late 2021. But at least it has a bug tracker to keep track of how dead it is.
Rewriting stuff in Rust is great. Maintaining it afterwards for the sake of reverse dependencies isn't.
#Gentoo #Python