Add REPL exports command backed by optional LIEF integration - #4
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2ea66090b4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| #include <memory> | ||
|
|
||
| bool list_exported_symbols_with_lief(const char* library_path) { | ||
| std::unique_ptr<LIEF::Binary> binary = LIEF::Parser::parse(library_path); |
There was a problem hiding this comment.
Set a minimum C++ standard for the LIEF codepath
This new implementation uses C++11 features (std::unique_ptr and range-based iteration), but the build files do not set CMAKE_CXX_STANDARD (or target-level CXX_STANDARD), so builds that enable LIEF on toolchains whose default is pre-C++11 will fail at compile time. This is especially risky for older cross-compilers in the dockcross/conan workflow where defaults vary by image.
Useful? React with 👍 / 👎.
Motivation
Description
src/export_symbols.cppand headersrc/export_symbols.hthat exposelist_exported_symbols_with_lief()and print exported symbol names whenCLIFFI_HAS_LIEFis enabled.parseListExports()and wireexports <library>intosrc/main.c(help text, command routing, and error handling) to call the new module.CMakeLists.txtto enable C++ compilation, addexport_symbols.cppto sources, and detect/link LIEF via pkg-config orfind_package(lief)depending on the build flow; exposeCLIFFI_HAS_LIEFcompile-time definition when found.lief/0.15.1toconanfile.txt, updateREADME.mddocs, Homebrew formulacliffi.rb, and macOS CI steps to include LIEF so cross-arch CI can supply the dependency.exportsprints a clear error instructing users to rebuild with LIEF support.Testing
cmake -S . -B build -DCMAKE_BUILD_TYPE=Releaseandcmake --build build -j4successfully.ctest --output-on-failureand all unit/integration tests passed (156/156tests passed).printf 'exports ./build/libcliffi_test.so\nexit\n' | ./build/cliffi --repland observed the graceful fallback error message (expected behavior).conan installto validate Conan/CMakeDeps flow butconanwas not available in the environment, so cross-arch package validation was not executed locally.Codex Task