summaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorFelix Ableitner <me@nutomic.com>2020-06-12 15:29:50 +0200
committerFelix Ableitner <me@nutomic.com>2020-06-12 15:29:50 +0200
commit5a6f39dae4ac00f6a8d322c862de995b09e56bd1 (patch)
treee9d7db0f98a47836cd9b9f6080e0ce39a524e567 /docs
parent1b0212377df2e56c4e950a4abbf8c594daabc73a (diff)
Various build optimizations
Diffstat (limited to 'docs')
-rw-r--r--docs/src/contributing_docker_development.md15
-rw-r--r--docs/src/contributing_local_development.md6
2 files changed, 19 insertions, 2 deletions
diff --git a/docs/src/contributing_docker_development.md b/docs/src/contributing_docker_development.md
index 09239821..afa05107 100644
--- a/docs/src/contributing_docker_development.md
+++ b/docs/src/contributing_docker_development.md
@@ -3,11 +3,22 @@
## Running
```bash
+sudo apt install git docker-compose
git clone https://github.com/LemmyNet/lemmy
cd lemmy/docker/dev
-./docker_update.sh # This builds and runs it, updating for your changes
+sudo docker-compose up --no-deps --build
```
and go to http://localhost:8536.
-Note that compile times when changing `Cargo.toml` are relatively long with Docker, because builds can't be incrementally cached. If this is a problem for you, you should use [Local Development](contributing_local_development.md).
+To speed up the Docker compile, add the following to `/etc/docker/daemon.json` and restart Docker.
+```
+{
+ "features": {
+ "buildkit": true
+ }
+}
+```
+
+If the build is still too slow, you will have to use a
+[local build](contributing_local_development.md) instead.
diff --git a/docs/src/contributing_local_development.md b/docs/src/contributing_local_development.md
index f801caf3..066386f5 100644
--- a/docs/src/contributing_local_development.md
+++ b/docs/src/contributing_local_development.md
@@ -56,6 +56,12 @@ Then open [localhost:4444](http://localhost:4444) in your browser. It will auto-
any frontend files. For backend coding, you will have to rerun `cargo run`. You can use
`cargo check` as a faster way to find compilation errors.
+To speed up incremental builds, you can add the following to `~/.cargo/config`:
+```
+[target.x86_64-unknown-linux-gnu]
+rustflags = ["-Clink-arg=-fuse-ld=lld"]
+```
+
Note that this setup doesn't include image uploads or link previews (provided by pict-rs and
iframely respectively). If you want to test those, you should use the
[Docker development](contributing_docker_development.md).