#832677 improve cache support for rebuilds with different arch