#!/bin/bash cd "$(dirname "$0")"; export PATH="$HOME/.cargo/bin:$PATH" timeout 3000 cargo check --manifest-path jouleclaw/jouleclaw-rs/Cargo.toml -p jouleclaw-omni \ --features metal --keep-going --message-format=json -j 6 >/tmp/m2.json 2>/dev/null python3 - <<'PY' import json, collections, re msgs=collections.Counter(); files=collections.Counter(); pairs=collections.Counter(); tot=0 for line in open('/tmp/m2.json'): try: m=json.loads(line) except Exception: continue if m.get('reason')!='compiler-message': continue msg=m.get('message') or {} if msg.get('level')!='error': continue tot+=1 t=(msg.get('message') or '') code=(msg.get('code') or {}).get('code') or '?' norm=re.sub(r'`[^`]*`','`X`',t)[:72] msgs[(code,norm)]+=1 sp=msg.get('spans') or [] f=sp[0]['file_name'].split('/')[-1] if sp else '?' files[f]+=1 # for E0308 capture the actual expected/found pair if code=='E0308': exp=re.search(r'expected `([^`]*)`, found `([^`]*)`', t) if exp: pairs[(exp.group(1)[:28], exp.group(2)[:28])]+=1 print(f" TOTAL {tot}\n") print(" === distinct (code, message) ===") for (c,t),n in msgs.most_common(14): print(f" {n:4} {c:7} {t}") print("\n === E0308: what is expected vs found ===") for (e,f),n in pairs.most_common(12): print(f" {n:4} expected {e:28} found {f}") print("\n === worst files ===") for f,n in files.most_common(10): print(f" {n:4} {f}") PY