Add non_api module behind an off-by-default non-api feature#266
Open
CGMossa wants to merge 1 commit into
Open
Conversation
Port extendr-ffi's `non_api` module (verbatim, with attribution): declarations for a small set of R "non-API" entry points (promise/environment/closure accessors such as PRCODE, ENCLOS, SET_PRVALUE, Rf_allocSExp). Gated behind a new `non-api` feature that is NOT in `default`, mirroring extendr-ffi's `non-api = []`. These symbols are outside R's stable C API and some are not exported by every R version (e.g. SET_FORMALS, SET_BODY, SET_CLOENV, PRSEEN, Rf_isValidStringF are not exported by R 4.6), so they are opt-in only. 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
extendr-ffi'snon_apimodule (verbatim, with attribution) intosrc/non_api.rs: declarations for a small set of R "non-API" entry points (promise / environment / closure accessors such asPRCODE,ENCLOS,SET_PRVALUE,Rf_allocSExp, …).non-apiCargo feature that is not indefault(mirrors extendr-ffi'sdefault = []/non-api = []), so default builds are unchanged. The module is#[cfg(feature = "non-api")] pub mod non_api;.Test plan
cargo build(default): compiles, module excluded.cargo build --features non-apiagainst R 4.6.0: compiles, 0 errors.cargo metadataconfirmsdefault = [](feature is opt-in).Notes
SET_FORMALS,SET_BODY,SET_CLOENV,PRSEEN, andRf_isValidStringFare not exported, so calling those specific functions on 4.6 would fail to link. The feature is opt-in and unsafe by nature; declarations are kept verbatim to match extendr-ffi rather than pruned per R version.Drafted by Claude (claude-opus-4-8). Reviewed by the author.