diff options
Diffstat (limited to 'hadrian/src/Rules/BinaryDist.hs')
-rw-r--r-- | hadrian/src/Rules/BinaryDist.hs | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/hadrian/src/Rules/BinaryDist.hs b/hadrian/src/Rules/BinaryDist.hs index 1887314659..dc86af3c4f 100644 --- a/hadrian/src/Rules/BinaryDist.hs +++ b/hadrian/src/Rules/BinaryDist.hs @@ -194,18 +194,25 @@ bindistRules = do copyDirectory (rtsIncludeDir) bindistFilesDir when windowsHost $ createGhcii (bindistFilesDir -/- "bin") + -- Call ghc-pkg recache, after copying so the package.cache is + -- accurate, then it's on the distributor to use `cp -a` to install + -- a relocatable bindist. + -- + -- N.B. the ghc-pkg executable may be prefixed with a target triple + -- (c.f. #20267). + ghcPkgName <- programName (vanillaContext Stage1 ghcPkg) + cmd_ (bindistFilesDir -/- "bin" -/- ghcPkgName) ["recache"] + -- The settings file must be regenerated by the bindist installation -- logic to account for the environment discovered by the bindist -- configure script on the host. Not on Windows, however, where - -- we do not ship a configure script with the bindist. See #20253. + -- we do not ship a configure script with the bindist. See #20254. + -- + -- N.B. we must do this after ghc-pkg has been run as it will go + -- looking for the settings files. unless windowsHost $ removeFile (bindistFilesDir -/- "lib" -/- "settings") - -- Call ghc-pkg recache, after copying so the package.cache is - -- accurate, then it's on the distributor to use `cp -a` to install - -- a relocatable bindist. - cmd_ (bindistFilesDir -/- "bin" -/- "ghc-pkg") ["recache"] - unless cross $ need ["docs"] -- TODO: we should only embed the docs that have been generated |