<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Rust on Xerxes II's Blog</title><link>/en/tags/rust/</link><description>Recent content in Rust on Xerxes II's Blog</description><generator>Hugo</generator><language>en</language><lastBuildDate>Mon, 06 Apr 2026 00:00:00 +0000</lastBuildDate><atom:link href="/en/tags/rust/index.xml" rel="self" type="application/rss+xml"/><item><title>Cross-Compiling Rust Projects to FreeBSD with cargo-zigbuild</title><link>/en/posts/cross-compile-rust-freebsd-zigbuild/</link><pubDate>Mon, 06 Apr 2026 00:00:00 +0000</pubDate><guid>/en/posts/cross-compile-rust-freebsd-zigbuild/</guid><description>&lt;p&gt;Notes on cross-compiling a Rust project from Linux (x86_64) to FreeBSD x86_64 using &lt;code&gt;cargo-zigbuild&lt;/code&gt;, and the pitfalls I ran into along the way. The project is a Discord bot that depends on crates like &lt;code&gt;sysinfo&lt;/code&gt;, &lt;code&gt;tikv-jemallocator&lt;/code&gt;, and &lt;code&gt;sea-orm&lt;/code&gt; (SQLite).&lt;/p&gt;
&lt;h2 id="background"&gt;Background&lt;/h2&gt;
&lt;p&gt;Zig ships with a multi-platform libc and cross-compilation toolchain. &lt;code&gt;cargo-zigbuild&lt;/code&gt; leverages Zig as the linker to enable Rust cross-compilation — usually much more convenient than setting up a cross toolchain yourself. That said, targeting FreeBSD comes with some unique gotchas.&lt;/p&gt;</description></item><item><title>How I Improved My Rust Compilation Experience</title><link>/en/posts/optimize-rust-compile-time-space/</link><pubDate>Mon, 06 Apr 2026 00:00:00 +0000</pubDate><guid>/en/posts/optimize-rust-compile-time-space/</guid><description>&lt;p&gt;Slow compilation and massive &lt;code&gt;target/&lt;/code&gt; directories — the classic Rust complaints. This post documents the techniques I&amp;rsquo;m currently using to make things better, using my project &lt;a href="https://github.com/Xerxes-2/clewdr"&gt;ClewdR&lt;/a&gt; (an async web service with 394 crate dependencies) as an example.&lt;/p&gt;
&lt;p&gt;Environment: Rust 1.94.1, CachyOS (Arch-based), NVMe SSD, Btrfs.&lt;/p&gt;
&lt;h2 id="rust-lld"&gt;rust-lld&lt;/h2&gt;
&lt;p&gt;Linking is the final step of Rust compilation, and traditionally the slowest. GNU ld performs terribly here, especially with LTO enabled.&lt;/p&gt;
&lt;p&gt;The old approach was to manually install &lt;code&gt;lld&lt;/code&gt; or &lt;code&gt;mold&lt;/code&gt; and configure &lt;code&gt;.cargo/config.toml&lt;/code&gt;:&lt;/p&gt;</description></item></channel></rss>