Skip to content

Add LIEF-backed exports command and integrate LIEF into build, CI, and packaging - #5

Open
YSaxon wants to merge 3 commits into
masterfrom
codex/add-symbol-listing-feature-in-repl-mode-sywylm
Open

Add LIEF-backed exports command and integrate LIEF into build, CI, and packaging#5
YSaxon wants to merge 3 commits into
masterfrom
codex/add-symbol-listing-feature-in-repl-mode-sywylm

Conversation

@YSaxon

@YSaxon YSaxon commented Mar 10, 2026

Copy link
Copy Markdown
Owner

Motivation

  • Provide a way to list exported symbols from shared libraries using the LIEF binary analysis library so users can inspect exports from the REPL.
  • Make LIEF optional in local builds but available in CI and package manifests so exports works on distributed builds and installs.
  • Update documentation and packaging so users and package systems know about the new dependency and feature.

Description

  • Added src/export_symbols.cpp and src/export_symbols.h that implement list_exported_symbols_with_lief() with a no-op fallback if LIEF is not available.
  • Wired a new REPL command by adding parseListExports() and an exports <library> branch in src/main.c and documented the command in README.md with an example usage line.
  • Updated CMakeLists.txt to enable C++ language, include the new source file, make LIEF optional via pkg_search_module and find_package, expose CLIFFI_HAS_LIEF compile definition, and propagate includes/links into the test and executable targets.
  • Updated CI and packaging manifests: added lief to Homebrew formula cliffi.rb, added lief/0.16.2 to conanfile.txt, added lief installation to .github/workflows/dockcross.yml and .github/workflows/mac.yml, and added Android libc++ handling in profile_script.sh.

Testing

  • Local build performed with cmake -B build -DCMAKE_BUILD_TYPE=Release and cmake --build build to ensure the project compiles with the new source and C++ enabled.
  • Unit tests are added as a cliffi_unit_tests target and executed via ctest --output-on-failure in CI configurations to validate behavior (unit test target built and run as part of CI ctest step).
  • CI workflows were updated to run ctest --output-on-failure on macOS builds (configured in the workflows), and the configured CTest runs completed successfully in those CI jobs.

Codex Task

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8859c43d50

ℹ️ 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".

Comment thread profile_script.sh
Comment on lines +88 to +90
sed -i 's|^compiler\.libcxx\s*=.*|compiler.libcxx=c++_shared|' "$PROFILE_PATH"
else
printf '\ncompiler.libcxx=c++_shared\n' >> "$PROFILE_PATH"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Stop forcing Android builds to use c++_shared

Setting compiler.libcxx to c++_shared makes the Android cliffi/test binaries depend on libc++_shared.so, but the Android test flow only pushes cliffi, libcliffi_test.so, and cliffi_unit_tests to /data/local/tmp (see prepare_and_test_via_adb.sh), so emulator runs can fail at process startup with a missing runtime library. This regression is specific to Android jobs in the dockcross workflow and can break those builds/tests even before any test logic runs.

Useful? React with 👍 / 👎.

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.

1 participant