Skip to content

Commit 920fa7f

Browse files
committed
remove early experiment "import" fields in TestSuite and Benchmark
1 parent 3f2f2f8 commit 920fa7f

File tree

7 files changed

+1
-22
lines changed

7 files changed

+1
-22
lines changed

Cabal-syntax/src/Distribution/PackageDescription/FieldGrammar.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ executableFieldGrammar
283283
=> UnqualComponentName
284284
-> g Executable Executable
285285
executableFieldGrammar n =
286-
Executable n []
286+
Executable n
287287
-- main-is is optional as conditional blocks don't have it
288288
<$> optionalFieldDefAla "main-is" RelativePathNT L.modulePath (modulePath mempty)
289289
<*> optionalFieldDef "scope" L.exeScope ExecutablePublic

Cabal-syntax/src/Distribution/Types/Executable.hs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,13 @@ import Prelude ()
1515
import Distribution.ModuleName
1616
import Distribution.Types.BuildInfo
1717
import Distribution.Types.ExecutableScope
18-
import Distribution.Types.Imports
1918
import Distribution.Types.UnqualComponentName
2019
import Distribution.Utils.Path
2120

2221
import qualified Distribution.Types.BuildInfo.Lens as L
2322

2423
data Executable = Executable
2524
{ exeName :: UnqualComponentName
26-
, exeImports :: [ImportName]
27-
-- ^ Retained for exact print
2825
, modulePath :: RelativePath Source File
2926
, exeScope :: ExecutableScope
3027
, buildInfo :: BuildInfo
@@ -42,7 +39,6 @@ instance Monoid Executable where
4239
mempty =
4340
Executable
4441
{ exeName = mempty
45-
, exeImports = mempty
4642
, modulePath = unsafeMakeSymbolicPath ""
4743
, exeScope = mempty
4844
, buildInfo = mempty
@@ -53,7 +49,6 @@ instance Semigroup Executable where
5349
a <> b =
5450
Executable
5551
{ exeName = combineNames a b exeName "executable"
56-
, exeImports = combine exeImports
5752
, modulePath = unsafeMakeSymbolicPath $ combineNames a b (getSymbolicPath . modulePath) "modulePath"
5853
, exeScope = combine exeScope
5954
, buildInfo = combine buildInfo

Cabal-syntax/src/Distribution/Types/TestSuite.hs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import Distribution.Compat.Prelude
1313
import Prelude ()
1414

1515
import Distribution.Types.BuildInfo
16-
import Distribution.Types.Imports
1716
import Distribution.Types.TestSuiteInterface
1817
import Distribution.Types.TestType
1918
import Distribution.Types.UnqualComponentName
@@ -25,7 +24,6 @@ import qualified Distribution.Types.BuildInfo.Lens as L
2524
-- | A \"test-suite\" stanza in a cabal file.
2625
data TestSuite = TestSuite
2726
{ testName :: UnqualComponentName
28-
, testSuiteImports :: [ImportName]
2927
, testInterface :: TestSuiteInterface
3028
, testBuildInfo :: BuildInfo
3129
, testCodeGenerators :: [String]
@@ -44,7 +42,6 @@ instance Monoid TestSuite where
4442
mempty =
4543
TestSuite
4644
{ testName = mempty
47-
, testSuiteImports = mempty
4845
, testInterface = mempty
4946
, testBuildInfo = mempty
5047
, testCodeGenerators = mempty
@@ -55,7 +52,6 @@ instance Semigroup TestSuite where
5552
a <> b =
5653
TestSuite
5754
{ testName = combineNames a b testName "test"
58-
, testSuiteImports = combine testSuiteImports
5955
, testInterface = combine testInterface
6056
, testBuildInfo = combine testBuildInfo
6157
, testCodeGenerators = combine testCodeGenerators

Cabal-syntax/src/Distribution/Types/TestSuite/Lens.hs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,12 @@ import Distribution.Compat.Prelude
88
import Prelude ()
99

1010
import Distribution.Types.BuildInfo (BuildInfo)
11-
import Distribution.Types.Imports (ImportName)
1211
import Distribution.Types.TestSuite (TestSuite)
1312
import Distribution.Types.TestSuiteInterface (TestSuiteInterface)
1413
import Distribution.Types.UnqualComponentName (UnqualComponentName)
1514

1615
import qualified Distribution.Types.TestSuite as T
1716

18-
testSuiteImports :: Lens' TestSuite [ImportName]
19-
testSuiteImports f s = fmap (\x -> s{T.testSuiteImports = x}) (f (T.testSuiteImports s))
20-
{-# INLINE testSuiteImports #-}
21-
2217
testName :: Lens' TestSuite UnqualComponentName
2318
testName f s = fmap (\x -> s{T.testName = x}) (f (T.testName s))
2419
{-# INLINE testName #-}

Cabal/src/Distribution/PackageDescription/Check/Target.hs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ checkExecutable
138138
ads
139139
exe@( Executable
140140
exeName_
141-
_exeImports_
142141
symbolicModulePath_
143142
_exeScope_
144143
buildInfo_
@@ -195,7 +194,6 @@ checkTestSuite
195194
ads
196195
ts@( TestSuite
197196
testName_
198-
_testImports_
199197
testInterface_
200198
testBuildInfo_
201199
_testCodeGenerators_

Cabal/src/Distribution/Simple/Build.hs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -767,7 +767,6 @@ testSuiteExeV10AsExe :: TestSuite -> Executable
767767
testSuiteExeV10AsExe test@TestSuite{testInterface = TestSuiteExeV10 _ mainFile} =
768768
Executable
769769
{ exeName = testName test
770-
, exeImports = mempty
771770
, modulePath = mainFile
772771
, exeScope = ExecutablePublic
773772
, buildInfo = testBuildInfo test
@@ -779,7 +778,6 @@ benchmarkExeV10asExe :: Benchmark -> Executable
779778
benchmarkExeV10asExe bm@Benchmark{benchmarkInterface = BenchmarkExeV10 _ mainFile} =
780779
Executable
781780
{ exeName = benchmarkName bm
782-
, exeImports = mempty
783781
, modulePath = mainFile
784782
, exeScope = ExecutablePublic
785783
, buildInfo = benchmarkBuildInfo bm
@@ -862,7 +860,6 @@ testSuiteLibV09AsLibAndExe
862860
exe =
863861
Executable
864862
{ exeName = mkUnqualComponentName $ stubName test
865-
, exeImports = mempty
866863
, modulePath = makeRelativePathEx $ stubFilePath test
867864
, exeScope = ExecutablePublic
868865
, buildInfo =

Cabal/src/Distribution/Simple/Haddock.hs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -994,7 +994,6 @@ compToExe comp =
994994
Just
995995
Executable
996996
{ exeName = testName test
997-
, exeImports = mempty
998997
, modulePath = f
999998
, exeScope = ExecutablePublic
1000999
, buildInfo = testBuildInfo test
@@ -1003,7 +1002,6 @@ compToExe comp =
10031002
Just
10041003
Executable
10051004
{ exeName = benchmarkName bench
1006-
, exeImports = mempty
10071005
, modulePath = f
10081006
, exeScope = ExecutablePublic
10091007
, buildInfo = benchmarkBuildInfo bench

0 commit comments

Comments
 (0)