Sven Tennie pushed to branch wip/supersven/libDir-setting at Glasgow Haskell Compiler / GHC

Commits:

1 changed file:

Changes:

  • hadrian/src/Rules/BinaryDist.hs
    ... ... @@ -232,17 +232,6 @@ bindistRules = do
    232 232
             copyDirectory (rtsIncludeDir)         bindistFilesDir
    
    233 233
             when windowsHost $ createGhcii (bindistFilesDir -/- "bin")
    
    234 234
     
    
    235
    -        -- Call ghc-pkg recache, after copying so the package.cache is
    
    236
    -        -- accurate, then it's on the distributor to use `cp -a` to install
    
    237
    -        -- a relocatable bindist.
    
    238
    -        --
    
    239
    -        -- N.B. the ghc-pkg executable may be prefixed with a target triple
    
    240
    -        -- (c.f. #20267).
    
    241
    -        ghcPkgName <- programName (vanillaContext Stage1 ghcPkg)
    
    242
    -        cmd_ (bindistFilesDir -/- "bin" -/- ghcPkgName) ["recache"]
    
    243
    -
    
    244
    -
    
    245
    -
    
    246 235
             -- TODO: we should only embed the docs that have been generated
    
    247 236
             -- depending on the current settings (flavours' "ghcDocs" field and
    
    248 237
             -- "--docs=.." command-line flag)
    
    ... ... @@ -280,6 +269,15 @@ bindistRules = do
    280 269
             whenM (liftIO (IO.doesDirectoryExist (root -/- "manpage"))) $ do
    
    281 270
               copyDirectory (root -/- "manpage") bindistFilesDir
    
    282 271
     
    
    272
    +        -- Call ghc-pkg recache at the very end, after all file operations.
    
    273
    +        -- This ensures package.cache has the most recent timestamp, which is
    
    274
    +        -- important on Windows where 'cp -a' preserves timestamps.
    
    275
    +        --
    
    276
    +        -- N.B. the ghc-pkg executable may be prefixed with a target triple
    
    277
    +        -- (c.f. #20267).
    
    278
    +        ghcPkgName <- programName (vanillaContext Stage1 ghcPkg)
    
    279
    +        cmd_ (bindistFilesDir -/- "bin" -/- ghcPkgName) ["recache"]
    
    280
    +
    
    283 281
             -- We then 'need' all the files necessary to configure and install
    
    284 282
             -- (as in, './configure [...] && make install') this build on some
    
    285 283
             -- other machine.