diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 9b3a19ca..e57b900d 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -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 diff --git a/AGENTS.md b/AGENTS.md index 02fc2c8b..6bd9c3f2 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -372,3 +372,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 2737cce9..a3e528bf 100644 --- a/Makefile +++ b/Makefile @@ -53,3 +53,14 @@ nixie: ## Validate Mermaid diagrams 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"]