This indicates that we should remove/rename the build directory before we run the sanity check, since there may be "false positives" for sanity check commands when the build directory is still in place...
I'd prefer renaming for the sanity-check and renaming it back using a context manager such that --disable-cleanup-build allows proper inspection after a (failed) build
We recently ran into a broken installation when using RPATH, for which the sanity check passed.
The problem was that the binaries were finding libraries in the build directory, which is removed when completing the installation, see https://github.com/vscentrum/vsc-software-stack/issues/364#issuecomment-2210876803 for more details.
This indicates that we should remove/rename the build directory before we run the sanity check, since there may be "false positives" for sanity check commands when the build directory is still in place...