Commit 9dc4ad74 authored by Mikhail Glushenkov's avatar Mikhail Glushenkov
Browse files

Exit with error if a library/exe/... contains duplicate modules.

Fixes #1483.
parent 261f5437
......@@ -244,7 +244,7 @@ checkLibrary _pkg lib =
catMaybes [
check (not (null moduleDuplicates)) $
PackageBuildWarning $
PackageBuildImpossible $
"Duplicate modules in library: "
++ commaSep (map display moduleDuplicates)
]
......@@ -275,7 +275,7 @@ checkExecutable pkg exe =
++ "To use this feature you must specify 'cabal-version: >= 1.18'."
, check (not (null moduleDuplicates)) $
PackageBuildWarning $
PackageBuildImpossible $
"Duplicate modules in executable '" ++ exeName exe ++ "': "
++ commaSep (map display moduleDuplicates)
]
......@@ -301,7 +301,7 @@ checkTestSuite pkg test =
_ -> Nothing
, check (not $ null moduleDuplicates) $
PackageBuildWarning $
PackageBuildImpossible $
"Duplicate modules in test suite '" ++ testName test ++ "': "
++ commaSep (map display moduleDuplicates)
......@@ -359,7 +359,7 @@ checkBenchmark pkg bm =
_ -> Nothing
, check (not $ null moduleDuplicates) $
PackageBuildWarning $
PackageBuildImpossible $
"Duplicate modules in benchmark '" ++ benchmarkName bm ++ "': "
++ commaSep (map display moduleDuplicates)
......
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