News for hackers. Stuff that matters.
Re:Show HN: Fleet – Experimental build tool for Rust that’s ... by vladvasiliu on Saturday April 23, 2022 @09:33AM (#31134109)
The site and repo readme are quite light on details on how this works.

Does it do anything else besides using sccache and lld/zld? I'd expect so, since these tools don't require rust nightly, whereas fleet does.

---

Edit:

After a quick look over the code, it also sets codegen units to 256, but doesn't seem to do anything else.

I see the same improvements adding manually sccache and mold to ~/.cargo/config.toml when building volt, without touching the repo's Cargo.toml.

standard rust config: 1m20s

sccache + mold: 30s

I ran the tests with Rust 1.60.0, on Linux, on an AMD 5850U (6 core, mobile).

Re:Show HN: Fleet – Experimental build tool for Rust that’s ... by XtremeDevX on Saturday April 23, 2022 @09:46AM (#31134226)
It also uses ramdisk on WSL or for those who use hard-drives for builds.

Also great question about using nightly, we're using a shared-generics flag that requires nightly (and speeds up build times).

We're working on making this more configurable to enable / disable what features you want.

Re:Show HN: Fleet – Experimental build tool for Rust that’s ... by vladvasiliu on Saturday April 23, 2022 @09:52AM (#31134274)
> It also uses ramdisk on WSL or for those who use hard-drives for builds.

Yeah, I skipped over this, considering that most people doing rust dev will likely have some kind of SSD.

I didn't look into how you went about doing this, but one thing that I'd like is to be able to move the target/ directory on a ram disk, or, generally, out of the source root [0]. If Fleet were able to do this transparently, it would be really great.

---

[0] I know it's possible to define an external directory, but it applies to all projects, and it's not what I want, because shared crates would go overwrite each other.

Re:Show HN: Fleet – Experimental build tool for Rust that’s ... by VarunPotti on Saturday April 23, 2022 @10:02AM (#31134361)
Yep we also create a unique id for each project so that you can run 2 different rust apps during the same session, or else 1 rust projects build files would be mixed with the others how we go about this is we create a directory /dev/shm/<uuid> and symlinking this created directory into the rust projects target dir
Re:Show HN: Fleet – Experimental build tool for Rust that’s ... by vladvasiliu on Saturday April 23, 2022 @10:09AM (#31134405)
Do you think this could be somehow integrated with Cargo to be run with `cargo build`?

The reason I'm asking is that I use the IntelliJ plugin for Rust dev which is kind of clunky and only understands a few commands as being "build", so it doesn't show the build window.

Re:Show HN: Fleet – Experimental build tool for Rust that’s ... by XtremeDevX on Saturday April 23, 2022 @09:56AM (#31134307)
This is exactly what we do, move the target/ directory on a ramdisk.
Re:Show HN: Fleet – Experimental build tool for Rust that’s ... by XtremeDevX on Saturday April 23, 2022 @09:55AM (#31134300)
Our main goal building fleet was to make it really easy to have an optimized CI/CD pipeline and local development process for faster builds.

Our go-to linker was actually mold until we realized that their license is not compatible with ours.

We also use shared-generics to try to speed up builds, along with the ramdisk that I previously mentioned.

Re:Show HN: Fleet – Experimental build tool for Rust that’s ... by Klasiaster on Saturday April 23, 2022 @11:34AM (#31135137)
Sounds interesting, do you want to share the ~/.cargo/config.toml entries?
Re:Show HN: Fleet – Experimental build tool for Rust that’s ... by vladvasiliu on Saturday April 23, 2022 @11:45AM (#31135259)
Sure, but they're nothing special, just lifted the recommendations from sccache and mold.

sccache: https://github.com/mozilla/sccache#usage

mold: https://github.com/rui314/mold#how-to-use

My own cargo.toml:

  [build]
  rustc-wrapper = "/usr/bin/sccache"
  
  [target.x86_64-unknown-linux-gnu]
  linker = "clang"
  rustflags = ["-C", "link-arg=-fuse-ld=/usr/bin/mold"]
Re:Show HN: Fleet – Experimental build tool for Rust that’s ... by pedrocr on Sunday April 24, 2022 @06:01AM (#31142629)
The 5850U is the 8 core part. Maybe you mean 5650U?
Re:Show HN: Fleet – Experimental build tool for Rust that’s ... by vladvasiliu on Sunday April 24, 2022 @11:13AM (#31144793)
You're correct, it was a typo.