Debug build.sh and associated scripts