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

Cryptic error messages when using the diagrams-builder-cairo #23

Open
david-hoze opened this issue Nov 8, 2015 · 3 comments
Open

Cryptic error messages when using the diagrams-builder-cairo #23

david-hoze opened this issue Nov 8, 2015 · 3 comments

Comments

@david-hoze
Copy link

Hi, when I compile my latex file using the cairo backend I get

Opening diagrams-latex stream diagrams/pretty-print-problem-diagrams-latex-fig1
.hs Error while compiling diagrams/pretty-print-problem-diagrams-latex-fig1.hs
/tmp/Diagram1804289383846930886.hs:4:8:
    Could not find module ‘Diagrams.Prelude’
    Use -v to see a list of the files searched for.
/tmp/Diagram1804289383846930886.hs:5:8:
    Could not find module ‘Diagrams.Backend.Cairo’
    Use -v to see a list of the files searched for.
/tmp/Diagram1804289383846930886.hs:6:8:
    Could not find module ‘Diagrams.TwoD.Text’
    Use -v to see a list of the files searched for.

Which was not the real bug. I had to catch the temporary file using a hacky loop in /tmp:

cd /tmp
while 1; do cat Diagram* >> bug.hs; done

remove the duplicates (the time it takes to remove the temporary file), and then compile it using:

ghc --make bug.hs

to get the real error message.
Happened also to this guy: https://groups.google.com/forum/#!topic/diagrams-discuss/DY3M38X0dbA.

Thanks.

versions used
diagrams-builder: 0.7.2.0
ghc: 7.10.2
diagrams-core: 1.3.0.3
diagrams-cairo: 1.3.0.5
NixOS: NixOS/nixpkgs@819a375

@byorgey
Copy link
Member

byorgey commented Nov 9, 2015

Hi there,

How did you build and install diagrams?

If you fix the "real bug" and then compile using the cairo backend does it work, or does it still give the same errors about not being able to find certain modules?

I don't know whether https://groups.google.com/forum/#!topic/diagrams-discuss/DY3M38X0dbA is the same problem. The difference there was the version of GHC used, and the error message received from GHC 7.10 would not have been an error with GHC 7.8, it is due to some changes in the way inferred types are handled.

@jwiegley
Copy link

I'm running into this sample problem while trying to use org-babel-diagrams. When I hit C-c C-c to evaluate the code block, I get the same error as above. When I use "trick" to capture the bug.hs file and then run ghc --make bug.hs from within Emacs, it seems to compile just fine. I'm not quite sure, therefore, what the disconnect is that's triggering the failed build.

@jwiegley
Copy link

That is:

~ $ diagrams-builder-cairo /var/folders/ds/nt2q1_s57cqgt9g94_vmkjcw0000gn/T/babel-nYlDkB/diagrams-inputPBWNyb
Error while compiling /var/folders/ds/nt2q1_s57cqgt9g94_vmkjcw0000gn/T/babel-nYlDkB/diagrams-inputPBWNyb
/var/folders/ds/nt2q1_s57cqgt9g94_vmkjcw0000gn/T/Diagram70190-0.hs:4:1: error:
    Could not find module ‘Diagrams.Prelude’
    Use -v to see a list of the files searched for.
/var/folders/ds/nt2q1_s57cqgt9g94_vmkjcw0000gn/T/Diagram70190-0.hs:5:1: error:
    Could not find module ‘Diagrams.Backend.Cairo’
    Use -v to see a list of the files searched for.

~ $ ghc --make /var/folders/ds/nt2q1_s57cqgt9g94_vmkjcw0000gn/T/bug.hs
[1 of 1] Compiling Diagram67467     ( /var/folders/ds/nt2q1_s57cqgt9g94_vmkjcw0000gn/T/bug.hs, /var/folders/ds/nt2q1_s57cqgt9g94_vmkjcw0000gn/T/bug.o ) [flags changed]

Where bug.hs should be a capture of what diagrams-builder-cairo is trying to compile.

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

3 participants