Fix CRAN NOTE: Replace .attr() with Rf_setAttrib() to avoid non-API ATTRIB calls#170
Closed
Fix CRAN NOTE: Replace .attr() with Rf_setAttrib() to avoid non-API ATTRIB calls#170
Conversation
Co-authored-by: ms609 <1695515+ms609@users.noreply.github.com>
…TTRIB calls Co-authored-by: ms609 <1695515+ms609@users.noreply.github.com>
Co-authored-by: ms609 <1695515+ms609@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix CRAN note regarding non-API call to R
Fix CRAN NOTE: Replace .attr() with Rf_setAttrib() to avoid non-API ATTRIB calls
Jan 9, 2026
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #170 +/- ##
==========================================
- Coverage 99.31% 99.19% -0.13%
==========================================
Files 43 43
Lines 3201 3215 +14
==========================================
+ Hits 3179 3189 +10
- Misses 22 26 +4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Owner
|
closed by update to Rcpp |
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.
CRAN reported non-API calls to
ATTRIBin compiled code. Rcpp's.attr()setter internally uses the non-APIATTRIBfunction, violating portability requirements.Changes
Replaced attribute setters with R API calls
src/hmi.cpp: 5 replacements (var, sd, sem, samples, relativeError)src/reduce_tree.cpp: 5 replacements (class, order for phylo/multiPhylo)src/spr.cpp: 13 replacements (class, order, dim)Performance optimization
Cached symbol lookups as static SEXP to avoid repeated
Rf_install()calls:Note:
.attr()getters unchanged—only setters use non-API internals.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
i0.wp.com/usr/bin/pandoc /usr/bin/pandoc +RTS -K512m -RTS compare-treesets.knit.md --to html4 --from markdown+autolink_bare_uris+tex_math_single_backslash --output /home/REDACTED/work/TreeDist/TreeDist/TreeDist.Rcheck/vign_test/TreeDist/vignettes/compare-treesets.html --lua-filter /home/REDACTED/work/_temp/Library/rmarkdown/rmarkdown/lua/pagebreak.lua --lua-filter /home/REDACTED/work/_temp/Library/rmarkdown/rmarkdown/lua/latex-div.lua --embed-resources --standalone --section-divs --template /home/REDACTED/work/_temp/Library/rmarkdown/rmd/h/default.html(dns block)ms609.github.io/opt/R/4.5.2/lib/R/bin/exec/R /opt/R/4.5.2/lib/R/bin/exec/R --no-restore --no-echo --args nextArgTreeDist_2.11.1.9000.tar.gznextArg--no-manual(dns block)/opt/R/4.5.2/lib/R/bin/exec/R /opt/R/4.5.2/lib/R/bin/exec/R --no-restore --no-echo --args nextArgTreeDist_2.11.1.9000.tar.gznextArg--no-manual --no-echo 4 rgo/bin/git eeTools/include'as e y/Rcpp/include /usr/bin/which unam�� c9f38aed7f7e0f7a-I(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.