Skip to content

Commit

Permalink
[meta] add a workspace-hack package managed by hakari (#4154)
Browse files Browse the repository at this point in the history
Similar to oxidecomputer/crucible#956, this adds
a workspace-hack package managed by cargo-hakari. This should massively
cut down on incremental build times.

`cargo hakari` doesn't yet support writing out `workspace-hack`
dependency lines using workspace inheritance
(guppy-rs/guppy#7), so skip over it in the
lint.

Reverting this change can be done by following the instructions at https://docs.rs/cargo-hakari/latest/cargo_hakari/#disabling-and-uninstalling.
  • Loading branch information
sunshowers authored Sep 28, 2023
1 parent 8602e46 commit 8fb68a2
Show file tree
Hide file tree
Showing 73 changed files with 589 additions and 21 deletions.
29 changes: 29 additions & 0 deletions .config/hakari.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# This file contains settings for `cargo hakari`.
# See https://docs.rs/cargo-hakari/latest/cargo_hakari/config for a full list of options.

hakari-package = "omicron-workspace-hack"

# Format for `workspace-hack = ...` lines in other Cargo.tomls. Requires cargo-hakari 0.9.8 or above.
dep-format-version = "4"

# Setting workspace.resolver = "2" in the root Cargo.toml is HIGHLY recommended.
# Hakari works much better with the new feature resolver.
# For more about the new feature resolver, see:
# https://blog.rust-lang.org/2021/03/25/Rust-1.51.0.html#cargos-new-feature-resolver
resolver = "2"

# Add triples corresponding to platforms commonly used by developers here.
# https://doc.rust-lang.org/rustc/platform-support.html
platforms = [
"x86_64-unknown-linux-gnu",
"x86_64-apple-darwin",
"aarch64-apple-darwin",
"x86_64-unknown-illumos",
# "x86_64-pc-windows-msvc",
]

[traversal-excludes]
workspace-members = ["xtask"]

# Write out exact versions rather than a semver range. (Defaults to false.)
# exact-versions = true
37 changes: 37 additions & 0 deletions .github/workflows/hakari.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# This workflow file serves as an example for cargo-hakari CI integration.

on:
push:
branches:
- main
pull_request:
branches:
- main

name: cargo hakari

jobs:
workspace-hack-check:
name: Check workspace-hack
runs-on: ubuntu-latest
env:
RUSTFLAGS: -D warnings
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Install cargo-hakari
uses: taiki-e/install-action@v2
with:
tool: cargo-hakari
- name: Check workspace-hack Cargo.toml is up-to-date
uses: actions-rs/cargo@v1
with:
command: hakari
args: generate --diff
- name: Check all crates depend on workspace-hack
uses: actions-rs/cargo@v1
with:
command: hakari
args: manage-deps --dry-run
Loading

0 comments on commit 8fb68a2

Please sign in to comment.