feat(test): add ABI compatibility check test for shared libraries - #2629
Open
wolfv wants to merge 3 commits into
Open
feat(test): add ABI compatibility check test for shared libraries#2629wolfv wants to merge 3 commits into
wolfv wants to merge 3 commits into
Conversation
…ished versions
Adds a new `abi_check` package test that downloads the lowest previously
published version of the package matching a pin expression (`x.x` syntax,
as used in pinnings) and compares the ABI surface of the shared libraries
shipped in both packages. Within the pinned version range the test fails
when:
- a shared library was removed from the package
- the soname (ELF), install name (Mach-O) or DLL name (PE) changed
- exported symbols were removed from a library
The binaries are parsed with goblin (ELF dynamic symbol table, Mach-O
export trie with a symtab fallback and fat binary support, PE export
table). The baseline package is resolved through the repodata gateway of
the configured test channels and fetched via the package cache. When no
previously published version matches the pin (e.g. the first release in
a pin range) the check is skipped with a warning, as it is for noarch
packages.
Recipe syntax:
tests:
- abi_check:
pin: x.x # default
libraries: # optional glob filter, default: all shared libs
- lib/libfoo*
ignore_symbols: # optional globs for symbols to ignore
- _internal_*
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FtZdiZvbdfcisDw4xk3ap3
The new AbiCheck variant of TestType was not covered in the exhaustive match in the Python package inspection API. Add a PyAbiCheckTest wrapper (pin, libraries, ignore_symbols) and register it in the package module, mirroring the other test types. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FtZdiZvbdfcisDw4xk3ap3
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FtZdiZvbdfcisDw4xk3ap3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds a new
abi_checkpackage test that verifies shared libraries in a package remain ABI compatible with previously published versions. The test downloads the lowest published version matching a pin expression (e.g.,x.xfor same major.minor) and compares the exported symbols, sonames, and library presence.Key Changes
New ABI check implementation (
crates/rattler_build_core/src/package_test/abi_check.rs):goblinfor ELF, Mach-O, and PE formatslibfoo.so.1.2.3→libfoo.so.1.2.5)Recipe parsing and evaluation:
AbiCheckTeststruct to stage0 and stage1 recipe types with configurable pin, libraries, and ignore_symbolsTest infrastructure:
AbiCheckFailedandAbiCheckErrorvariants toTestErrorenumDocumentation:
Implementation Details
x.xpin syntax (same as version pinnings) to define the compatibility rangenoarchpackages and when no baseline version is foundhttps://claude.ai/code/session_01FtZdiZvbdfcisDw4xk3ap3