upload_single_binary() writes an ABI-risky package only to the per-minor slot,
so a risky package should have no flat binary at all. Packages built before they
were classified risky still do, and the flat slot is what every client that
cannot be routed by R minor receives.
Such a binary was built under whichever R was primary at the time, so it fails
at load under any minor that has since dropped a symbol it uses. base64enc was
built under R 4.4.3, calls SETLENGTH, and R 4.6 no longer exports it:
base64enc.so: undefined symbol: SETLENGTH
Deleting the flat object does not create a hole. The source fallback republishes
the CRAN source under the same key, so the package stays installable everywhere
and compiles against the client's own R, while routed clients keep getting the
per-minor binary.
This change will:
- add local/prune-stale-flat-binaries.R, dry run unless --apply, taking either
an explicit package list or every package the classifier cache calls risky
- refuse to run on an empty risky set, which is indistinguishable from an
unreachable cache and would report success having pruned nothing
- keep any object whose package CRAN no longer ships, since there would be no
source to fall back to
- re-index and purge in the same run, because a published index naming deleted
files serves 404s rather than the source fallback