-
Notifications
You must be signed in to change notification settings - Fork 0
Adopt the phase 2 Rust baseline (toolchain, rustfmt, lints) #16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
0bbca1f
d8677b5
97bb898
3f268b2
e2830fb
50f2cf5
ad1e8f5
05e4a5c
c2be2dc
a8a7b1d
96e7cc8
a69d191
38c6e63
f70f6d7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,3 @@ | ||
| [unstable] | ||
| codegen-backend = true | ||
|
|
||
| [profile.dev] | ||
| codegen-backend = "cranelift" | ||
|
|
||
| [target.x86_64-unknown-linux-gnu] | ||
| linker = "clang" | ||
| rustflags = ["-C", "link-arg=-fuse-ld=mold"] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,24 @@ | ||
| # Align with CodeScene’s ceiling | ||
| # Canonical clippy configuration for the estate. | ||
| # | ||
| # The thresholds align with CodeScene's code-health ceilings. | ||
| cognitive-complexity-threshold = 9 # default is 25 | ||
| too-many-arguments-threshold = 4 # default is 7 | ||
| too-many-lines-threshold = 70 # default is 100 | ||
| excessive-nesting-threshold = 4 # default is off | ||
|
|
||
| allow-expect-in-tests = true | ||
|
|
||
| # Enforce the environment-injection mandate. The reason strings surface in | ||
| # the diagnostic, so a contributor who trips one is told what to do instead. | ||
| # | ||
| # Sanctioned sites carry `#[expect(clippy::disallowed_methods, reason = "..")]` | ||
| # rather than `allow`, so the expectation goes unfulfilled — and warns — once | ||
| # the site is migrated. The backlog removes itself instead of rotting. | ||
| disallowed-methods = [ | ||
| { path = "std::env::var", reason = "inject an environment reader" }, | ||
| { path = "std::env::var_os", reason = "inject an environment reader" }, | ||
| { path = "std::env::vars", reason = "inject an environment reader" }, | ||
| { path = "std::env::vars_os", reason = "inject an environment reader" }, | ||
| { path = "std::env::set_var", reason = "use a stub environment in tests" }, | ||
| { path = "std::env::remove_var", reason = "use a stub environment in tests" }, | ||
| ] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,10 +11,14 @@ available. `make coverage` uses `cargo llvm-cov` with `lld`. | |
|
|
||
| ## Tooling | ||
|
|
||
| Development builds use Cranelift for debug code generation. On Linux targets, | ||
| `.cargo/config.toml` configures clang to link with `mold` so debug builds link | ||
| quickly. Coverage generation uses `lld` because LLVM coverage tooling expects | ||
| LLVM-compatible linker behaviour. | ||
| On Linux targets, `.cargo/config.toml` configures clang to link with `mold` | ||
| so debug builds link quickly. Coverage generation uses `lld` because LLVM | ||
| coverage tooling expects LLVM-compatible linker behaviour. The Cranelift | ||
| codegen backend that a previous version of this configuration enabled for | ||
| debug builds has been removed; the estate's canonical `rust-toolchain.toml` | ||
| pins only `rustfmt`, `clippy`, and `rust-analyzer`, so per-repository | ||
| opt-in acceleration such as Cranelift now lives in the shared | ||
| `tools/dev-fast` configuration instead. | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win Align both guides with the retained toolchain components. Both guides must distinguish pinned component installation from repository-local
📍 Affects 2 files
🤖 Prompt for AI Agents
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @coderabbitai Has this now been resolved in the latest commit? Use codegraph analysis to determine your answer. If this comment is now resolved, please mark it as such using the API. Otherwise, please provide an AI agent prompt for the remaining work to be done to address this comment. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '%s\n' '== Current branch and target files =='
git status --short --branch
printf '\n== Toolchain components ==\n'
sed -n '/^\[toolchain\]/,/^\[/p' rust-toolchain.toml
printf '\n== Cranelift configuration references ==\n'
rg -n -C 3 \
'rustc-codegen-cranelift-preview|llvm-tools-preview|tools/dev-fast|Cranelift|codegen-backend' \
docs/developers-guide.md docs/users-guide.md rust-toolchain.toml .cargo/config.toml \
2>/dev/null || true
printf '\n== Matching PR review thread ==\n'
gh api graphql \
-F owner='leynos' \
-F name='memoryd' \
-F number=16 \
-f query='
query($owner: String!, $name: String!, $number: Int!) {
repository(owner: $owner, name: $name) {
pullRequest(number: $number) {
reviewThreads(first: 100) {
nodes {
id
isResolved
comments(first: 20) {
nodes {
author { login }
body
url
}
}
}
}
}
}
}' \
--jq '.data.repository.pullRequest.reviewThreads.nodes[]
| select(any(.comments.nodes[]?;
(.author.login == "coderabbitai" and
(.body | contains("Align both guides with the retained toolchain components."))))
| {id, isResolved,
url: ([.comments.nodes[] | select(.author.login == "coderabbitai") | .url][0])}'Length of output: 4122 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '%s\n' '== User guide location =='
fd -HI -t f '^users-guide\.md$' . || true
printf '\n== User guide Cranelift references ==\n'
while IFS= read -r guide; do
printf '\n-- %s --\n' "$guide"
rg -n -C 3 \
'rustc-codegen-cranelift-preview|llvm-tools-preview|tools/dev-fast|Cranelift|codegen-backend' \
"$guide" || true
done < <(fd -HI -t f '^users-guide\.md$' .)
printf '\n== Matching PR review thread ==\n'
gh api graphql \
-F owner='leynos' \
-F name='memoryd' \
-F number=16 \
-f query='
query($owner: String!, $name: String!, $number: Int!) {
repository(owner: $owner, name: $name) {
pullRequest(number: $number) {
reviewThreads(first: 100) {
nodes {
id
isResolved
comments(first: 20) {
nodes {
author { login }
body
url
}
}
}
}
}
}
}' \
--jq '
.data.repository.pullRequest.reviewThreads.nodes[]
| select(
any(
.comments.nodes[];
.author.login == "coderabbitai"
and (.body | contains("Align both guides with the retained toolchain components."))
)
)
| {
id,
isResolved,
url: (
[
.comments.nodes[]
| select(.author.login == "coderabbitai")
| .url
][0]
)
}
'Length of output: 1871 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '%s\n' '== User guide Cranelift references =='
rg -n -C 4 \
'rustc-codegen-cranelift-preview|llvm-tools-preview|tools/dev-fast|Cranelift|codegen-backend' \
docs/users-guide.md || true
printf '\n%s\n' '== Matching PR review thread =='
gh api graphql \
-F owner='leynos' \
-F name='memoryd' \
-F number=16 \
-f query='
query($owner: String!, $name: String!, $number: Int!) {
repository(owner: $owner, name: $name) {
pullRequest(number: $number) {
reviewThreads(first: 100) {
nodes {
id
isResolved
comments(first: 20) {
nodes {
author { login }
body
url
}
}
}
}
}
}
}' \
--jq '
.data.repository.pullRequest.reviewThreads.nodes[]
| select(
any(
.comments.nodes[];
.author.login == "coderabbitai"
and (.body | contains("Align both guides with the retained toolchain components."))
)
)
| {
id: .id,
isResolved: .isResolved,
url: (
[
.comments.nodes[]
| select(.author.login == "coderabbitai")
| .url
][0]
)
}
'Length of output: 1596 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '%s\n' '== User guide structure =='
rg -n '^#' docs/users-guide.md
printf '\n%s\n' '== User guide opening and tooling sections =='
sed -n '1,100p' docs/users-guide.mdLength of output: 1917
The configuration and
Triage: 🧠 Learnings usedYou are interacting with an AI system. |
||
|
|
||
| Install `clang`, `lld`, and `mold` before running the full generated workflow | ||
| locally on Linux. | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.