Commit 31515fad authored by Andrey Mokhov's avatar Andrey Mokhov
Browse files

Use conventional whitespacing for @.

See #210.
parent 9171856f
......@@ -105,7 +105,7 @@ ghcSplit = "inplace/lib/bin/ghc-split"
-- TODO: simplify, add programInplaceLibPath
-- | The relative path to the program executable
programPath :: Context -> Maybe FilePath
programPath context @ Context {..}
programPath context@Context {..}
| package == ghc = Just . inplaceProgram $ "ghc-stage" ++ show (fromEnum stage + 1)
| package `elem` [ghcTags, haddock, mkUserGuidePart] = case stage of
Stage2 -> Just . inplaceProgram $ pkgNameString package
......
......@@ -23,7 +23,7 @@ import Target
-- resources. Force a rebuilt if the argument list has changed since the last
-- built (that is, track changes in the build system).
buildWithResources :: [(Resource, Int)] -> Target -> Action ()
buildWithResources rs target @ Target {..} = do
buildWithResources rs target@Target {..} = do
needBuilder laxDependencies builder
path <- builderPath builder
argList <- interpret target getArgs
......
......@@ -9,7 +9,7 @@ import Settings
import Target
compilePackage :: [(Resource, Int)] -> Context -> Rules ()
compilePackage rs context @ Context {..} = do
compilePackage rs context@Context {..} = do
let buildPath = contextPath context -/- "build"
buildPath <//> "*" <.> hisuf way %> \hi ->
......
......@@ -17,7 +17,7 @@ import Target
-- Build package-data.mk by using GhcCabal to process pkgCabal file
buildPackageData :: Context -> Rules ()
buildPackageData context @ Context {..} = do
buildPackageData context@Context {..} = do
let cabalFile = pkgCabalFile package
configure = pkgPath package -/- "configure"
dataFile = pkgDataFile context
......@@ -142,7 +142,7 @@ buildPackageData context @ Context {..} = do
-- is replaced by libraries_deepseq_dist-install_VERSION = 1.4.0.0
-- Reason: Shake's built-in makefile parser doesn't recognise slashes
postProcessPackageData :: Context -> FilePath -> Action ()
postProcessPackageData context @ Context {..} file = fixFile file fixPackageData
postProcessPackageData context@Context {..} file = fixFile file fixPackageData
where
fixPackageData = unlines . map processLine . filter (not . null) . filter ('$' `notElem`) . lines
processLine line = fixKey fixedPrefix ++ suffix
......
......@@ -13,7 +13,7 @@ import Target
-- TODO: simplify handling of AutoApply.cmm
buildPackageDependencies :: [(Resource, Int)] -> Context -> Rules ()
buildPackageDependencies rs context @ Context {..} =
buildPackageDependencies rs context@Context {..} =
let path = contextPath context
buildPath = path -/- "build"
dropBuild = (pkgPath package ++) . drop (length buildPath)
......
......@@ -17,7 +17,7 @@ haddockHtmlLib = "inplace/lib/html/haddock-util.js"
-- All of them go into the 'doc' subdirectory. Pedantically tracking all built
-- files in the Shake databases seems fragile and unnecesarry.
buildPackageDocumentation :: Context -> Rules ()
buildPackageDocumentation context @ Context {..} =
buildPackageDocumentation context@Context {..} =
let cabalFile = pkgCabalFile package
haddockFile = pkgHaddockFile context
in when (stage == Stage1) $ do
......
......@@ -105,7 +105,7 @@ generate file context expr = do
putSuccess $ "| Successfully generated '" ++ file ++ "'."
generatePackageCode :: Context -> Rules ()
generatePackageCode context @ (Context stage pkg _) =
generatePackageCode context@(Context stage pkg _) =
let buildPath = contextPath context -/- "build"
generated f = (buildPath ++ "//*.hs") ?== f && not ("//autogen/*" ?== f)
file <~ gen = generate file context gen
......
......@@ -16,7 +16,7 @@ import Settings
import Target
buildPackageLibrary :: Context -> Rules ()
buildPackageLibrary context @ Context {..} = do
buildPackageLibrary context@Context {..} = do
let buildPath = contextPath context -/- "build"
libPrefix = buildPath -/- "libHS" ++ pkgNameString package
......@@ -60,7 +60,7 @@ buildPackageLibrary context @ Context {..} = do
(dropWhileEnd isPunctuation synopsis)
buildPackageGhciLibrary :: Context -> Rules ()
buildPackageGhciLibrary context @ Context {..} = priority 2 $ do
buildPackageGhciLibrary context@Context {..} = priority 2 $ do
let buildPath = contextPath context -/- "build"
libPrefix = buildPath -/- "HS" ++ pkgNameString package
......
......@@ -31,7 +31,7 @@ wrappers = [ (vanillaContext Stage0 ghc , ghcWrapper )
, (vanillaContext Stage0 ghcPkg, ghcPkgWrapper)]
buildProgram :: [(Resource, Int)] -> Context -> Rules ()
buildProgram rs context @ Context {..} = do
buildProgram rs context@Context {..} = do
let match file = case programPath context of
Nothing -> False
Just program -> program == file
......@@ -60,7 +60,7 @@ computeWrappedPath =
fmap (programInplaceLibPath ++) . stripPrefix programInplacePath
buildWrapper :: Context -> Wrapper -> FilePath -> FilePath -> Action ()
buildWrapper context @ (Context stage package _) wrapper wrapperPath binPath = do
buildWrapper context@Context {..} wrapper wrapperPath binPath = do
contents <- interpretInContext context $ wrapper binPath
writeFileChanged wrapperPath contents
makeExecutable wrapperPath
......@@ -70,7 +70,7 @@ buildWrapper context @ (Context stage package _) wrapper wrapperPath binPath = d
-- TODO: Get rid of the Paths_hsc2hs.o hack.
-- TODO: Do we need to consider other ways when building programs?
buildBinary :: [(Resource, Int)] -> Context -> FilePath -> Action ()
buildBinary rs context @ (Context stage package _) bin = do
buildBinary rs context@(Context stage package _) bin = do
let buildPath = contextPath context -/- "build"
cSrcs <- cSources context -- TODO: remove code duplication (Library.hs)
hSrcs <- hSources context
......
......@@ -12,7 +12,7 @@ import Target
-- Build package-data.mk by using GhcCabal to process pkgCabal file
registerPackage :: [(Resource, Int)] -> Context -> Rules ()
registerPackage rs context @ Context {..} = do
registerPackage rs context@Context {..} = do
let oldPath = pkgPath package -/- contextDirectory context -- TODO: remove, #113
pkgConf = packageDbDirectory stage -/- pkgNameString package
......
......@@ -13,7 +13,7 @@ import Settings.User
-- Path to the target directory from GHC source root
contextPath :: Context -> FilePath
contextPath context @ Context {..} =
contextPath context@Context {..} =
buildRootPath -/- contextDirectory context -/- pkgPath package
pkgDataFile :: Context -> FilePath
......@@ -22,19 +22,19 @@ pkgDataFile context = contextPath context -/- "package-data.mk"
-- Relative path to a package haddock file, e.g.:
-- "libraries/array/dist-install/doc/html/array/array.haddock"
pkgHaddockFile :: Context -> FilePath
pkgHaddockFile context @ Context {..} =
pkgHaddockFile context@Context {..} =
contextPath context -/- "doc/html" -/- name -/- name <.> "haddock"
where name = pkgNameString package
-- Relative path to a package library file, e.g.:
-- "libraries/array/stage2/build/libHSarray-0.5.1.0.a"
pkgLibraryFile :: Context -> Action FilePath
pkgLibraryFile context @ Context {..} = do
pkgLibraryFile context@Context {..} = do
extension <- libsuf way
pkgFile context "build/libHS" extension
pkgLibraryFile0 :: Context -> Action FilePath
pkgLibraryFile0 context @ Context {..} = do
pkgLibraryFile0 context@Context {..} = do
extension <- libsuf way
pkgFile context "build/libHS" ("-0" ++ extension)
......@@ -64,6 +64,6 @@ packageDbDirectory Stage0 = buildRootPath -/- "stage0/bootstrapping.conf"
packageDbDirectory _ = "inplace/lib/package.conf.d"
pkgConfFile :: Context -> Action FilePath
pkgConfFile context @ Context {..} = do
pkgConfFile context@Context {..} = do
componentId <- pkgData . ComponentId $ contextPath context
return $ packageDbDirectory stage -/- componentId <.> "conf"
......@@ -149,7 +149,7 @@ hibootsuf = (++ "hi-boot") . wayPrefix
-- in their own per-package directory and hence do not need a unique filename.
-- We also need to respect the system's dynamic extension, e.g. .dll or .so.
libsuf :: Way -> Action String
libsuf way @ (Way set) =
libsuf way@(Way set) =
if (not . wayUnit Dynamic $ way)
then return $ waySuffix way ++ ".a" -- e.g., _p.a
else do
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment