diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 8ca40762..302957ab 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -36,8 +36,16 @@ updates: labels: - "dependencies" - "python" + - "pip" schedule: interval: "daily" cooldown: default-days: 7 semver-major-days: 14 + - package-ecosystem: rust-toolchain + directory: / + labels: + - dependencies + - rust-toolchain + schedule: + interval: weekly diff --git a/AGENTS.md b/AGENTS.md index ad0d6d48..26fb9a59 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -386,3 +386,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. diff --git a/Makefile b/Makefile index b5cf8885..543cdad2 100644 --- a/Makefile +++ b/Makefile @@ -334,3 +334,14 @@ package-lints: ## Build lint crates and package as .tar.zst archives 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 diff --git a/tools/dev-fast/config.toml b/tools/dev-fast/config.toml new file mode 100644 index 00000000..01e7f899 --- /dev/null +++ b/tools/dev-fast/config.toml @@ -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"] diff --git a/typos.local.toml b/typos.local.toml index 94f5978b..95cff439 100644 --- a/typos.local.toml +++ b/typos.local.toml @@ -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`", "(?m)^ \\.context\\(\"failed to serialise diagnostic for snapshot\"\\),$", "(?m)^ Ok\\(parsed\\) => assert_eq!\\(artifact, parsed\\),$", "(?m)^ \\.artifact_location$", diff --git a/typos.toml b/typos.toml index fdcc5080..e98b4f04 100644 --- a/typos.toml +++ b/typos.toml @@ -275,8 +275,13 @@ extend-ignore-re = [ "(?m)^use whitaker_common::i18n::\\{LocaleSelection, LocaleSource, normalise_locale, resolve_localizer\\};$", "(?m)^use whitaker_common::i18n::normalise_locale;$", "(?s)```.*?```", + "-fuse-ld=mold", + "Cranelift \\+ mold", + "Cranelift and mold", "\\brust-analyzer\\b", "`[^`\\n]+`", + "`mold`", + "mold linker", ] [default.extend-words]