Skip to content

Commit

Permalink
add sccache section
Browse files Browse the repository at this point in the history
  • Loading branch information
spacejam committed Mar 19, 2019
1 parent 3653853 commit 569e41c
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions README.md
Expand Up @@ -11,6 +11,7 @@ A collection of software engineering techniques for effectively expressing inten
- [Ergonomics](#ergonomics)
* [Unification and Reading the Error Messages That Matter](#unification-and-reading-the-error-messages-that-matter)
* [Write-Compile-Fix Loop Latency](#write-compile-fix-loop-latency)
* [Caching with sccache](#caching-with-sccache)
* [Editor support for jumping to compiler errors](#editor-support-for-jumping-to-compiler-errors)
- [Lockdown](#lockdown)
+ [Never](#never)
Expand Down Expand Up @@ -145,6 +146,19 @@ cargo watch -s 'clear; cargo check --tests --color=always 2>&1 | head -40'

This way I just save my code and it shows the next error.

## Caching with sccache

`sccache` is a tool written by Mozilla that supports `ccache`-style build caching for Rust. This is particularly useful if you frequently clean and build projects with lots of dependencies, as normally they would all need to be recompiled, but with `sccache` they will be stored and used to back a cache that is accessible while building any project on your system. It takes care to do the right thing in the presence of different feature flags, versions etc... For projects with lots of dependencies it can make a huge difference over time.

The installation is simple:

```
cargo install sccache
export RUSTC_WRAPPER=sccache
```

It can also be configured to use a remote cache like s3, memcached, redis, etc... which is quite useful for building speedy CI clusters.

## Editor support for jumping to compiler errors

To go even farther than the last section, most editors have support for jumping to the next Rust error. In vim, you can use the `vim.rust` plugin in combination with Syntastic to automatically run rustc when you save a file, and to jump to errors using a keybind. Emacs users can use `flycheck-rust` for similar functionality.
Expand Down

0 comments on commit 569e41c

Please sign in to comment.