Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

remove unused parameters of collectShims #222

Merged
merged 2 commits into from

2 participants

@osa1

This is useful for programs that use GHCJS as a library to parse shims -- otherwise we have to provide dummy values.

@luite luite merged commit d711e50 into ghcjs:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 17, 2014
  1. @osa1
  2. @osa1
This page is out of date. Refresh to see the latest.
View
2  src/Compiler/GhcjsProgram.hs
@@ -260,7 +260,7 @@ generateLib settings = do
v = map fromIntegral (versionBranch $ pkgVersion p)
in (T.pack n, v)
pkgs' = M.toList $ M.fromListWith max (map convertPkg pkgs)
- (beforeFiles, afterFiles) <- Gen2.collectShims dflags2 settings base pkgs'
+ (beforeFiles, afterFiles) <- Gen2.collectShims base pkgs'
B.writeFile "lib.js" . mconcat =<< mapM B.readFile beforeFiles
B.writeFile "lib1.js" . mconcat =<< mapM B.readFile afterFiles
putStrLn "generated lib.js and lib1.js for:"
View
8 src/Gen2/Linker.hs
@@ -179,7 +179,7 @@ link' dflags settings target include pkgs objFiles jsFiles isRootFun extraStatic
base' = Base compactorState (nub $ basePkgs base ++ map (T.pack . packageIdString) pkgs')
(allDeps `S.union` baseUnits base)
libJsFiles <- concat <$> mapM getLibJsFiles (concatMap snd pkgs)
- (shimsBefore, shimsAfter) <- getShims dflags settings (jsFiles ++ libJsFiles) pkgs'
+ (shimsBefore, shimsAfter) <- getShims dflags (jsFiles ++ libJsFiles) pkgs'
return $ LinkResult outJs stats metaSize shimsBefore shimsAfter base'
where
isAlreadyLinked :: Base -> PackageId -> Bool
@@ -301,9 +301,9 @@ getLibJsFiles pkgLibPath = go pkgLibPath "js"
return (e && map toLower (takeExtension path) == ".js")
-- fixme the wired-in package id's we get from GHC we have no version
-getShims :: DynFlags -> GhcjsSettings -> [FilePath] -> [PackageId] -> IO ([FilePath], [FilePath])
-getShims dflags settings extraFiles pkgDeps = do
- (b,a) <- collectShims dflags settings (getLibDir dflags </> "shims") (map convertPkg pkgDeps)
+getShims :: DynFlags -> [FilePath] -> [PackageId] -> IO ([FilePath], [FilePath])
+getShims dflags extraFiles pkgDeps = do
+ (b,a) <- collectShims (getLibDir dflags </> "shims") (map convertPkg pkgDeps)
extraFiles' <- mapM canonicalizePath extraFiles
return (b++extraFiles',a)
View
6 src/Gen2/Shim.hs
@@ -87,12 +87,10 @@ instance FromJSON VersionRange where
parseJSON (String t) = maybe mempty pure (parseVersionRange t)
parseJSON _ = mempty
-collectShims :: DynFlags
- -> GhcjsSettings
- -> FilePath -- ^ the base path
+collectShims :: FilePath -- ^ the base path
-> [(Text, Version)] -- ^ packages being linked
-> IO ([FilePath], [FilePath]) -- ^ files to load (before, after) rts
-collectShims dflags settings base pkgs = do
+collectShims base pkgs = do
files <- mapM (collectShim base) pkgs
let files' = map (base </>) (concat files)
(beforeRts, afterRts) = splitFiles files'
Something went wrong with that request. Please try again.