[ci] Add abi compatibility check for libhl#904
[ci] Add abi compatibility check for libhl#904tobil4sk wants to merge 10 commits intoHaxeFoundation:masterfrom
Conversation
Without this, the symbol may be hidden with some compilers and therefore cannot be loaded.
These were never meant to be part of the public api, but were exported by mistake due to default symbol visibility.
This was never part of hl.h, so its removal is safe.
This was also never exposed in a header, and not exported explicitly
The purpose of this value is to change, so it does not consistitute an ABI breakage. Based on: https://developers.redhat.com/articles/2025/02/04/how-analyze-changes-enum-types-using-abidiff#detecting_and_categorizing_enum_changes
This way we do not see errors related to opaque pointers, which are opaque so that it is safe to change them.
This is what the symbols were in 1.13 and older
|
I have cleanup the setup functions so they are all in a single struct. It is an ABI breaking change but I don't really want to revert it for the sake of backward compatibility, as I prefer clean code and breaking changes than maintaining legacy messy code all over the place. I'm curious however about the sizeof link warning. Could you tell me when does it occur ? is it at runtime ? |
|
The sizeof link warning happens if you link an hlc program against one version of libhl.so, but at load time it loads newer version where I think it is helpful to provide a fully stable ABI, but if this is not feasible in general, then maybe it is possible to compromise to still improve things. The main benefit of ABI stability which would be useful is so that third-party hdlls are compatible between different versions of hashlink, because currently this is a problem when using hdlls that aren't part of the hashlink distribution. Maybe to solve this problem without restricting things too much, it might be possible to have an Is there any chance of something like that? |
This PR adds a check to ci to ensure that the abi compatibility doesn't get broken (also relevant to: #698).
Unfortunately, due to an abi breaking change in 1.15 (1e3e016) we cannot completely restore compatibility with 1.14 or older, but I would like to still try to fix as much as possible. For now I have restored compatibility with libhl 1.15. I haven't yet dealt with hdlls.
These were the main changes that broke ABI since 1.15 (e.g. in #863):
It is worth noting that there were some advantages with the non-struct version. With a raw struct, any change to hl_setup, like adding a new field to the end, can be a breaking ABI change if sizeof(hl_setup) increases. E.g.
Some symbols were missing explicit exports so they disappeared with #887. I have added
HL_PRIMto fix those. #901 is another example of that. Other symbols used to be exported also due to the old default, but weren't part of hl.h (e.g. pcre symbols or internal functions likehl_cache_init). These are excluded from the check.Here are some practical benefits to abi stability: