Posts tagged: rust

Toolforge Rust tutorial

I wrote a tutorial on how to deploy a #Rust web application on Wikimedia's #Toolforge platform: https://wikitech.wikimedia.org/wiki/Help:Toolforge/My_first_Rust_toolIt uses #Rocket and demonstrates how to make queries against #Wikipedia's MariaDB replicas.

Generating Rust types for MediaWiki API responses

I just released version 0.2.0 of the mwapi_responses crate. It automatically generates Rust types based on the query parameters specified for use in MediaWiki API requests. If you're not familiar with the MediaWiki API, I suggest you play around with the API sandbox. It is highly dynamic, with the user…

cargo-hack is the coolest

cargo-hack is the coolest #Rust testing tool I've learned about so far: . With a few parameters, you can test every feature combination as well as against a version range of Rust versions. My CI is now twice as slow, but I'm actually verifying each feature works, and the MSRV…

Cross-building Windows binaries in Rust

It was surprisingly simple to set up cross-building for #Windows binaries on my #Rust projects in CI: https://gitlab.com/legoktm/rust-ci-pipeline/-/commit/21c61d0412e6636c110fbd0461908c93ff5eda7cAnd the one place I was using Unix-specific code has been caught at compile time \o/Whenever I make new releases, Windows binaries will be uploaded by CI, but in the meantime here's my…

prometheus-airnow-exporter

New project: prometheus-airnow-exporter scrapes air quality info for your zip code from AirNow.gov's APIhttps://lib.rs/crates/prometheus-airnow-exporterThrew it together pretty quickly as a PoC to see if I could set up alerting when the air gets bad.#airnow #prometheus #californiaproblems

fridge-backup

Couldn't find a #btrfs snapshot backup tool that I liked so I just wrote my own: https://crates.io/crates/fridge-backupIt automatically takes daily snapshots and then you copy them to external drives, that's it. (Automatic cleanup is a TODO)Also, you should put your butter in the fridge so it doesn't go bad.

Wikimedia CI now supports Rust

Wikimedia CI now supports #rustlang projects! https://phabricator.wikimedia.org/T256827#6396091It's simple for now: it'll run rustfmt, clippy, tests and then generate/publish coverage reports and documentation post-merge. More features/checks can be added as people need and request :)

Speeding up Toolforge tools with Redis

Over the past two weeks I significantly sped up two of my Toolforge tools by using Redis, a key-value database. The two tools, checker and shorturls were slow for different reasons, but now respond instantaneously. Note that I didn't do any proper benchmarking, it's just noticably faster. If you're not…

Learning Rust, week 5

I'm skipped writing a post for week 4 and then didn't do any Rust related things for a week, so this is my week 5 update. The main (published) Rust I've written since my last post is a port of my w.wiki statistics Toolforge tool. It reads through compressed plaintext…

Learning Rust, week 3

I'm a little behind with this update as it took me a little longer to prepare and launch my project: diff-libraries. I'm planning to write a more detailed post on that later, but it's my most involved Rust project so far. The webserver is powered by Rocket and it uses…

Learning Rust, week 2

I think I'm starting to understand why people like Rust so much. The tooling, especially rustup and cargo are pretty fantastic. The fact that rustfmt (code auto-formatter), clippy (linter) and a test runner are all integrated through cargo is super convenient. I feel like Python used to have that with…