Update README in header checker for header-abi-diff configuration
Add description of the config format and logic for developer to add flags to header-abi-diff in Cross-Version ABI Check. Test: no need Bug: 239790286 Change-Id: I5b8fbe57aaafd1357495395a416a5d6b51f0ff3f
This commit is contained in:
@@ -78,6 +78,64 @@ For more command line options, run `header-abi-diff --help`.
|
||||
* `16`: ELF incompatible (Some symbols in the `.dynsym` table, not exported by
|
||||
public headers, were removed.)
|
||||
|
||||
### Configuration
|
||||
header-abi-diff reads a config file named `config.json`. The config file must
|
||||
be placed in the dump directory, such as
|
||||
`prebuilts/abi-dumps/platform/33/64/x86_64/source-based/config.json`.
|
||||
The file consists of multiple sections. There are two types of config sections:
|
||||
global config section and library config section. Each library config section
|
||||
contains flags for a specific version and a library. header-abi-diff chooses
|
||||
the library config section by options `-target-version` and `-lib`.
|
||||
header-abi-diff applies cli flags first, then the global config section and
|
||||
library config section.
|
||||
|
||||
#### Target version
|
||||
The Soong Build System performs Cross-Version ABI Check. For example, when the
|
||||
future SDK version of current source is 34, the source ABI dump would be diffed
|
||||
with version 33 dump to check the backward compatibility. In this case, the
|
||||
`-target-version 34` is passed to header-abi-diff to select the corresponding
|
||||
config section.
|
||||
|
||||
#### Format
|
||||
Here is an example of a config.json.
|
||||
```json
|
||||
{
|
||||
"global": {
|
||||
"flags": {
|
||||
"allow_adding_removing_weak_symbols": true,
|
||||
},
|
||||
},
|
||||
"libfoo": [
|
||||
{
|
||||
"target_version": "current",
|
||||
"flags": {
|
||||
"check_all_apis": true,
|
||||
},
|
||||
},
|
||||
{
|
||||
"target_version": "34",
|
||||
"flags": {
|
||||
"allow_extensions": true,
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
#### Library Config Section
|
||||
A library config section includes two members: "target_version" and "flags".
|
||||
header-abi-diff selects the config section that matches the target version
|
||||
given by cli.
|
||||
Take above config as an example, if `-target-version 34` and `-lib libfoo` are
|
||||
specified, the selected config section is:
|
||||
```json
|
||||
{
|
||||
"target_version": "34",
|
||||
"flags": {
|
||||
"allow_extensions": true,
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Create Reference ABI Dumps
|
||||
|
||||
|
||||
Reference in New Issue
Block a user