Skip to content

Commit 53509c4

Browse files
fendorDanielG
authored andcommitted
Turn private library into common stanza
Private libraries have a bunch of bugs in cabal currently: * haskell/cabal#6211 * haskell/cabal#6483 and devs of haskell-ide-engine are encountering this bug frequently. To mitigate this issue, remove usage of private libraries and use a common stanza to have the same re-use as before. This change can be undone when the mentioned issues have been resolved.
1 parent 1c0f2e8 commit 53509c4

File tree

1 file changed

+20
-15
lines changed

1 file changed

+20
-15
lines changed

cabal-helper.cabal

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,9 @@ common build-deps
113113
ghc-options: -Wall
114114

115115

116-
library c-h-internal
116+
common c-h-internal
117117
import: build-deps, extensions
118-
exposed-modules:
118+
other-modules:
119119
CabalHelper.Compiletime.Cabal
120120
CabalHelper.Compiletime.CompPrograms
121121
CabalHelper.Compiletime.Compat.Environment
@@ -139,62 +139,67 @@ library c-h-internal
139139
Paths_cabal_helper
140140
autogen-modules:
141141
Paths_cabal_helper
142-
exposed-modules:
142+
other-modules:
143143
Symlink
144144
if os(windows)
145145
hs-source-dirs: os/win
146146
else
147147
hs-source-dirs: os/posix
148148
hs-source-dirs: src
149149

150+
common c-h-lib
151+
import: build-deps, extensions, c-h-internal
152+
other-modules:
153+
Distribution.Helper
154+
Distribution.Helper.Discover
155+
other-modules:
156+
Paths_cabal_helper
157+
autogen-modules:
158+
Paths_cabal_helper
159+
hs-source-dirs: lib
160+
150161
library
151-
import: build-deps, extensions
162+
import: build-deps, extensions, c-h-internal
152163
exposed-modules: Distribution.Helper
153164
Distribution.Helper.Discover
154165
other-modules:
155166
Paths_cabal_helper
156167
autogen-modules:
157168
Paths_cabal_helper
158169
hs-source-dirs: lib
159-
build-depends: c-h-internal
160170

161171
test-suite compile-test
162-
import: build-deps, extensions
172+
import: build-deps, extensions, c-h-internal
163173
type: exitcode-stdio-1.0
164174
main-is: CompileTest.hs
165175
other-modules: TestOptions
166176
hs-source-dirs: tests
167177
ghc-options: -Wall
168-
build-depends: c-h-internal
169178

170179
test-suite programs-test
171-
import: build-deps, extensions
180+
import: build-deps, extensions, c-h-internal
172181
type: exitcode-stdio-1.0
173182
main-is: ProgramsTest.hs
174183
hs-source-dirs: tests
175184
ghc-options: -Wall
176-
build-depends: c-h-internal
177-
, pretty-show
185+
build-depends: pretty-show
178186

179187
test-suite ghc-session
180-
import: build-deps, extensions
188+
import: build-deps, extensions, c-h-lib
181189
type: exitcode-stdio-1.0
182190
main-is: GhcSession.hs
183191
other-modules: TestOptions
184192
hs-source-dirs: tests
185193
ghc-options: -Wall
186194
build-depends: ghc < 8.9 && >= 8.0.2
187195
, pretty-show < 1.9 && >= 1.8.1
188-
, cabal-helper
189-
, c-h-internal
190196

191197
test-suite examples
192-
import: build-deps, extensions
198+
import: build-deps, extensions, c-h-lib
193199
type: exitcode-stdio-1.0
194200
main-is: Examples.hs
195201
hs-source-dirs: tests
196202
ghc-options: -Wall
197-
build-depends: cabal-helper
198203

199204
executable cabal-helper-main
200205
default-language: Haskell2010

0 commit comments

Comments
 (0)