`--sanity-check-only` runs commands in installation dir
This leads to problems if the commands have output files since these will get placed in the installation
That's just because the sanity check is always run from the installation directory, this is not specific to --sanity-check-only: https://github.com/easybuilders/easybuild-framework/blob/c10f1e069fc50397f4089e48fa3bc92eff8b16a5/easybuild/framework/easyblock.py#L3438-L3440
We can consider changing that, I can see how this isn't the best possible way of running the sanity check, but doing so without breaking sanity checks won't be trivial...
I know we have some easyconfigs where we (ab)use the sanity check as it simplifies how we write a post install command. During the sanity check all the relevant paths are set I think this was in a bioinformatics package, where it is used to download the required databases.