Add R API symbol drift check#264
Open
CGMossa wants to merge 1 commit into
Open
Conversation
Since in-tree bindgen was removed (extendr#250), the per-version files in bindings/ are maintained by hand and nothing notices when R's C API surface changes, so they can silently go stale (no R 4.5 / 4.6 bindings ever landed). Add a bindgen-free watcher: `tools/r-symbols.sh` lists the C symbols exported by the installed R shared library (via `nm`, macOS + Linux), and `check-r-api.yml` runs it weekly against R-devel, unions the per-OS lists, and opens a PR whenever the snapshot changes. It flags drift only; it does not generate bindings. The first run establishes the baseline snapshot. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TODO: replace this line with your own framing, in your own voice.
AI-written details
Summary
#250removed in-tree bindgen, the per-version files inbindings/are maintained by hand and nothing flags when R's C API surface shifts, so they can silently go stale (no R 4.5 / 4.6 bindings ever landed).tools/r-symbols.shlists the C symbols exported by the installed R shared library usingnm(macOSlibR.dylib, LinuxlibR.so)..github/workflows/check-r-api.ymlruns it weekly against R-devel on macOS + Ubuntu, unions the per-OS lists, and opens a PR whenever the committedr-symbols.txtsnapshot changes.nonAPI.txt) point to new C API the hand-maintained bindings should expose; removed symbols point to breakage.Test plan
tools/r-symbols.shruns locally against R 4.6.0 on macOS arm64: 2535 symbols, deterministic across runs, key API present (Rf_error,Rf_protect,R_ParseEvalString,REAL,TYPEOF,Rf_allocVector).masterestablishes the baseliner-symbols.txtvia a PR.Notes
non-api-call.yml(same weekly cron + branch +gh pr createpattern), so it reuses machinery the repo already trusts.nmonR.dllneeds Rtools on PATH. macOS + Linux catch effectively all API-surface changes, which are platform-independent. Windows-only symbols can be added later if wanted.ZSTDv07_*,_hershey_*symbols) stays constant across versions, so it never shows up in the version-to-version diff.Drafted by Claude (claude-opus-4-8). Reviewed by the author.