From f1e09e3f3f9a53bdb6f6e34e8a46ba7913c299b0 Mon Sep 17 00:00:00 2001 From: Austin Seipp Date: Mon, 10 Jul 2023 02:01:17 -0500 Subject: [PATCH] chore(github): reduce compile time in build, nix, and release workflows Summary: When building in CI, we just build everything from scratch in the `dev` profile, so just turn off debuginfo and incremental compilation data. These aren't reused, but more importantly take up more space and CPU time to generate; that's more expensive on slower machines and when using The Cloud(TM) to build. Together, these take a fresh build (`rm -rf target/` ahead of time) from about 40s to 30s on my machine. Signed-off-by: Austin Seipp Change-Id: Id6e706634dbaf88f6ccd7f457409ad7c --- .github/workflows/build.yml | 4 ++++ .github/workflows/release.yml | 3 +++ flake.nix | 1 + 3 files changed, 8 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c29ec1bde..a9a86a13d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,6 +8,10 @@ on: permissions: read-all +env: + CARGO_INCREMENTAL: 0 + CARGO_PROFILE_DEV_DEBUG: 0 + jobs: build: strategy: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7cf18a5df..537f0182b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,6 +6,9 @@ on: permissions: read-all +env: + CARGO_INCREMENTAL: 0 + jobs: build-release: name: build-release diff --git a/flake.nix b/flake.nix index 194e7df6d..67742e208 100644 --- a/flake.nix +++ b/flake.nix @@ -67,6 +67,7 @@ ZSTD_SYS_USE_PKG_CONFIG = "1"; LIBSSH2_SYS_USE_PKG_CONFIG = "1"; NIX_JJ_GIT_HASH = self.rev or ""; + CARGO_INCREMENTAL = "0"; postInstall = '' $out/bin/jj util mangen > ./jj.1 installManPage ./jj.1