Skip to content

GHA: add abicheck - #219

Draft
mdavidsaver wants to merge 1 commit into
epics-base:masterfrom
mdavidsaver:add-abicheck
Draft

mdavidsaver wants to merge 1 commit into
epics-base:masterfrom
mdavidsaver:add-abicheck

Conversation

@mdavidsaver

Copy link
Copy Markdown
Member

Add GHA usage of abicheck.

@napetrov Is there a way to define additional C preprocessor macros when abicheck dump processes headers? This library has an "expert" API which is normally hidden. User code should define PVXS_ENABLE_EXPERT_API to opt-in. I would like these added definitions to be considered public by abicheck.

I first looked for a abicheck dump -D... argument to parallel the usual -I. I then tried --gcc-options "-DPVXS_ENABLE_EXPERT_API", but saw an arg. parsing error.

@napetrov

napetrov commented Sep 18, 2026 •

Copy link
Copy Markdown

Thanks for trying this. You are right that -D... is the natural CLI syntax to expect here.

At the moment, abicheck dump takes the stable header-compilation context from .abicheck.yml, so --gcc-options is not accepted. The current way to enable the PVXS Expert API is:

# .ci-local/abicheck.yml
compile:
  defines:
    - PVXS_ENABLE_EXPERT_API

Then use the same configuration for both snapshots:

abicheck dump \
  lib/linux-*/libpvxs.so.* \
  --config .ci-local/abicheck.yml \
  -I "${HOME}/.cache/base-7.0/include" \
  -I "${HOME}/.cache/base-7.0/include/os/Linux" \
  -I "${HOME}/.cache/base-7.0/include/compiler/gcc" \
  -H include/ \
  -o /tmp/pvxs-CUR.json

and likewise for pvxs-PREV.json.

This does not change how PVXS is built. It only defines PVXS_ENABLE_EXPERT_API while abicheck parses the installed public headers, modeling a consumer that has opted into the Expert API. PVXS_API_BUILDING should not be defined because that is private to building the library itself.

Our experimental integration currently omitted this macro, so it covered only the ordinary consumer-visible API. I will update it to include the Expert declarations as requested.

I also agree that requiring a config file for this one-off case is not sufficiently intuitive. I will treat the missing dedicated, repeatable -D/--define option as an abicheck CLI gap. The intention is to add a narrow macro-definition option rather than restore unrestricted compiler-option forwarding, while keeping .abicheck.yml as the recommended form for reproducible CI and baseline generation.

I used -o above intentionally. Redirecting stdout to JSON is supported and useful for pipelines, but -o/--output is preferable when persisting a snapshot because abicheck owns the file write, performs atomic replacement, provides clearer write-error handling, and can support snapshot compression.

@napetrov napetrov 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.

Thanks — this is a useful integration, and the current workflow passes.

Please update the abicheck dump invocations before merging:

  1. Add a checked-in abicheck config used for both current and previous snapshots, with compile.defines: [PVXS_ENABLE_EXPERT_API]. The stated purpose is to validate the opt-in Expert API; the current diff only captures the ordinary consumer API. Do not add PVXS_API_BUILDING.
  2. Pin the installed abicheck version (or otherwise make the tool version explicit) so baseline comparison remains reproducible.
  3. Prefer -o /tmp/...json over stdout redirection for persisted snapshots.

The first item is blocking; the latter two are reproducibility/operability improvements.

This branch has not been deployed

No deployments
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