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

GH-44924: [R] Remove usage of cpp11's HAS_UNWIND_PROTECT #45261

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

assignUser
Copy link
Member

@assignUser assignUser commented Jan 14, 2025

Rationale for this change

The macro is no longer required on R >= 4.0 which is our minimum version.

What changes are included in this PR?

Remove use of HAS_UNWIND_PROTECT

Are these changes tested?

ci

Are there any user-facing changes?

no

Comment on lines 48 to -53
bool CanRunWithCapturedR() {
#if defined(HAS_UNWIND_PROTECT)
return MainRThread::GetInstance().Executor() == nullptr;
#else
return false;
#endif
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this function at all anymore? Or another way: does MainRThread::GetInstance().Executor() == nullptr ever return false?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤷 I have no idea tbh. Just following the prompt from the cpp11 author ^^

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, the header explains it, I'll update the comment but from how I read it we still need to check for the executor

// Unwind protection was added in R 3.5 and some calls here use it
// and crash R in older versions (ARROW-16201). Implementation provided
// in safe-call-into-r-impl.cpp so that we can skip some tests
// when this feature is not provided. This also checks that there
// is not already an event loop registered (via MainRThread::Executor()),
// because only one of these can exist at any given time.

@github-actions github-actions bot added awaiting changes Awaiting changes and removed awaiting review Awaiting review labels Jan 14, 2025
@github-actions github-actions bot added awaiting change review Awaiting change review and removed awaiting changes Awaiting changes labels Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants