You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Rust adapter: quoted keys and inline tables in .cargo/config bypass the build-config check #221
changesBuild in src/repo/adapters/rust.ts decides whether a .cargo/config(.toml) changes the build (rustflags, target, [patch], [unstable] and so on). It matches lines with a regex, so it only sees the [build]\nrustflags = … spelling. TOML lets you write the same keys in other ways, and Cargo applies all of them:
config.toml
Cargo applies it
DiffCI blocks
[build] rustflags = ["--cfg", "x"]
yes
yes
build = { rustflags = ["--cfg", "x"] }
yes
no
"build".rustflags = ["--cfg", "x"]
yes
no
[build] 'rustflags' = ['--cfg', 'x']
yes
no
unstable = { build-std = ["std"] }
yes
no
patch = { crates-io = { … } }
yes
no
I checked the first four with cargo build -v (Cargo 1.100): each passes --cfg x to rustc.
Repro: a single crate with .cargo/config.toml set to build = { rustflags = ["--cfg", "extra"] }. rustAdapter.analyze gives no blocker. Change it to the [build] table form and you get Custom Cargo configuration or compiler environment requires full validation. The same gap applies to $CARGO_HOME/config.toml and to parent directories' configs.
Fix: unquote simple quoted keys before matching, and treat a top-level build, patch or unstable inline table as build-changing. That over-blocks build = { jobs = 4 }, which fails closed and is rare.
Activity