From 88520e685829357aa761df55f17bec4528002f88 Mon Sep 17 00:00:00 2001 From: YetAnotherMinion Date: Sat, 28 May 2022 18:44:21 +0100 Subject: [PATCH] feat: use cargo hakari to reduce crate rebuilds Large workspaces end up with a very large number of possible build configurations. Even worse, the feature set of a package affects everything that depends on it, so syn being built with a slightly different feature set than before would cause *every package that directly or transitively depends on syn to be rebuilt. For large workspaces, this can result a lot of wasted build time. To avoid this problem, many large workspaces contain a workspace-hack crate. The purpose of this package is to ensure that dependencies like syn are always built with the same feature set no matter which workspace packages are currently being built. This is done by: 1) adding dependencies like syn to workspace-hack with the full feature set required by any package in the workspace 2) adding workspace-hack as a dependency of every crate in the repository. cargo-hakari manages a workspace-hack crate for you. --- Cargo.toml | 1 + examples/single-page/Cargo.toml | 1 + 2 files changed, 2 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 8269378..cb63b8a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -48,6 +48,7 @@ oneshot = "0.1.3" # required for livetable derive macro livetable-core = { path = "../../../infra/livetable/core" } +cargo-workspace-hack = { version = "0.1", path = "../../../infra/cargo-workspace-hack" } [dev-dependencies] diff --git a/examples/single-page/Cargo.toml b/examples/single-page/Cargo.toml index 80d6301..dddad0e 100644 --- a/examples/single-page/Cargo.toml +++ b/examples/single-page/Cargo.toml @@ -8,4 +8,5 @@ edition = "2018" crate-type = [ "dylib" ] [dependencies] +cargo-workspace-hack = { version = "0.1", path = "../../../../../infra/cargo-workspace-hack" }