ABI/API Breaking Change Detection Tools #520
Replies: 2 comments 12 replies
-
Nice post, this will be useful :D So it's more of a compatibility scale rather than it is or it isn't. So for C++ mods, if the ABI changes on the UE4SS.dll at all, they would break, or only if they are trying to touch certain parts of it? It seems to me like it would be a binary classification for this scenario. For "other tools", there aren't any more I know of, however, in the worst case scenario where none of the above work out, I'm pretty sure the only option involves building a C++ mod and UE4SS and then installing both onto a blank shipping game on a VM and checking the logs to see if the C++ mod gets the 0x7f error that means it failed to load due to ABI incompatibility. |
Beta Was this translation helpful? Give feedback.
-
Currently working on the ABI breakage detector in rust by using https://crates.io/crates/pdb I'm fond of the idea of generating an intermediate file since the comparison tool will only have to download two of the intermediate files instead of two PDBs. It also let us run the build wherever we can (the pseudo licensing requirement), generate the ABI intermediates from that same machine, and then upload the intermediates as an artifact. We can then just download artifacts for the new and old versions of the API and run the rust tool to detect breakage against those artifacts. I've wired up all the following cases that should flag ABI breakage pub enum ClassProblem {
RemovedOrUnexported,
HierarchyChanged,
FinalityRemoved,
FuncProblem(FuncSigProblem),
FieldProblem(FieldSigProblem),
TemplateProblem(TemplateProblem),
}
pub enum FuncSigProblem {
RemovedOrUnexported,
InlineAdded,
OverloadIntroduced,
CvQualifierChanged,
AccessRightsChanged,
ReturnTypeChanged,
VirtualProblem(VirtualMemberFuncProblem)
}
pub enum VirtualMemberFuncProblem {
Introduced,
Added,
Removed,
OverrideNonPrimaryBase,
OverrideCovariantReturnType,
}
pub enum FieldSigProblem {
Added,
Removed,
TypeChanged,
StaticSigFieldProblem(StaticFieldSigProblem)
}
pub enum StaticFieldSigProblem {
RemovedOrUnexported,
TypeChanged,
CvQualifierChanged,
}
pub enum TemplateProblem {
ArgumentsChanged
} |
Beta Was this translation helpful? Give feedback.
-
Regardless of what branching/release strategy we decide to use, I think we agree that we need some sort of automatic detection if ABI/API breaks will occur as a result of a PR being merged.
What kind of changes break the ABI?
This article has a fairly comprehensive list of the do's and don'ts of binary compatibility. I'll include an inline snippet to give us a general sense.
You cannot...
We should probably end up on the same page about what degree of ABI breaks we want our tool to detect as well as provide documentation to developers about what kind of changes they can expect to break the ABI.
Existing Tooling
ABI Compliance Checker
Requires ELF binaries if we don't want to compile the headers with an ancient version of GCC for analysis. I played around trying to get it working purely on windows, but ran into mingw/gcc issues... Maybe someone could make more headway on this?
I really like the reports it generates. Example report for netapi32.dll
Libabigail
Requires ELF binaries
Simple example
Custom Tooling
Dumpbin
We could leverage
dumpbin /exports
to compare API level symbols. This is not full ABI compatibility, but it's a start that could work for us pretty much out of the box.Other tools
I'll update this original post as people make more suggestions/considerations.
Beta Was this translation helpful? Give feedback.
All reactions