feat: embed canonical branded DIG icon in Windows binaries (#2917) - #71
MichaelTaylor3d wants to merge 3 commits into
Conversation
Adds a build script to the three crates that produce shipped binaries so `digs`, `dig-store`, `dig-resolver` and `dighost` carry the canonical DIG mark in Explorer, the taskbar, Task Manager and shortcut targets instead of the generic default. Mechanism is the one already proven in dig-installer: `embed-resource` under `[target.'cfg(windows)'.build-dependencies]` compiling the vendored `assets/dig.rc`, whose single ICON statement is ordinal 1 because Windows renders a binary's lowest-ordinal icon resource. Gated to Windows targets so Linux and macOS builds cannot break on it. `embed_resource::compile` emits `cargo:rustc-link-arg-bins`, which reaches every `[[bin]]` in a crate; that is correct here because every bin in these three crates ships. `crates/digstore-prover/guest` is a separate crate and is deliberately untouched — a wasm guest has no icon. Adds the `icon asset (sha256 pin)` CI job, which fails loudly if `assets/dig.ico` ever drifts from the canonical bytes. The asset is vendored rather than shared through a crate because a build script cannot read a normal dependency's files, so sharing it would mean a build-dependency and a much wider build graph for every binary. Refs #2917
Security audit — PASSHead SHA audited: 1. Cargo.lock diff scope — confirmed confined. Diffed base ( 2. 3. wasm guest — No LIVE findings. Scope audited: Worktree note: worked entirely read-only via |
MichaelTaylor3d
left a comment
There was a problem hiding this comment.
Correctness review — PASS
Head SHA reviewed: bb5b665eec6be0e7e54ff0681283a41cb9714dec
Note: artifact-level PE-resource verification (built binaries checked against
verify_pe_icon.py) is being supplied separately by the orchestrator directly on this
PR — not run by this gate. Everything below is read/mutation-only, no cargo build.
- Gate non-vacuous — appended one byte to a scratch copy of
assets/dig.icoand ran
scripts/check-icon.sh: exits 1 with a clear drift message, restored original after.
Confirmed with the original bytes it printsOK(exit 0). The pin can fail. - Canonical bytes —
sha256sum assets/dig.ico=2f0fb11a1254fc9275248dc340b7aa9c7236484a9531f8aaad2e4bcdf8900096,wc -c= 50443. Matches the literal exactly. assets/dig.rc— exactly oneICONstatement (1 ICON "dig.ico"), ordinal 1, noRT_MANIFEST/VERSIONINFOdeclared. Comment block explicitly documents why no manifest is declared here (linker collision).- Scoping —
digstore-cliships two bins (dig-store,digs), both correctly branded via-binslink args;dig-resolver(1 bin) anddigstore-host'sdighost(feature-gated bin) likewise.crates/digstore-prover/guest(the wasm guest, excluded from the workspace) has zero diff — confirmed untouched (git diff origin/main -- crates/digstore-prover/guestempty,git status --porcelainempty). - TOML table placement — checked all three new
[target.'cfg(windows)'.build-dependencies]headers (dig-resolver,digstore-cli,digstore-hostCargo.toml) againstorigin/main: each is a clean standalone insertion immediately followed by a blank line then[dependencies]. None of them precede or split an existing table — unlike the dig-node incident, nothing gets silently reclassified. - Lockfile diff, edge-aware (
git diff origin/main -- Cargo.lock | grep -E '^[+-]' | grep -v '^[+-][+-]', every line read): the only new packages areembed-resource3.0.11 and its direct/transitive deps (toml1.1.2,vswhom0.1.0,vswhom-sys0.1.3,winreg0.55.0), plus the expected workspaceversionbump (0.29.9 -> 0.29.10) repeated per member.windows-sys(0.48.0/0.52.0/0.59.0/0.61.2) has no added/removedname =line —winreg's dep onwindows-sys 0.59.0resolves to a version already present pre-PR, confirmed by the package-name-only diff (grep '^[+-]name') showing only the 5 new packages. No edge-rewrite drag-in. - CI job name —
.github/workflows/ci.yml:245isname: icon asset (sha256 pin), exact string match. Runs on ubuntu-latest, dependency-free, independent of the compile jobs. - Doc-truth —
assets/dig.rccomments,scripts/check-icon.shcomments, and theCHANGELOG.mdentry all describe present-state behavior of this repo only (no forward-looking claim about macOS/Linux/installer siblings, which are correctly out of scope per #2924/#2925/#2926). - No behaviour change — diff is confined to
.github/workflows/ci.yml,CHANGELOG.md,Cargo.lock,Cargo.toml(version bump only),assets/dig.ico+dig.rc, three crates'Cargo.toml+build.rs, andscripts/check-icon.sh. No source file undersrc/touched; no elevation/manifest/API change.
No blocking findings; no inline threads opened (nothing at file:line to contest). Not run by this gate: cargo build / PE-resource verification of the compiled binaries (supplied separately by the orchestrator on this PR) and third-party audit of embed-resource 3.0.11 itself.
DO NOT MERGE — gate round in progress. Refs #2917.