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

Can't install: lhs2TeX: fd:7: hGetLine: end of file #87

Open
tomjaguarpaw opened this issue May 21, 2021 · 7 comments
Open

Can't install: lhs2TeX: fd:7: hGetLine: end of file #87

tomjaguarpaw opened this issue May 21, 2021 · 7 comments

Comments

@tomjaguarpaw
Copy link

tomjaguarpaw commented May 21, 2021

Seems to be related to #84 but I'm not seeing any particularly clear resolution to that issue.

EDIT: This is on WSL2, which I expect not to be relevant, but there's a small chance it is.

~/.ghcup/bin/cabal --version && \
~/.ghcup/bin/cabal v2-install \
    --with-ghc=/opt/ghc/8.8.4/bin/ghc \
    --installdir=$HOME/.cabal/bin \
    --overwrite-policy=always \
    lhs2tex-1.24
_________________________________________________________________________________________Fri May 21 17:46:44 BST 2021
cabal-install version 3.4.0.0
compiled using version 3.4.0.0 of the Cabal library
Warning: The package list for 'hackage.haskell.org' is 84 days old.
Run 'cabal update' to get the latest list of available packages.
Warning: The package list for 'hackage.haskell.org' is 84 days old.
Run 'cabal update' to get the latest list of available packages.
Resolving dependencies...
Build profile: -w ghc-8.8.4 -O1
In order, the following will be built (use -v for more details):
 - lhs2tex-1.24 (exe:lhs2TeX) (requires build)
Starting     lhs2tex-1.24 (all, legacy fallback)
Building     lhs2tex-1.24 (all, legacy fallback)

Failed to build lhs2tex-1.24.
Build log (
/home/toelli/.cabal/logs/ghc-8.8.4/lhs2tex-1.24-60dc6bf83841046178b347c20c2d9db4a62f4cdf26a64d2dc8e965e73fe8b7f6.log
):
[1 of 1] Compiling Main             ( /tmp/cabal-install.-27408/dist-newstyle/tmp/src-27408/lhs2tex-1.24/dist/setup/setup.hs, /tmp/cabal-install.-27408/dist-newstyle/tmp/src-27408/lhs2tex-1.24/dist/setup/Main.o )
Linking /tmp/cabal-install.-27408/dist-newstyle/tmp/src-27408/lhs2tex-1.24/dist/setup/setup ...
Configuring lhs2tex-1.24...
Preprocessing executable 'lhs2TeX' for lhs2tex-1.24..
Building executable 'lhs2TeX' for lhs2tex-1.24..
[ 1 of 21] Compiling Auxiliaries      ( src/Auxiliaries.lhs, dist/build/lhs2TeX/lhs2TeX-tmp/Auxiliaries.o )
[ 2 of 21] Compiling Document         ( src/Document.lhs, dist/build/lhs2TeX/lhs2TeX-tmp/Document.o )
[ 3 of 21] Compiling FileNameUtils    ( src/FileNameUtils.lhs, dist/build/lhs2TeX/lhs2TeX-tmp/FileNameUtils.o )
[ 4 of 21] Compiling FiniteMap        ( src/FiniteMap.lhs, dist/build/lhs2TeX/lhs2TeX-tmp/FiniteMap.o )
[ 5 of 21] Compiling Parser           ( src/Parser.lhs, dist/build/lhs2TeX/lhs2TeX-tmp/Parser.o )
[ 6 of 21] Compiling StateT           ( src/StateT.lhs, dist/build/lhs2TeX/lhs2TeX-tmp/StateT.o )
[ 7 of 21] Compiling TeXCommands      ( src/TeXCommands.lhs, dist/build/lhs2TeX/lhs2TeX-tmp/TeXCommands.o )
[ 8 of 21] Compiling HsLexer          ( src/HsLexer.lhs, dist/build/lhs2TeX/lhs2TeX-tmp/HsLexer.o )
[ 9 of 21] Compiling TeXParser        ( src/TeXParser.lhs, dist/build/lhs2TeX/lhs2TeX-tmp/TeXParser.o )
[10 of 21] Compiling Value            ( src/Value.lhs, dist/build/lhs2TeX/lhs2TeX-tmp/Value.o )
[11 of 21] Compiling Directives       ( src/Directives.lhs, dist/build/lhs2TeX/lhs2TeX-tmp/Directives.o )
[12 of 21] Compiling Verbatim         ( src/Verbatim.lhs, dist/build/lhs2TeX/lhs2TeX-tmp/Verbatim.o )
[13 of 21] Compiling Typewriter       ( src/Typewriter.lhs, dist/build/lhs2TeX/lhs2TeX-tmp/Typewriter.o )
[14 of 21] Compiling MathCommon       ( src/MathCommon.lhs, dist/build/lhs2TeX/lhs2TeX-tmp/MathCommon.o )
[15 of 21] Compiling MathPoly         ( src/MathPoly.lhs, dist/build/lhs2TeX/lhs2TeX-tmp/MathPoly.o )
[16 of 21] Compiling NewCode          ( src/NewCode.lhs, dist/build/lhs2TeX/lhs2TeX-tmp/NewCode.o )
[17 of 21] Compiling Math             ( src/Math.lhs, dist/build/lhs2TeX/lhs2TeX-tmp/Math.o )
[18 of 21] Compiling Version          ( src/Version.lhs, dist/build/lhs2TeX/lhs2TeX-tmp/Version.o )
[19 of 21] Compiling State            ( src/State.lhs, dist/build/lhs2TeX/lhs2TeX-tmp/State.o )
[20 of 21] Compiling License          ( src/License.lhs, dist/build/lhs2TeX/lhs2TeX-tmp/License.o )
[21 of 21] Compiling Main             ( src/Main.lhs, dist/build/lhs2TeX/lhs2TeX-tmp/Main.o )
Linking dist/build/lhs2TeX/lhs2TeX ...
lhs2TeX: fd:7: hGetLine: end of file
cabal: Failed to build lhs2tex-1.24. See the build log above for details.
@kosmikus
Copy link
Owner

I cannot immediately reproduce. Does LC_ALL=C cabal install lhs2tex make a difference?

@tomjaguarpaw
Copy link
Author

It does not (nor do I have any LC_ or LOCALE variables set normally).

(I should also point out that this is on WSL2, which may make a difference. On the other hand I would expect WSL2 to be identical to any other Linux with the exception of very low level OS functionality, such as networking.)

@kosmikus
Copy link
Owner

Could you then rerun with cabal -v3? The output should then contain a line such as

Redirecting build log to {handle:
/root/.cabal/logs/ghc-8.8.4/lhs2tex-1.24-60dc6bf83841046178b347c20c2d9db4a62f4cdf26a64d2dc8e965e73fe8b7f6.log}

for the build of lhs2tex. Could you paste that redirected build log file?

@tomjaguarpaw
Copy link
Author

@kosmikus
Copy link
Owner

Oh, I think I understand now. Can you try putting the GHC you want to build with into your PATH, so that ghci starts the correct version, rather than just specifying via --with-ghc?

When building the documentation, that setting is currently not respected, it seems. I'm also not sure how easy it is to fix, unfortunately.

@tomjaguarpaw
Copy link
Author

Ah, that works. Thanks!

If it's not easy to fix the issue then a diagnostic message could be helpful, and in any case at least this issue will now appear on search engines and hopefully help anyone else who comes across the problem.

The problem is solved for me. Shall I close the issue?

@kosmikus
Copy link
Owner

Let's leave it open, as it's not really fixed.

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

No branches or pull requests

2 participants