Permalink
Browse files

Merge pull request #166 from iconnect/i163

Tidy build issues
  • Loading branch information...
cdornan committed Dec 19, 2018
2 parents e5c00ca + cd3eae9 commit ff3e807801a9949f3fc56a86e9a5dd60d3edaa8c
@@ -54,8 +54,8 @@ matrix:
compiler: ": #stack 8.4.4"
addons: {apt: {packages: [libgmp-dev]}}

- env: BUILD=stack GHCVER=8.6.2 STACK_YAML=stack-8.4.yaml
compiler: ": #stack 8.6.2"
- env: BUILD=stack GHCVER=8.6.3 STACK_YAML=stack-8.6.yaml
compiler: ": #stack 8.6.3"
addons: {apt: {packages: [libgmp-dev]}}


@@ -72,9 +72,9 @@ matrix:

# Linux/stack/hackage release

- env: BUILD=release-stack GHCVER=8.0.2 STACK_YAML=stack-8.0.yaml
compiler: ": #stack 8.0.2"
addons: {apt: {packages: [libgmp-dev]}}
# - env: BUILD=release-stack GHCVER=8.0.2 STACK_YAML=stack-8.0.yaml
# compiler: ": #stack 8.0.2"
# addons: {apt: {packages: [libgmp-dev]}}

# Nightly builds are allowed to fail

@@ -41,6 +41,7 @@ two packages:
- [X] 2017-06-05 v1.0.1.3 [Suspend Windows tests for PCRE on UTF-8 text](https://github.com/iconnect/regex/milestone/22)
- [X] 2018-12-14 v1.0.1.4 [Fix for GHC 8.4.4, GHC-8.6.2](https://github.com/iconnect/regex/milestone/23)
- [X] 2018-12-18 v1.0.1.5 [TDFA quasi quoters not dealing with newlines](https://github.com/iconnect/regex/milestone/24)
- [X] 2018-12-19 v1.0.2.0 [Tidy build issues](https://github.com/iconnect/regex/milestone/25)


See the [Roadmap page](http://roadmap.regex.uk) for details.
@@ -43,7 +43,7 @@ import qualified Data.Foldable as F
import Data.Functor.Identity
import qualified Data.HashMap.Strict as HM
import Data.Maybe
import Data.Monoid
import qualified Data.Monoid as M
import qualified Data.Sequence as S
import qualified Data.Text as T
import qualified Data.Text.Encoding as TE
@@ -397,10 +397,10 @@ class (Show a,Eq a,Ord a,Extract a,Monoid a) => Replace a where
textifyR = T.pack . unpackR
detextifyR = packR . T.unpack
appendNewlineR = (<> packR "\n")
appendNewlineR = (M.<> packR "\n")
substR f m@Capture{..} =
capturePrefix m <> f capturedText <> captureSuffix m
capturePrefix m M.<> f capturedText M.<> captureSuffix m
\end{code}

\begin{code}
@@ -434,7 +434,7 @@ instance Replace [Char] where
detextifyR = T.unpack
linesR = lines
unlinesR = unlines
appendNewlineR = (<>"\n")
appendNewlineR = (M.<>"\n")
parseTemplateR = parseTemplateR' id
instance Replace B.ByteString where
@@ -445,7 +445,7 @@ instance Replace B.ByteString where
detextifyR = TE.encodeUtf8
linesR = B.lines
unlinesR = B.unlines
appendNewlineR = (<>"\n")
appendNewlineR = (M.<>"\n")
parseTemplateR = parseTemplateR' B.unpack
instance Replace LBS.ByteString where
@@ -456,7 +456,7 @@ instance Replace LBS.ByteString where
linesR = LBS.lines
unlinesR = LBS.unlines
detextifyR = LBS.fromStrict . TE.encodeUtf8
appendNewlineR = (<>"\n")
appendNewlineR = (M.<>"\n")
parseTemplateR = parseTemplateR' LBS.unpack
instance Replace (S.Seq Char) where
@@ -475,7 +475,7 @@ instance Replace T.Text where
detextifyR = id
linesR = T.lines
unlinesR = T.unlines
appendNewlineR = (<>"\n")
appendNewlineR = (M.<>"\n")
parseTemplateR = parseTemplateR' T.unpack
instance Replace LT.Text where
@@ -486,7 +486,7 @@ instance Replace LT.Text where
detextifyR = LT.fromStrict
linesR = LT.lines
unlinesR = LT.unlines
appendNewlineR = (<>"\n")
appendNewlineR = (M.<>"\n")
parseTemplateR = parseTemplateR' LT.unpack
\end{code}

@@ -1,5 +1,10 @@
-*-change-log-*-

1.0.2.0 Chris Dornan <chris.dornan@irisconnect.co.uk> 2018-12-19
* cabal-install build with 8.0 and 8.2 failing (#163)
* Switch to GHC-8.6.3/nightly-2018-12-19 (#164)
* Switch from Default-Extensions to Other-Extensions (#165)

1.0.1.5 Chris Dornan <chris.dornan@irisconnect.co.uk> 2018-12-18
* TDFA quasi quoters not dealing with newlines (#157)

@@ -26,7 +26,7 @@ import Data.IORef
import qualified Data.List as L
import qualified Data.Map as Map
import Data.Maybe
import Data.Monoid
import qualified Data.Monoid as M
import qualified Data.Text as T
import qualified Data.Text.Encoding as TE
import Prelude.Compat
@@ -160,9 +160,9 @@ default_gen ctx@Ctx{..} _ mtchs = do
mb <- readIORef _ctx_test_exe
case mb of
Nothing -> return $ ReplaceWith ln
Just te -> case isSpace $ LBS.head $ ln<>"\n" of
Just te -> case isSpace $ LBS.head $ ln M.<> "\n" of
True -> put ctx ln
False -> adjust_le (<>ln) <$> close_test_exe ctx te
False -> adjust_le (M.<>ln) <$> close_test_exe ctx te
where
ln = matchSource mtch
mtch = allMatches mtchs !! 0
@@ -203,17 +203,17 @@ put Ctx{..} lbs = do
case mb of
Nothing -> return $ ReplaceWith lbs
Just te -> do
writeIORef _ctx_test_exe $ Just te { _te_text = _te_text te <> lbs <> "\n" }
writeIORef _ctx_test_exe $ Just te { _te_text = _te_text te M.<> lbs M.<> "\n" }
return Delete
mk_test_exe :: Bool -> TestExe -> LBS.ByteString -> LBS.ByteString
mk_test_exe is_t te te_lbs_kw = (<>_te_text te) $ LBS.unlines $ concat
mk_test_exe is_t te te_lbs_kw = (M.<> _te_text te) $ LBS.unlines $ concat
[ [ LBS.pack $ printf "%s %s" (LBS.unpack te_lbs_kw) nm ]
, [ " type: exitcode-stdio-1.0" | is_t ]
]
where
nm = case is_t of
True -> LBS.unpack $ _te_name te <> "-test"
True -> LBS.unpack $ _te_name te M.<> "-test"
False -> LBS.unpack $ _te_name te
mk_build_depends :: Bool
@@ -255,7 +255,7 @@ mk_build_depends lb we fp mp pks0 = LBS.unlines $
[ " GHC-Options:"
, " -Wall"
, " -fwarn-tabs"
, " " <> w_error_or_warn
, " " M.<> w_error_or_warn
, ""
, " Build-depends:"
] ++ (map fmt $ zip (True : repeat False) $ L.sortBy comp pks)
@@ -318,7 +318,7 @@ sdist' nm readme = do
SH.cp readme "README.markdown"
SH.run_ "stack" ["sdist","--stack-yaml","stack-8.0.yaml"]
(pth,tb) <- analyse_so <$> SH.lastStderr
SH.cp (SH.fromText $ pth) $ SH.fromText $ "releases/"<>tb
SH.cp (SH.fromText $ pth) $ SH.fromText $ "releases/" M.<> tb
where
analyse_so so = (mtch!$$[cp|pth|],mtch!$$[cp|tb|])
where
@@ -333,8 +333,8 @@ establish nm nm' = SH.shelly $ SH.verbosely $ do
SH.rm_f "regex-examples.cabal"
SH.cp (SH.fromText sf) (SH.fromText df)
where
sf = "lib/"<>nm<>".cabal"
df = nm'<>".cabal"
sf = "lib/" M.<> nm M.<> ".cabal"
df = nm' M.<> ".cabal"
test_release :: T.Text -> IO ()
test_release vrn_t = do
@@ -351,10 +351,10 @@ test_release vrn_t = do
setCurrentDirectory "../.."
where
unpack rp pn = do
SH.run_ "tar" ["xzf",rp<>"/"<>pn_vrn<>".tar.gz"]
SH.mv (SH.fromText pn_vrn) (SH.fromText $ "test-"<>pn)
SH.run_ "tar" ["xzf",rp M.<> "/" M.<> pn_vrn M.<> ".tar.gz"]
SH.mv (SH.fromText pn_vrn) (SH.fromText $ "test-" M.<> pn)
where
pn_vrn = pn<>"-"<>vrn_t
pn_vrn = pn M.<> "-" M.<> vrn_t
\end{code}


@@ -17,7 +17,7 @@ The tool is self-testing: run it with no arguments (or `cabal test`).
module Main (main) where
import qualified Data.ByteString.Lazy.Char8 as LBS
import Data.Monoid
import qualified Data.Monoid as M
import qualified Data.Text as T
import Prelude.Compat
import System.Directory
@@ -149,7 +149,7 @@ source_api_mp :: ModPath
source_api_mp = "Text.RE.TDFA.ByteString.Lazy"
orphan_import :: ModPath -> LBS.ByteString
orphan_import mp = "import Text.Regex." <> LBS.pack mp <> "()"
orphan_import mp = "import Text.Regex." M.<> LBS.pack mp M.<> "()"
tdfa_re, module_re, import_re, bs_re, orp_re :: RE
tdfa_re = [re|TDFA|]
@@ -28,7 +28,7 @@ import qualified Data.ByteString.Lazy.Char8 as LBS
import Data.IORef
import qualified Data.List as L
import Data.Maybe
import Data.Monoid
import qualified Data.Monoid as M
import qualified Data.Text as T
import Network.HTTP.Conduit
import Prelude.Compat
@@ -301,16 +301,16 @@ use these definitions instead.
\begin{code}
begin_code, end_code :: LBS.ByteString
begin_code = "\\"<>"begin{code}"
end_code = "\\"<>"end{code}"
begin_code = "\\" M.<> "begin{code}"
end_code = "\\" M.<> "end{code}"
\end{code}
\begin{code}
mk_list :: [String] -> [LBS.ByteString]
mk_list [] = [" []"]
mk_list (ide0:ides) = f "[" ide0 $ foldr (f ",") [" ]"] ides
where
f pfx ide t = (" "<>pfx<>" "<>LBS.pack ide) : t
f pfx ide t = (" " M.<> pfx M.<> " " M.<> LBS.pack ide) : t
\end{code}
@@ -533,7 +533,7 @@ pandoc_page :: Page -> IO ()
pandoc_page pg = do
mt_lbs <- setup_ttl <$> LBS.readFile (page_master_file pg)
(hdgs,md_lbs) <- prep_page' MM_pandoc mt_lbs
LBS.writeFile "tmp/metadata.markdown" $ LBS.unlines ["---","title: "<>page_title pg,"---"]
LBS.writeFile "tmp/metadata.markdown" $ LBS.unlines ["---","title: " M.<> page_title pg,"---"]
LBS.writeFile "tmp/heading.markdown" $ page_heading pg
LBS.writeFile "tmp/page_pre_body.html" $ mk_pre_body_html pg hdgs
LBS.writeFile "tmp/page_pst_body.html" pst_body_html
@@ -574,7 +574,7 @@ data MarkdownMode
page_heading :: Page -> LBS.ByteString
page_heading PG_index = ""
page_heading pg =
"<p class='pagebc'><a href='.' title='Home'>Home</a> &raquo; **"<>page_title pg<>"**</p>\n"
"<p class='pagebc'><a href='.' title='Home'>Home</a> &raquo; **" M.<> page_title pg M.<> "**</p>\n"
prep_page :: LBS.ByteString -> MarkdownMode -> FilePath -> FilePath -> IO ()
prep_page ttl mmd in_fp out_fp = do
@@ -597,7 +597,7 @@ prep_page' mmd lbs = do
lbs1 <- fmap (tweak_md mmd) $ sed' (scr rf_h rf_t) =<< include lbs
lbs2 <- fromMaybe "" <$> fin_task_list' mmd rf_t
hdgs <- reverse <$> readIORef rf_h
return (hdgs,lbs1<>lbs2)
return (hdgs,lbs1 M.<> lbs2)
where
scr rf_h rf_t = Select
[ Function [re|^%heading#${ide}(@{%id}) +${ttl}([^ ].*)$|] TOP $ heading mmd rf_t rf_h
@@ -617,32 +617,32 @@ heading :: MarkdownMode
heading mmd rf_t rf_h _ mtch _ _ = do
lbs <- fromMaybe "" <$> fin_task_list' mmd rf_t
modifyIORef rf_h (Heading ide ttl:)
return $ Just $ lbs<>h2
return $ Just $ lbs M.<> h2
where
h2 = case mmd of
MM_github -> "## "<>ttl
MM_hackage -> "## "<>ttl
MM_pandoc -> "<h2 id='"<>ide<>"'>"<>ttl<>"</h2>"
MM_github -> "## " M.<> ttl
MM_hackage -> "## " M.<> ttl
MM_pandoc -> "<h2 id='" M.<> ide M.<> "'>" M.<> ttl M.<> "</h2>"
ide = mtch !$$ [cp|ide|]
ttl = mtch !$$ [cp|ttl|]
mk_pre_body_html :: Page -> [Heading] -> LBS.ByteString
mk_pre_body_html pg hdgs = hdr <> LBS.concat (map nav [minBound..maxBound]) <> ftr
mk_pre_body_html pg hdgs = hdr M.<> LBS.concat (map nav [minBound..maxBound]) M.<> ftr
where
hdr :: LBS.ByteString
hdr = [here| <div id="container">
<div id="sidebar">
<div id="corner">
|] <> branding <> [here|
|] M.<> branding M.<> [here|
</div>
<div class="widget" id="pages">
<ul class="page-nav">
|]
nav dst_pg = LBS.unlines $
nav_li " " pg_cls pg_adr pg_ttl :
[ nav_li " " ["secnav"] ("#"<>_hdg_id) _hdg_title
[ nav_li " " ["secnav"] ("#" M.<> _hdg_id) _hdg_title
| Heading{..} <- hdgs
, is_moi
]
@@ -708,7 +708,7 @@ mk_pre_body_html pg hdgs = hdr <> LBS.concat (map nav [minBound..maxBound]) <> f
pst_body_html :: LBS.ByteString
pst_body_html = [here| </div>
</div>
|] <> tracking
|] M.<> tracking
\end{code}
@@ -729,7 +729,7 @@ task_list :: MarkdownMode -- ^ what flavour of md are we generatin
task_list mmd rf chk _ mtch _ _ =
case mmd of
MM_github -> return Nothing
MM_hackage -> return $ Just $ "&nbsp;&nbsp;&nbsp;&nbsp;"<>cb<>"&nbsp;&nbsp;"<>itm<>"\n"
MM_hackage -> return $ Just $ "&nbsp;&nbsp;&nbsp;&nbsp;" M.<> cb M.<> "&nbsp;&nbsp;" M.<> itm M.<> "\n"
MM_pandoc -> do
in_tl <- readIORef rf
writeIORef rf True
@@ -759,7 +759,7 @@ fin_task_list :: MarkdownMode -- ^ what flavour of md are we gener
-> Capture LBS.ByteString -- ^ the capture weare replacing (unsuded)
-> IO (Maybe LBS.ByteString) -- ^ the replacement text, or Nothing to indicate no change to this line
fin_task_list mmd rf_t _ mtch _ _ =
fmap (<>matchSource mtch) <$> fin_task_list' mmd rf_t
fmap ( M.<> matchSource mtch) <$> fin_task_list' mmd rf_t
-- | close any task list being processed, returning the closing text
-- as necessary
@@ -788,7 +788,7 @@ pandoc_lhs' title repo_path in_file out_file = do
LBS.writeFile "tmp/metadata.markdown" $
LBS.unlines
[ "---"
, "title: "<>LBS.pack title
, "title: " M.<> LBS.pack title
, "---"
]
LBS.writeFile "tmp/bc.html" bc
@@ -812,21 +812,21 @@ pandoc_lhs' title repo_path in_file out_file = do
where
bc = LBS.unlines
-- [ "<div class='brandingdiv'>"
-- , " " <> branding
-- , " " M.<> branding
-- , "</div>"
[ "<div class='bcdiv'>"
, " <ol class='breadcrumb'>"
, " <li>"<>branding<>"</li>"
, " <li><a title='source file' href='" <>
repo_url <> "'>" <> (LBS.pack title) <> "</a></li>"
, " <li>" M.<> branding M.<> "</li>"
, " <li><a title='source file' href='" M.<>
repo_url M.<> "'>" M.<> (LBS.pack title) M.<> "</a></li>"
, "</ol>"
, "</div>"
, "<div class='litcontent'>"
]
ft = LBS.concat
[ "</div>"
] <> tracking
] M.<> tracking
repo_url = LBS.concat
[ "https://github.com/iconnect/regex/blob/master/"
Oops, something went wrong.

0 comments on commit ff3e807

Please sign in to comment.