Skip to content

enable dispatch load/reload in single binary, add error message with dlerror#799

Open
conrade-ctc wants to merge 1 commit intocompiler-research:mainfrom
conrade-ctc:print_error_for_LoadDispatchAPI
Open

enable dispatch load/reload in single binary, add error message with dlerror#799
conrade-ctc wants to merge 1 commit intocompiler-research:mainfrom
conrade-ctc:print_error_for_LoadDispatchAPI

Conversation

@conrade-ctc
Copy link

@conrade-ctc conrade-ctc commented Feb 4, 2026

Description

Problem: Load/UnloadDispatchAPI can't but be used multiple time in an application.

Solution: Enable Load/UnloadDispatchAPI by moving data out and allowing controlled reset of static data via UnloadDispatchAPI.

Also: add dlerror() when load fails to get diagnostics on reason for failure (e.g., file not found vs symbols not defined)

Fixes # (issue)

Type of change

Please tick all options which are relevant.

  • Bug fix
  • New feature
  • Requires documentation updates

Testing

Please describe the test(s) that you added and ran to verify your changes.

Checklist

  • I have read the contribution guide recently

@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2026

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

@codecov
Copy link

codecov bot commented Feb 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.56%. Comparing base (76d0600) to head (86d2002).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #799      +/-   ##
==========================================
+ Coverage   79.46%   79.56%   +0.10%     
==========================================
  Files          11       11              
  Lines        4002     4007       +5     
==========================================
+ Hits         3180     3188       +8     
+ Misses        822      819       -3     
Files with missing lines Coverage Δ
include/CppInterOp/Dispatch.h 90.62% <100.00%> (+12.84%) ⬆️
Files with missing lines Coverage Δ
include/CppInterOp/Dispatch.h 90.62% <100.00%> (+12.84%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@conrade-ctc conrade-ctc force-pushed the print_error_for_LoadDispatchAPI branch from 39132c7 to 1871ea3 Compare February 4, 2026 14:12
@conrade-ctc conrade-ctc changed the title print error message from dlerror on failed load fix rel path in test with absolute resolved path, add error message on dlerror Feb 4, 2026
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

@conrade-ctc conrade-ctc marked this pull request as draft February 4, 2026 15:21
@conrade-ctc conrade-ctc force-pushed the print_error_for_LoadDispatchAPI branch from 8447056 to be84465 Compare February 4, 2026 17:19
@conrade-ctc conrade-ctc changed the title fix rel path in test with absolute resolved path, add error message on dlerror enable dispatch load/reload in single binary, add error message with dlerror Feb 4, 2026
@conrade-ctc conrade-ctc marked this pull request as ready for review February 4, 2026 17:24
@conrade-ctc
Copy link
Author

@vgvassilev @aaronj0 In getting at least an error message out of dlerror(), the PR reminding me there is no test for Load/Unload, so I also updated that mechanism to enable multiple load/unload cycle (just to enable the test, but of course this is also valuable in general)

@conrade-ctc conrade-ctc force-pushed the print_error_for_LoadDispatchAPI branch from be84465 to 5f5aff6 Compare February 4, 2026 17:31
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

@conrade-ctc conrade-ctc force-pushed the print_error_for_LoadDispatchAPI branch 3 times, most recently from ce915d5 to c9ef982 Compare February 4, 2026 17:41
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

@conrade-ctc conrade-ctc force-pushed the print_error_for_LoadDispatchAPI branch from c9ef982 to 0953824 Compare February 4, 2026 18:09
@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2026

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

@conrade-ctc conrade-ctc force-pushed the print_error_for_LoadDispatchAPI branch from 0953824 to 2cc21f2 Compare February 5, 2026 16:20
@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2026

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

@conrade-ctc conrade-ctc force-pushed the print_error_for_LoadDispatchAPI branch 2 times, most recently from 09169df to 1440b1d Compare February 6, 2026 18:48
@github-actions
Copy link
Contributor

github-actions bot commented Feb 6, 2026

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

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

@conrade-ctc conrade-ctc force-pushed the print_error_for_LoadDispatchAPI branch from 1440b1d to 0219bb7 Compare February 6, 2026 19:03
@conrade-ctc conrade-ctc force-pushed the print_error_for_LoadDispatchAPI branch from 0219bb7 to 86d2002 Compare February 6, 2026 19:04
@github-actions
Copy link
Contributor

github-actions bot commented Feb 6, 2026

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

@conrade-ctc
Copy link
Author

conrade-ctc commented Feb 6, 2026

@vgvassilev, @aaronj0, I backed out the previous impl that pulled the statics out... I didn't realize you were relying on the inline capture of the statics... in the case, the smallest change is to abuse the dlGetProcAddress function to allow it to reset the data itself when nullptrs are sent in... it's a bit awkward to use the magic invocation, otherwise the changes would need to be a bit more detailed, and you may have other plans for how this shapes up.

FYI, I put something in for the windows version of the error output (but just the error code), but the msvc builds aren't perfectly happy... looking at those now.

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.

1 participant