Report the dlopen failure reason on stderr - #1101
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1101 +/- ##
==========================================
+ Coverage 87.74% 87.82% +0.08%
==========================================
Files 23 23
Lines 6429 6431 +2
==========================================
+ Hits 5641 5648 +7
+ Misses 788 783 -5
... and 2 files with indirect coverage changes
🚀 New features to boost your workflow:
|
|
clang-tidy review says "All clean, LGTM! 👍" |
aaronj0
left a comment
There was a problem hiding this comment.
LGTM! I think updating compiler-research/cppjit#63 to make use of this directly is a more robust (and platform independent) solution
DynamicLibraryManager::loadLibrary got the dlerror() text from platform::DLOpen but only emitted it under LLVM_DEBUG. cppjit's load_library builds its Python error from captured stderr, so the reason was empty. Emit the text to std::cerr; cppjit captures only std::cerr's rdbuf, not llvm::errs(). Paths.cpp already calls ::dlerror() to build this text. Co-developed-with-the-help-of: Claude Code (Fable 5, human in the loop)
e1a0b15 to
9a9d37d
Compare
|
clang-tidy review says "All clean, LGTM! 👍" |
|
@aaronj0 @vgvassilev a sequencing note, since these three depend on each other: this PR first (approved by both of you), then #1107, which stacks on it and adds the |
Sorry for the extra churn but can you cherry-pick the commit from #1107 here since they can be reviewed and and landed as a atomic change. |
DynamicLibraryManager::loadLibrary captured the dlerror() text but logged it only under LLVM_DEBUG. cppjit's load_library reads stderr to build its Python error, so it saw an empty reason. This change writes the text to std::cerr, because cppjit captures only std::cerr's rdbuf, not llvm::errs(). Paths.cpp already gets this text from ::dlerror().