DEV Community

Cover image for Rapid building with Rust on Windows for WLS2
Michael
Michael

Posted on

Rapid building with Rust on Windows for WLS2

Fast Build on Windows for WLS2

This is a quick post y'all! less than 2m read!

Credit markentier.tech with their post here!

Background

I have been struggling compiling on windows with incremental builds & they take forever. After doing lots of Googling I stumbled across the post from markentier.tech. After doing some testing my compile times on a large project for Valheim went from 3-5 minutes to 30 seconds. Back to those beautiful compile times like on my Linux dual boot!

Setup

  1. Install make and rsync
  2. Copy the following Makefile into your repo
  3. Run make wsl.build

Conclusion

This moves your files into a temp directory on your Linux sub-system which allows it to compile directly without the jank of cross system. After compilation it rsyncs only the outputs needed to your target directory if you are using it docker builds or other.

Heroku

Simplify your DevOps and maximize your time.

Since 2007, Heroku has been the go-to platform for developers as it monitors uptime, performance, and infrastructure concerns, allowing you to focus on writing code.

Learn More

Top comments (1)

Collapse
 
frederikhors profile image
frederikhors

Do you use this for "edit-compile-run" development cycle too?

So on each edit on a file you rsync files and compile time on Linux? And what about "cargo run" command?

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay