Sort build path candidates to make nesting detection work.