Conditional compilation to avoid cross compilation

This page summarizes the projects mentioned and recommended in the original post on /r/rust

Our great sponsors
  • SonarLint - Clean code begins in your IDE with SonarLint
  • InfluxDB - Access the most powerful time series database as a service
  • SaaSHub - Software Alternatives and Reviews
  • cross

    “Zero setup” cross compilation and “cross testing” of Rust crates

    I'm not sure who needs to see this, but I had been struggling with compile times using cross + Docker Desktop on Mac while working on a small personal project the past few days. Despite the whole project being fewer than 350 LOC between a few files, recompiling the project with any change was taking upwards of 2 minutes through cross. I went through the due diligence of reducing the number of dependencies, removing features and macros that I didn't need, not compiling in release mode, trying different file sharing implementations for Docker Desktop and with all of that combined the time dropped to around 1 minute and 30 seconds for an incremental build. Still far from ideal for a small personal project.

  • cargo-zigbuild

    Compile Cargo project with zig as linker

    Perhaps you can try cargo-zigbuild, it uses zig-cc for cross-compilation instead of creating a container, so it should be much more lightweight on MacOS, without all the cost of virtualization and file sharing.

  • SonarLint

    Clean code begins in your IDE with SonarLint. Up your coding game and discover issues early. SonarLint is a free plugin that helps you find & fix bugs and security issues from the moment you start writing code. Install from your favorite IDE marketplace today.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts