Skip to content

fix: R API — remove outlawed R_UnboundValue#2597

Draft
maelle wants to merge 5 commits intomainfrom
cran-fix
Draft

fix: R API — remove outlawed R_UnboundValue#2597
maelle wants to merge 5 commits intomainfrom
cran-fix

Conversation

@maelle
Copy link
Copy Markdown
Contributor

@maelle maelle commented Mar 26, 2026

Avoids non-API calls to Rf_findVar(), Rf_findVarInFrame(), and removes all uses of the now-outlawed R_UnboundValue from code compiled on R >= 4.5.0, fixing build failures on R-devel.

  • R_UnboundValue as the ifnotfound sentinel in Rx_igraph_get_pointer and Rx_igraph_graph_version is replaced with R_NilValue.
  • The dead-code check identity_func == R_UnboundValue after Rf_findFun in Rx_igraph_safe_eval_in_env is removed (Rf_findFun throws on failure and never returns R_UnboundValue).
  • The sole remaining R_UnboundValue reference stays inside the #else block (R < 4.5.0), which is only compiled on older R where the symbol is available.
  • By submitting this pull request, I assign the copyright of my contribution to The igraph development team.

@schochastics
Copy link
Copy Markdown
Contributor

@krlmlr can we close this or is this still necessary?

@krlmlr
Copy link
Copy Markdown
Contributor

krlmlr commented Mar 31, 2026

I totally missed this, sorry. I quite like the approach, the R_UnboundValue usage still might be a problem.

@krlmlr
Copy link
Copy Markdown
Contributor

krlmlr commented Mar 31, 2026

Let's see what the builds on the main branch say.

@krlmlr
Copy link
Copy Markdown
Contributor

krlmlr commented Apr 1, 2026

Let's see if R_UnboundValue comes back as an error here.

@krlmlr
Copy link
Copy Markdown
Contributor

krlmlr commented Apr 1, 2026

@copilot: Remove use of the now outlawed R_UnboundValue .

Agent-Logs-Url: https://github.com/igraph/rigraph/sessions/362ea5b7-1842-4ec3-a9b8-410b04427c01

Co-authored-by: krlmlr <1741643+krlmlr@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 1, 2026

@copilot: Remove use of the now outlawed R_UnboundValue .

Done in 169c104. Replaced all R_UnboundValue usages in code compiled on R >= 4.5.0:

  • Rx_igraph_get_pointer: changed ifnotfound and comparisons to use R_NilValue
  • Rx_igraph_graph_version: same
  • Rx_igraph_safe_eval_in_env: removed dead-code check (since Rf_findFun throws on failure, it never returns R_UnboundValue)

The sole remaining R_UnboundValue is inside the #else block (R < 4.5.0), which is only compiled on older R where the symbol is available.

Copilot AI changed the title fix: R API fix: R API — remove outlawed R_UnboundValue Apr 1, 2026
Copilot AI requested a review from krlmlr April 1, 2026 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants