Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
amesgen opened this issue Jan 12, 2021 · 3 comments
Open

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

amesgen opened this issue Jan 12, 2021 · 3 comments

Comments

@amesgen
Copy link

amesgen commented Jan 12, 2021

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.

@phadej
Copy link
Owner

phadej commented Jan 12, 2021

What is -v output?

@phadej
Copy link
Owner

phadej commented Jan 12, 2021

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.

@amesgen
Copy link
Author

amesgen commented Jan 12, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants