Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,10 @@ updates:
cooldown:
default-days: 7
semver-major-days: 14
- package-ecosystem: rust-toolchain
directory: /
labels:
- dependencies
- rust-toolchain
schedule:
interval: weekly
9 changes: 9 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -380,3 +380,12 @@ The following tooling is available in this environment:

These practices help maintain a high-quality codebase and facilitate
collaboration.

## Fast development builds

`make dev-build` and `make dev-test` compile with the opt-in Cranelift
backend and the mold linker configured in `tools/dev-fast/config.toml`.
They require a nightly toolchain and, on Linux, a `mold` binary on the
`PATH`. The fragment is passed explicitly with `--config`, so release,
coverage, and verification builds are unaffected; never copy its contents
into `.cargo/config.toml`, which Cargo applies to every build.
11 changes: 11 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,14 @@ rust-audit: ## Audit the Rust workspace for known vulnerabilities
help: ## Show available targets
@grep -E '^[a-zA-Z_-]+:.*?##' $(MAKEFILE_LIST) | \
awk 'BEGIN {FS=":"; printf "Available targets:\n"} {printf " %-20s %s\n", $$1, $$2}'

# Opt-in accelerated debug builds (Cranelift + mold); requires a nightly
# toolchain. See AGENTS.md and tools/dev-fast/config.toml.
DEV_FAST_CONFIG ?= tools/dev-fast/config.toml

.PHONY: dev-build dev-test
dev-build: ## Build debug binaries with Cranelift and mold
cargo --config "$(DEV_FAST_CONFIG)" build

dev-test: ## Run tests with Cranelift and mold
cargo --config "$(DEV_FAST_CONFIG)" test
31 changes: 31 additions & 0 deletions tools/dev-fast/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Canonical opt-in Cargo configuration fragment for accelerated local debug
# builds.
#
# This configuration is deliberately kept out of `.cargo/config.toml`.
# Cargo auto-discovers that path, so anything placed there applies to
# release packaging, coverage, and verification builds, which must keep
# the supported LLVM backend and platform linker. In a consuming
# repository this fragment lives at `tools/dev-fast/config.toml` and is
# passed explicitly with `cargo --config tools/dev-fast/config.toml ...`
# from `make dev-build` and `make dev-test`.
#
# Repositories that set repository-wide `rustflags` in `.cargo/config.toml`
# must restate them in the target table below. Cargo joins the rustflags of
# every matching `[target.*]` entry (target-triple and `cfg` tables alike),
# but the joined target rustflags take precedence over `[build].rustflags`
# rather than merging with it.

[unstable]
codegen-backend = true

# Cranelift trades runtime performance for compile speed, so it applies to
# the dev profile only. The `make dev-*` targets never build release
# artefacts.
[profile.dev]
codegen-backend = "cranelift"

# mold ships for Linux only, so the flag is gated behind a target `cfg`. On
# macOS and Windows the table simply does not apply and the platform default
# linker is used.
[target.'cfg(target_os = "linux")']
rustflags = ["-Clink-arg=-fuse-ld=mold"]
7 changes: 7 additions & 0 deletions typos.local.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ accepted = []

[patterns]
ignore = [
# "mold" names the linker (https://github.com/rui314/mold) in these
# contexts only; the mould correction stays active elsewhere.
"-fuse-ld=mold",
"mold linker",
"Cranelift \\+ mold",
"Cranelift and mold",
"`mold`",
# Official documentation name.
'Azure Architecture\s+Center\s+\|\s+Microsoft Learn',
# Public design identifiers are exact API names.
Expand Down
5 changes: 5 additions & 0 deletions typos.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,14 @@ extend-ignore-re = [
"(?m)^### HookArtifact and HookSubscription$",
"(?m)^use tokio::runtime::RuntimeFlavor;$",
"(?s)```.*?```",
"-fuse-ld=mold",
"Azure Architecture\\s+Center\\s+\\|\\s+Microsoft Learn",
"Cranelift \\+ mold",
"Cranelift and mold",
"\\brust-analyzer\\b",
"`[^`\\n]+`",
"`mold`",
"mold linker",
]

[default.extend-words]
Expand Down
Loading