This change stores packages' configure arguments during build and makes use of them while refreshing module files. This fixes problems such as in #10716.