port build_all script to python 3