Skip to content

R-devel changes on allowed C-API #1854

Closed

Description

@llrs

On CRAN rlang has a warning and is set for archiving by 2025-11-27.

Result: WARN 
  File ‘rlang/libs/rlang.so’:
    Found non-API calls to R: ‘ENCLOS’, ‘OBJECT’, ‘PRENV’, ‘PRVALUE’,
      ‘R_PromiseExpr’, ‘Rf_allocSExp’, ‘Rf_findVarInFrame3’, ‘SETLENGTH’,
      ‘SET_BODY’, ‘SET_CLOENV’, ‘SET_ENCLOS’, ‘SET_FORMALS’,
      ‘SET_GROWABLE_BIT’, ‘SET_OBJECT’, ‘SET_TRUELENGTH’, ‘SET_TYPEOF’,
      ‘XTRUELENGTH’
  These entry points may be removed soon:
  ‘SET_ENCLOS’, ‘ENCLOS’, ‘OBJECT’, ‘SET_TYPEOF’

I don't see any recent issue about this, but I think the team is aware since:

Note: SET_OBJECT isn't mentioned on the above issues but using it triggers the warning.

Many thanks for developing and maintaining the package! I hope these are easy to replace/fix.

Activity

  1. hpages commented on Mar 27, 2026

    @hpages

    Hi there,

    This is becomming quite urgent, see https://cran.r-project.org/package=rlang

    Also FYI rlang no longer compiles with R 4.6 alpha:

    > install.packages("rlang")
    Installing package into ‘/home/hpages/R/R-4.6.r89723/site-library’
    (as ‘lib’ is unspecified)
    trying URL 'https://cran.rstudio.com/src/contrib/rlang_1.1.7.tar.gz'
    Content type 'application/x-gzip' length 770338 bytes (752 KB)
    ==================================================
    downloaded 752 KB
    
    * installing *source* package ‘rlang’ ...
    ** this is package ‘rlang’ version ‘1.1.7’
    ** package ‘rlang’ successfully unpacked and MD5 sums checked
    ** using staged installation
    ** libs
    using C compiler: ‘gcc (Ubuntu 14.2.0-4ubuntu2~24.04.1) 14.2.0’
    gcc -std=gnu23 -I"/home/hpages/R/R-4.6.r89723/include" -DNDEBUG -I./rlang/  -I/usr/local/include   -fvisibility=hidden -fpic  -g -O2  -Wall -Werror=format-security -c capture.c -o capture.o
    capture.c: In function ‘new_captured_promise’:
    capture.c:40:16: error: implicit declaration of function ‘PREXPR’ [-Wimplicit-function-declaration]
       40 |         expr = PREXPR(expr);
          |                ^~~~~~
    capture.c:40:14: error: assignment to ‘SEXP’ {aka ‘struct SEXPREC *’} from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
       40 |         expr = PREXPR(expr);
          |              ^
    capture.c: In function ‘rlang_capturearginfo’:
    capture.c:80:9: error: assignment to ‘SEXP’ {aka ‘struct SEXPREC *’} from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
       80 |     sym = PREXPR(sym);
          |         ^
    make: *** [/home/hpages/R/R-4.6.r89723/etc/Makeconf:190: capture.o] Error 1
    ERROR: compilation failed for package ‘rlang’
    * removing ‘/home/hpages/R/R-4.6.r89723/site-library/rlang’
    
    The downloaded source packages are in
    	‘/tmp/Rtmp2GokbG/downloaded_packages’
    Warning message:
    In install.packages("rlang") :
      installation of package ‘rlang’ had non-zero exit status
    

    which means that 15128 CRAN and Bioconductor packages can no longer be installed! 😉

    Thanks,
    H.

  2. llrs commented on Mar 29, 2026

    @llrs
    Author

    @hpages I tried to install it on R 4.6 and it works on my machine with R version 4.6.0 alpha (2026-03-28 r89738). Maybe there are some updates between your version and mine that made it compile (given the recent requests and emails on R-devel)?

    For completeness, the current deadline is 2026-04-10 and current warnings related to C-API:

      File ‘rlang/libs/rlang.so’:
        Found non-API calls to R: ‘ATTRIB’, ‘PRENV’, ‘PRVALUE’,
          ‘R_MissingArg’, ‘R_NamespaceRegistry’, ‘R_PromiseExpr’, ‘R_Srcref’,
          ‘R_UnboundValue’, ‘Rf_findVar’, ‘Rf_findVarInFrame’,
          ‘Rf_findVarInFrame3’, ‘SET_ATTRIB’
      These entry points may be removed soon:
      ‘ATTRIB’, ‘SET_ATTRIB’, ‘Rf_findVar’, ‘Rf_findVarInFrame’, ‘Rf_findVarInFrame3’, ‘PRENV’, ‘PRVALUE’, ‘R_PromiseExpr’
      
      Compiled code should not call non-API entry points in R.
      
      See ‘Writing portable packages’ in the ‘Writing R Extensions’ manual,
      and section ‘Moving into C API compliance’ for issues with the use of
      non-API entry points.
    
  3. hpages commented on Mar 29, 2026

    @hpages

    @llrs rlang didn't compile with R 4.6 alpha from 2026-03-26.

    However:

    hpages@XPS15:~/svn/R/trunk$ svn log -r 89729
    ------------------------------------------------------------------------
    r89729 | luke | 2026-03-27 02:11:53 -0700 (Fri, 27 Mar 2026) | 1 line
    
    Restore PREXPR macro to Rinternals.h.
    ------------------------------------------------------------------------
    

    This is why rlang compiles again with R version 4.6.0 alpha (2026-03-28 r89738) 😉

    A couple of days ago CRAN also changed the deadline to fix the package from 2026-03-27 to 2026-04-10.

  4. DavisVaughan commented on Mar 30, 2026

    @DavisVaughan
    Member

    We are very aware of the rlang non-API surface and have fixed pretty much everything (as of around two weeks ago) required by r-devel. We are working closely with R Core on this, and rlang is not going to be removed from CRAN due to all of these changes.

    But r-devel is extremely unstable right now and is changing day by day, so even if we did a release today with all of the fixes, something else is still likely to be marked as non-API tomorrow (see #1889 for example).

    But rest assured that we will get it all sorted out before the official R 4.6 release date!

  5. hpages commented on Mar 30, 2026

    @hpages

    Thanks Davis for the update. Glad to know that you guys are working on this.

    Best,
    H.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions