diff --git a/.github/dependabot.yml b/.github/dependabot.yml index cf2af309..7b5c636f 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -29,3 +29,10 @@ updates: 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 4f2b6bf6..16f660b3 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -367,3 +367,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 e7cfb6c2..c67e1666 100644 --- a/Makefile +++ b/Makefile @@ -132,3 +132,14 @@ run-verus: ## Run the configured Verus proof entry point 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 7d279684..1f55352e 100644 --- a/typos.local.toml +++ b/typos.local.toml @@ -10,6 +10,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`", "\\ \\ \\ \\ PoolServerBehavior,", "\\ \\ \\ \\ \\ \\ CARGO_TERM_COLOR:\\ always", "\\ \\ \\ \\ \\ \\ \\ Self::start_with_behavior\\(PoolServerBehavior::Ech", diff --git a/typos.toml b/typos.toml index a55d8c3b..ae4c097b 100644 --- a/typos.toml +++ b/typos.toml @@ -31,6 +31,9 @@ extend-exclude = [ locale = "en-gb" extend-ignore-re = [ "(?s)```.*?```", + "-fuse-ld=mold", + "Cranelift \\+ mold", + "Cranelift and mold", "\\ \\ \\ \\ PoolServerBehavior,", "\\ \\ \\ \\ \\ \\ CARGO_TERM_COLOR:\\ always", "\\ \\ \\ \\ \\ \\ \\ Self::start_with_behavior\\(PoolServerBehavior::Ech", @@ -50,10 +53,12 @@ extend-ignore-re = [ "\\brust-analyzer\\b", "\\|\\|\\ \"fragment\\ series\\ not\\ initialised\"\\.into\\(\\)\\)", "`[^`\\n]+`", + "`mold`", "ask\\ items\\ with\\ a\\ GitHub\\ Flavored", "e\\.behavior\\ ==\\ PoolServerBehavior::MalformedFirstResponse", "ior\\(behavior:\\ PoolServerBehavior\\)\\ \\->\\ std::io::Result