libgis: allow bypass of compatibility test #3378
Merged
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.
The compatibility test for C modules in https://github.com/OSGeo/grass/blob/main/lib/gis/gisinit.c is stricter than it needs to be, because GRASS has versioned shared libraries including major and minor version. That means, a C module compiled against an older version will not run simply because it will not find the old shared libraries.
With a bugfix release, binary compatibility is preserved and the test is not needed. This PR introduces a mechanism to bypass the shared libs compatibility test if the env var
GRASS_COMPATIBILITY_TEST
is set to 0 (zero). In this case a warning is issued and the module is allowed to execute. If this new env var is not set, the default behaviour with fatal error in case of differentGIS_H_VERSION
s is preserved.The motivation for this new mechanism is that for many users it might not be easy to reinstall or recompile addons written in C for each new bugfix release.