diff options
author | Matthew Pickering <matthewtpickering@gmail.com> | 2022-03-28 14:31:43 +0100 |
---|---|---|
committer | Matthew Pickering <matthewtpickering@gmail.com> | 2022-03-31 18:45:06 +0100 |
commit | fc621dbbb689aaf2ba755168089ec235210565cc (patch) | |
tree | a650b0502ab4774b556d7e55ba0f2f0910ae409d | |
parent | 21894a6318e0daffa0e34041855c3c73ad1f5b6f (diff) | |
download | haskell-fc621dbbb689aaf2ba755168089ec235210565cc.tar.gz |
hadrian: Remove linters-common from bindist
Zubin observed that the bindists contains the utility library
linters-common. There are two options:
1. Make sure only the right files are added into the bindist.. a bit
tricky due to the non-trivial structure of the lib directory.
2. Remove the bad files once they get copied in.. a bit easier
So I went for option 2 but we perhaps should go for option 1 in the
future.
Fixes #21203
-rw-r--r-- | hadrian/src/Context.hs | 13 | ||||
-rw-r--r-- | hadrian/src/Rules/BinaryDist.hs | 12 |
2 files changed, 22 insertions, 3 deletions
diff --git a/hadrian/src/Context.hs b/hadrian/src/Context.hs index c7d321eba9..80566288c4 100644 --- a/hadrian/src/Context.hs +++ b/hadrian/src/Context.hs @@ -7,7 +7,8 @@ module Context ( -- * Paths contextDir, buildPath, buildDir, pkgInplaceConfig, pkgSetupConfigFile, - pkgHaddockFile, pkgRegisteredLibraryFile, pkgLibraryFile, pkgGhciLibraryFile, + pkgHaddockFile, pkgRegisteredLibraryFile, pkgRegisteredLibraryFileName, + pkgLibraryFile, pkgGhciLibraryFile, pkgConfFile, objectPath, contextPath, getContextPath, libPath, distDir, haddockStatsFilesDir ) where @@ -97,13 +98,19 @@ pkgRegisteredLibraryFile :: Context -> Action FilePath pkgRegisteredLibraryFile context@Context {..} = do libDir <- libPath context pkgId <- pkgIdentifier package - extension <- libsuf stage way - fileName <- pkgFileName package "libHS" extension + fileName <- pkgRegisteredLibraryFileName context distDir <- distDir stage return $ if Dynamic `wayUnit` way then libDir -/- distDir -/- fileName else libDir -/- distDir -/- pkgId -/- fileName +-- | Just the final filename portion of pkgRegisteredLibraryFile +pkgRegisteredLibraryFileName :: Context -> Action FilePath +pkgRegisteredLibraryFileName Context{..} = do + extension <- libsuf stage way + pkgFileName package "libHS" extension + + -- | Path to the library file of a given 'Context', e.g.: -- @_build/stage1/libraries/array/build/libHSarray-0.5.1.0.a@. pkgLibraryFile :: Context -> Action FilePath diff --git a/hadrian/src/Rules/BinaryDist.hs b/hadrian/src/Rules/BinaryDist.hs index e53f686512..b47eff4eec 100644 --- a/hadrian/src/Rules/BinaryDist.hs +++ b/hadrian/src/Rules/BinaryDist.hs @@ -203,6 +203,18 @@ bindistRules = do ghcPkgName <- programName (vanillaContext Stage1 ghcPkg) cmd_ (bindistFilesDir -/- "bin" -/- ghcPkgName) ["recache"] + + -- HACK: Drop stuff from lintersCommon package as this for GHC developers and not of interest to end-users (#21203) + pkg_id <- pkgIdentifier lintersCommon + cmd_ (bindistFilesDir -/- "bin" -/- ghcPkgName) ["unregister", pkg_id] + removeDirectory (bindistFilesDir -/- "lib" -/- distDir -/- pkg_id) + + removeFile =<< + ((bindistFilesDir -/- "lib" -/- distDir) -/-) + <$> pkgRegisteredLibraryFileName (Context Stage1 lintersCommon dynamic) + + + -- 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 |