Skip to content

[MRE] successive Declare fails if InstantiateFunctionDefinition fails in MakeFunctionCallable #616

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

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

Conversation

Vipul-Cariappa
Copy link
Collaborator

This is a bug report.

If the instantiation of a templated function fails while CodeGen (MakeFunctionCallable), then successive call to Cpp::Declare fails.
But a second call to Cpp::Declare will pass.

I suspect something similar to

#ifdef CPPINTEROP_USE_CLING
    cling::Interpreter::PushTransactionRAII RAII(&I);
#endif

is required?

Copy link
Contributor

github-actions bot commented Jun 6, 2025

clang-tidy review says "All clean, LGTM! 👍"

@Vipul-Cariappa Vipul-Cariappa marked this pull request as draft June 6, 2025 08:20
@Vipul-Cariappa Vipul-Cariappa changed the title [DO NOT MERGE] [MRE] successive Declare fails if InstantiateFunctionDefinition fails in MakeFunctionCallable [MRE] successive Declare fails if InstantiateFunctionDefinition fails in MakeFunctionCallable Jun 6, 2025
@Vipul-Cariappa
Copy link
Collaborator Author

Summary of conversion had over discord:
Declare does not print out any error.
The return code says it failed.
Stray Declare(" ") also fails.

@Vipul-Cariappa Vipul-Cariappa force-pushed the bug/InstantiateFunctionDefinition branch from c2130c8 to 58d155a Compare June 6, 2025 09:11
Copy link
Contributor

github-actions bot commented Jun 6, 2025

clang-tidy review says "All clean, LGTM! 👍"

Copy link

codecov bot commented Jun 6, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.85%. Comparing base (dd50000) to head (58d155a).
Report is 2 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #616      +/-   ##
==========================================
+ Coverage   77.66%   77.85%   +0.18%     
==========================================
  Files           9        9              
  Lines        3743     3748       +5     
==========================================
+ Hits         2907     2918      +11     
+ Misses        836      830       -6     
Files with missing lines Coverage Δ
lib/CppInterOp/CppInterOp.cpp 85.42% <100.00%> (+0.32%) ⬆️
Files with missing lines Coverage Δ
lib/CppInterOp/CppInterOp.cpp 85.42% <100.00%> (+0.32%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

github-actions bot commented Jun 6, 2025

clang-tidy review says "All clean, LGTM! 👍"

GeneratedPTU.takeError(), llvm::errs(),
"[MakeFunctionCallable -> InstantiateFunctionDefinition] Failed to "
"generate PTU:");
#endif
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want to move this somewhere in InstantiateTemplate and replace S.InstantiateFunctionDefinition with it?

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.

2 participants