Fix #9139 - Don't crash on MSSQL relations
Refactor plugin staging to build dir and python script compiling