Eelis / cxxdraft-htmlgen

Generates https://eel.is/c++draft
Other
168 stars 13 forks source link

Not in scope: type constructor or class ‘Semigroup’ #66

Closed thr131 closed 4 years ago

thr131 commented 4 years ago

I can't seem to get a successful build of the generator with cabal/stack.

With 'cabal build' I get the following error:

[ 4 of 12] Compiling LaTeXParser ( LaTeXParser.hs, dist/build/cxxdraft-htmlgen/cxxdraft-htmlgen-tmp/LaTeXParser.o )

LaTeXParser.hs:31:10: error: Not in scope: type constructor or class ‘Semigroup’

With 'stack build':

[ 4 of 12] Compiling LaTeXParser ( LaTeXParser.hs, .stack-work/dist/x86_64-linux/Cabal-1.24.2.0/build/cxxdraft-htmlgen/cxxdraft-htmlgen-tmp/LaTeXParser.o )

/home/thr1/Downloads/cxxdraft-htmlgen/LaTeXParser.hs:31:10: error: Not in scope: type constructor or class ‘Semigroup’

-- While building package cxxdraft-htmlgen-0 using: /home/thr1/.stack/setup-exe-cache/x86_64-linux/Cabal-simple_mPHDZzAJ_1.24.2.0_ghc-8.0.2 --builddir=.stack-work/dist/x86_64-linux/Cabal-1.24.2.0 build exe:cxxdraft-htmlgen --ghc-options " -ddump-hi -ddump-to-file" Process exited with code: ExitFailure 1

Eelis commented 4 years ago

GHC 8.0.2 is three years old. Can you try with GHC 8.4?

thr131 commented 4 years ago

Using GHC 8.4 with stack fixed the build process, however, I get the following error when I try to stack exec:

Writing to 14882/ cxxdraft-htmlgen: tex2html: readCreateProcess: runInteractiveProcess: exec: does not exist (No such file or directory)

Eelis commented 4 years ago

The tex2html program is part of the mathjax-node-cli package. If you install that package (and add its bin/ dir to your PATH environment variable if necessary), the error should go away.

thr131 commented 4 years ago

I already have the package. I added bin/ to PATH, but it just throws a different error:

... Writing to 14882/ module.js:549 throw err; ^

Error: Cannot find module 'mathjax-node-sre' at Function.Module._resolveFilename (module.js:547:15) at Function.Module._load (module.js:474:25) at Module.require (module.js:596:17) at require (internal/module.js:11:18) at Object. (/home/thr131/Downloads/mathjax-node-cli/bin/tex2html:26:13) at Module._compile (module.js:652:30) at Object.Module._extensions..js (module.js:663:10) at Module.load (module.js:565:32) at tryModuleLoad (module.js:505:12) at Function.Module._load (module.js:497:3) cxxdraft-htmlgen: readCreateProcess: tex2html "--css" "" (exit 1): failed

Eelis commented 4 years ago

I haven't seen that error before, but my guess is that you only downloaded the package, but didn't install it (with npm).

thr131 commented 4 years ago

Yes, you were right. I foolishly assumed it only had to be cloned. Thanks.