Depends upon whether it is commercially reasonable to expect the delivery, or if it is impossible or there is a force majeure clause in the agreement. In other words, if X has other sources, then the obligation remains his burden, regardless of what it might cost. If too expensive to cover the obligation (cant make any profit) then it is reasonable to breach the contract (if no other excuse available) and pay damages, rather than be forced into paying more than the contract is worth.