cabal-extras icon indicating copy to clipboard operation
cabal-extras copied to clipboard

[cabal-docspec] blank lines in multiline input cause timeouts

Open amesgen opened this issue 4 years ago • 3 comments

Blank lines in multiline input are causing timeout errors right now, see https://github.com/amesgen/stuff/tree/cabal-docspec-blank-lines. To reproduce:

 $ git clone --single-branch --branch cabal-docspec-blank-lines https://github.com/amesgen/stuff && cd stuff
 $ cabal build
 $ cabal-docspec
[   0.00001] ghc.info: ghc
[   0.00090] process.0.start: cwd=/tmp ghc --info
[   0.07071] docspec.component: stuff-0.1.0.0 lib
[   0.07152] docspec.phase1: MyLib: /tmp/tmp.oArjM5FxQC/stuff/./src/MyLib.hs
[   0.41623] docspec.phase2: MyLib
[   3.43236] warning[-Wtimeout]: timeout...
[  13.44039] peu.die: Timeout while recovering from timeout
proci: canceling
proci: terminating
proci: pid Just 143783
proci: waiting for termination

If I change

-- >>> :{
-- data A = A
--
-- data B = B
-- :}

to

-- >>> :{
-- data A = A
-- --
-- data B = B
-- :}

then everything works as expected.


EDIT: My use case are multi-line string literals with QuasiQuotes which contain blank lines.

amesgen avatar Jan 12 '21 05:01 amesgen

What is -v output?

phadej avatar Jan 12 '21 07:01 phadej

FWIW, empty line doesn't work in doctest either, so it won't work:

% doctest Foo.hs
Foo.hs:6: error in expression `:{'           
unterminated multiline command

timeout is bad though.

phadej avatar Jan 12 '21 07:01 phadej

With -v I get:

[   0.00001] ghc.info: ghc
[   0.00078] process.0.start: cwd=/tmp ghc --info
[   0.06964] docspec.component: stuff-0.1.0.0 lib
[   0.07038] docspec.phase1: MyLib: /tmp/tmp.oArjM5FxQC/stuff/./src/MyLib.hs
[   0.07117] ghci: ghc --interactive -ignore-dot-ghci -v0 -i -hide-all-packages -no-user-package-db -package-db=/home/alexander/.cabal/store/ghc-8.10.3/package.db -package-db=/tmp/tmp.oArjM5FxQC/stuff/dist-newstyle/packagedb/ghc-8.10.3 -package-id=stuff-0.1.0.0-inplace -package-id=base-4.14.1.0
[   0.40433] docspec.phase2: MyLib
[   0.40458] ghci.input: :m MyLib
[   0.40805] ghci.input: :r
[   0.41118] ghci.input: :m MyLib
[   0.41438] ghci.input: :r
[   0.41728] ghci.input: :{
[   3.41816] warning[-Wtimeout]: timeout...
[  13.41993] peu.die: Timeout while recovering from timeout
proci: canceling
proci: terminating
proci: pid Just 161244
proci: waiting for termination

But I found an okayish workaround:

-- >>> :{
-- >>> data A = A
-- >>>
-- >>> data B = B
-- >>> :}

EDIT: Hmm, this removes indentation in the haddock output...


I can close this if you want, as this issue should be easy to discover.

amesgen avatar Jan 12 '21 17:01 amesgen