JohannesEbke/a4 — Issue #98: Pain prevention: run-time link version check
Author: pwaller
Created: 2012-03-05 18:27:39+00:00
State: open

I just spent quite a while struggling to understand why `./waf --check build install` was failing due to an undefined symbol when gtests was run, which upon inspection was clearly defined in `liba4io.so`. This isn't the first time I've seen this sort of problem.

There a few problems at work here:

* The tests were picking up the _installed_ library, not the recently built one.
* The tests were run before the installation step.
* The incompatible test binary and the library _almost_ worked together but just displayed odd behaviour.

I was trying to imagine a way to detect incompatible libraries. One way would be to run something like `git describe --all --dirty=-dirty --abbrev=4 --long` at configure time, if it is available (or otherwise refer to a VERSION) or somesuch, and to write it as a macro into the `config.h`. a4io could define a function somewhere which returns this string, and then it can be compared in the application. This might be a bit involved though for the payout which will be rare (but when it does save your ass it saves significant time).