Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Propagate the error causing rextendr::document() to fail #409

Merged
merged 2 commits into from
Dec 16, 2024

Conversation

CGMossa
Copy link
Member

@CGMossa CGMossa commented Dec 14, 2024

This has been a nuisance for many, many years now already.

Invoking rextendr::document() invokes {callr}'s r function, which spawns a separate R process, meant to load the wrapper-generating functions that are part of the rust-powered r-package, and write that to disk. Unfortunately, if there are any errors attributed with this call, then we do not see the error. The error could be missing libraries in Makevars (there are related issues), or anything similar, then you don't get the error message.

With this slight change, the error message is propagated.

Example

Current behaviour:

Error in `value[[3L]]()`:
! Failed to generate wrapper functions.in callr subprocess.
Backtrace:1. └─rextendr::document()
 2.   └─rextendr::register_extendr(path = pkg, quiet = quiet)
 3.     └─base::tryCatch(...)
 4.       └─base (local) tryCatchList(expr, classes, parentenv, handlers)
 5.         └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
 6.           └─value[[3L]](cond)
 7.             └─cli::cli_abort(...)
 8.               └─rlang::abort(...)

New behaviour:

Error in `value[[3L]]()`:
! Failed to generate wrapper functions.in callr subprocess.
"wrap2__make_extendrtests_wrappers" not available for .Call() for package "extendrtests"

And yes I was refactoring the way wrapper-generating works in extendr-macros+extendr-api.

@CGMossa CGMossa changed the title Propogate the error causing rextendr::document() to fail Propagate the error causing rextendr::document() to fail Dec 14, 2024
@Ilia-Kosenkov
Copy link
Member

@CGMossa , could you please run {lintr} over your changes?

@CGMossa
Copy link
Member Author

CGMossa commented Dec 16, 2024

I thought I did that. But maybe I didn't. I tried again now.

@JosiahParry JosiahParry merged commit 93b8bd5 into main Dec 16, 2024
18 of 19 checks passed
@JosiahParry JosiahParry deleted the propogate_callr_error branch December 16, 2024 21:23
Copy link

codecov bot commented Dec 16, 2024

Codecov Report

Attention: Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.

Project coverage is 82.95%. Comparing base (4217a0e) to head (69f6b10).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
R/register_extendr.R 0.00% 4 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

Files with missing lines Coverage Δ
R/register_extendr.R 72.54% <0.00%> (-2.20%) ⬇️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants