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

text-show-3.9.4 fails to compile with GHC-8.0.2 #50

Closed
phadej opened this issue Jan 1, 2022 · 4 comments · Fixed by #52
Closed

text-show-3.9.4 fails to compile with GHC-8.0.2 #50

phadej opened this issue Jan 1, 2022 · 4 comments · Fixed by #52
Labels

Comments

@phadej
Copy link

phadej commented Jan 1, 2022

EDIT: I don't know if it's something text-show does, or text-2.0 (the install plan has text-2.0).

Resolving dependencies...
Build profile: -w ghc-8.0.2 -O1
In order, the following will be built (use -v for more details):
 - text-show-3.9.4 (lib) (first run)
Configuring library for text-show-3.9.4..
Preprocessing library for text-show-3.9.4..
Building library for text-show-3.9.4..
[ 1 of 66] Compiling TextShow.Utils   ( src/TextShow/Utils.hs, /codetmp/text-show-3.9.4/dist-newstyle/build/x86_64-linux/ghc-8.0.2/text-show-3.9.4/build/TextShow/Utils.o )
...
[33 of 66] Compiling TextShow.Data.Complex ( src/TextShow/Data/Complex.hs, /codetmp/text-show-3.9.4/dist-newstyle/build/x86_64-linux/ghc-8.0.2/text-show-3.9.4/build/TextShow/Data/Complex.o )
ghc: panic! (the 'impossible' happened)
  (GHC version 8.0.2 for x86_64-unknown-linux):
	Simplifier ticks exhausted
  When trying UnfoldingDone $
  To increase the limit, use -fsimpl-tick-factor=N (default 100)
  If you need to do this, let GHC HQ know, and what factor you needed
  To see detailed counts use -ddump-simpl-stats
  Total ticks: 26920

Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug
@phadej
Copy link
Author

phadej commented Jan 1, 2022

With {-# OPTIONS_GHC -fsimpl-tick-factor=200 #-} text-show seems to compile fine with GHC-8.0.2

@RyanGlScott
Copy link
Owner

Good catch. I didn't notice this at the time of releasing text-show-3.9.4, since the CI job's build plan picked text-1.2.5.0. Building text-show-3.9.4 with text-1.2.5.0 succeeds, but fails with text-2.0. Bummer.

I wonder what the most robust way to fix this issue is. It's very likely that text-show uses too many INLINE pragmas currently, which would exacerbate the issue. But without careful profiling, it's not obvious to me which INLINE pragmas to remove. I've previously worked around this issue by disabling optimizations in certain modules (see 0cba202, for instance), but your -fsimpl-tick-factor=200 suggestion is probably the better one. I should use that consistently.

RyanGlScott added a commit that referenced this issue Jan 2, 2022
This is a crude but effective workaround for #50. I have opened #51 as a
reminder to investigate this more carefully and come up with a more robust fix.

Resolves #50.
@RyanGlScott RyanGlScott added the bug label Jan 2, 2022
@RyanGlScott
Copy link
Owner

I've opened #52 with a short-term fix, and I've opened #51 as a reminder to investigate the underlying issue more carefully.

RyanGlScott added a commit that referenced this issue Jan 2, 2022
This is a crude but effective workaround for #50. I have opened #51 as a
reminder to investigate this more carefully and come up with a more robust fix.

Resolves #50.
@RyanGlScott
Copy link
Owner

I've uploaded text-show-3.9.5 to Hackage with the aforementioned short-term fix.

RyanGlScott added a commit to RyanGlScott/text-show-instances that referenced this issue Mar 26, 2022
Alas, the same problems that plagued `text-show` in RyanGlScott/text-show#50
are now showing up in `text-show-instances` as well. For now, I'll apply the
same short-term fix as in RyanGlScott/text-show#50. See
RyanGlScott/text-show#51 for an issue tracking a longer-term solution.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants