hadrian: Fix Windows packaging
This fixes #24525 (closed), a regression due to 41cbaf44.
Specifically, GHC expects to find the mingw32 toolchain in the binary distribution
root. However, after this patch it was packaged in the lib/
directory.
While in the area, I performed a small install-time optimisation:
Previously we would call dirname
twice per installed library file.
We now instead reuse this result. This helps appreciably on Windows, where
processes are quite expensive.
Also includes a number of infrastructural fixes found while uploading a first-cut of 9.10.1-alpha1.
Edited by Ben Gamari