Rust support in Replit

Not sure what I’m doing wrong, but here are two problems I’ve had with rust in replit:

  • Cargo getting stuck on “updating registry”
  • Rustc not supporting wasm target (getting errors about the ‘core’ module not installed)

For the first one I was just wondering why each repl has its own registry? Like, shouldn’t there be one shared registry for every repl so that updating doesn’t take forever?

The second issue is probably with my .nix config, so if anyone knows how to enable wasm32 support in rustc with nix, help is appreciated.



For now I have this as a workaround (it’s really ugly and wasteful though)

--- .replit.old
+++ .replit
@@ -2,6 +2,9 @@
 hidden = ["target"]
 entrypoint = "src/"
+CARGO_HOME = "/home/runner/$REPL_SLUG/.cargo"
 language = "rust"