diff options
author | Alp Mestanogullari <alpmestan@gmail.com> | 2019-05-24 18:19:22 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2019-05-30 07:28:32 -0400 |
commit | 3aa71a222ac2e5538db15ec8facb7f0253782647 (patch) | |
tree | b12578518bfa704287e78c0f479627b594b05114 /hadrian | |
parent | a1bf3413f850d0e8a68ecab6ee7f18f18b67ea56 (diff) | |
download | haskell-3aa71a222ac2e5538db15ec8facb7f0253782647.tar.gz |
Hadrian: always generate the libffi dynlibs manifest with globbing
Instead of trying to deduce which dynlibs are expected to be found (and then
copied to the RTS's build dir) in libffi's build directory, with some OS
specific logic, we now always just use `getDirectoryFilesIO` to look for
those dynlibs and record their names in the manifest. The previous logic
ended up causing problems on Windows, where we don't build dynlibs at all
for now but the manifest file's logic didn't take that into account because
it was only partially reproducing the criterions that determine whether or not
we will be building shared libraries.
This patch also re-enables the Hadrian/Windows CI job, which was failing to
build GHC precisely because of libffi shared libraries and the aforementionned
duplicated logic.
Diffstat (limited to 'hadrian')
-rw-r--r-- | hadrian/src/Rules/Libffi.hs | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/hadrian/src/Rules/Libffi.hs b/hadrian/src/Rules/Libffi.hs index 9a251c0ebe..a1a53741db 100644 --- a/hadrian/src/Rules/Libffi.hs +++ b/hadrian/src/Rules/Libffi.hs @@ -171,19 +171,15 @@ libffiRules = do dynLibFiles <- do windows <- windowsHost osx <- osxHost - let libffiName'' = libffiName' windows True - if windows - then - let libffiDll = "lib" ++ libffiName'' ++ ".dll" - in return [libffiPath -/- "inst/bin" -/- libffiDll] - else do - let libffiLibPath = libffiPath -/- "inst/lib" - dynLibsRelative <- liftIO $ getDirectoryFilesIO - libffiLibPath - (if osx - then ["lib" ++ libffiName'' ++ ".dylib*"] - else ["lib" ++ libffiName'' ++ ".so*"]) - return (fmap (libffiLibPath -/-) dynLibsRelative) + let libfilesDir = libffiPath -/- + (if windows then "inst" -/- "bin" else "inst" -/- "lib") + libffiName'' = libffiName' windows True + dynlibext + | windows = "dll" + | osx = "dylib" + | otherwise = "so" + filepat = "lib" ++ libffiName'' ++ "*." ++ dynlibext ++ "*" + liftIO $ getDirectoryFilesIO "." [libfilesDir -/- filepat] writeFileLines dynLibMan dynLibFiles putSuccess "| Successfully build libffi." |