From 5a6f39dae4ac00f6a8d322c862de995b09e56bd1 Mon Sep 17 00:00:00 2001 From: Felix Ableitner Date: Fri, 12 Jun 2020 15:29:50 +0200 Subject: Various build optimizations --- docs/src/contributing_docker_development.md | 15 +++++++++++++-- docs/src/contributing_local_development.md | 6 ++++++ 2 files changed, 19 insertions(+), 2 deletions(-) (limited to 'docs') 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). -- cgit v1.2.3