Closed mouse07410 closed 4 years ago
Hmm, this looks like a cabal-install bug. What version of cabal-install is this?
One point worth noting is that at this point in the build process lhs2TeX
is already successfully built. So you might just be able to manually copy dist/build/lhs2TeX/lhs2TeX
to a bin
directory. But then you probably need some other files (that lhs2TeX will be looking for) copied to the right directories as well ...
What version of cabal-install is this?
$ cabal --version
cabal-install version 3.2.0.0
compiled using version 3.2.0.0 of the Cabal library
at this point in the build process
lhs2TeX
is already successfully built...
Alas, I don't think so (see below).
you might just be able to manually copy
dist/build/lhs2TeX/lhs2TeX
to abin
directory
Ah... You mean - clone this repo, build it from there (so dist-newstyle
subdir doesn't get destroyed when the build process finishes), and manually copy...?
Well, that did not go too well. Cloning the repo was fine, but there's nothing built, it appears - as there's no evidence in the log that the build actually completed:
$ cabal --config-file=/Users/ur20980/.cabal/static-config install -w ghc-8.10.1
Wrote tarball sdist to
/Users/ur20980/src/lhs2tex/dist-newstyle/sdist/lhs2tex-1.24.tar.gz
Resolving dependencies...
Build profile: -w ghc-8.10.1 -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 ( /Users/ur20980/.cabal/logs/ghc-8.10.1/lhs2tx-1.24-49799dd0.log ):
[1 of 1] Compiling Main ( /var/folders/c6/lnc_0m093ys8w16md_fm1mnxhtfnj8/T/cabal-install.-39171/dist-newstyle/tmp/src-39171/lhs2tex-1.24/dist/setup/setup.hs, /var/folders/c6/lnc_0m093ys8w16md_fm1mnxhtfnj8/T/cabal-install.-39171/dist-newstyle/tmp/src-39171/lhs2tex-1.24/dist/setup/Main.o )
Linking /var/folders/c6/lnc_0m093ys8w16md_fm1mnxhtfnj8/T/cabal-install.-39171/dist-newstyle/tmp/src-39171/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.
It tried to read some kind of file (neither the build process, not Cabal itself tell which one), some read fails before finding whatever it wanted from that file - and the build aborts without actually linking anything.
$ find dist-newstyle -name 'lhs2*' -print
dist-newstyle/sdist/lhs2tex-1.24.tar.gz
$
But then you probably need some other files (that
lhs2TeX
will be looking for) copied to the right directories as well
Yes, I'm sure that would be required. Any guidance wrt. what files I should copy, and where to (to use if/when the build succeeds)? Thanks!
You wouldn't believe what helped building and installing lhs2TeX
successfully! I had to set GHC_ENVIRONMENT=-
, after which install succeeded.
I don't understand why a cloned repo still pulls sdist lhs2tex-1.24.tar.gz
instead of using the current sources, but I don't really need to know, and I'm probably not at the level to be on the bleeding edge playing with the unreleased packages.
I'm glad you solved it. I must admit that there are many things about your setup I don't understand right now. Anyway, it currently seems to me that none of your problems are actually lhs2TeX-specific, so I'm going to close this. Feel free to reopen if you experience more problems.
I must admit that there are many things about your setup I don't understand right now
Such as...? Please feel free to ask, e.g., here.
The main difference between my setup and what the majority is doing is that all of my builds are configured to be dynamic (several reasons for that), by setting in ~/.cabal/config
:
shared: True
executable-dynamic: True
But when I suspect that something could be wrong with the build - I have a similar configuration that does not set shared
and executable-dynamic
, so I can have a "normal" ("traditional") build, similar to what most of the other people do. That's ~/.cabal/static-config
file, reference to which you see in the above logs. There's a couple of executable I built on my system using static-config
- but those are the exception, most of the stuff is dynamic.
And to address some incompatibilities between the installed libiconv
libraries, I define
extra-lib-dirs: /opt/local/lib/liconv,/opt/local/lib,/usr/local/lib
to ensure that Haskell executables/libraries built by Cabal/GHC would link against the same libiconv.dylib
that distributed binary libHSBase
was linked against. This is the issue with using Macports or Brew on Mac - I think some package managers on Linux also cause this problem and necessitate this solution.
Feel free to reopen if you experience more problems
Sure, thanks. I hope I won't need to. ;-)
MacOS 10.15.5, Xcode-11.5, GHC-8.8.3 and GHC-8.10.1, Cabal-3.2.0.0, lhs2tex-1.24.
I stumbled upon
lhs2tex
package in the process of installing Agda https://github.com/agda/Agda.git. It seemed to install fine - but during my fight with Agda (and some other packages) Cabal store apparently got damaged. After wiping it and re-installing whatever executables I needed, I'm trying to installlhs2tex
, but now it fails to link:Build log lhs2tx-1.24-e7db739f.log
This is with GHC-8.10.1, but I'm getting the same error with GHC-8.8.3.
Config file: static-config.txt Needless to say, attempt to build dynamic executable (as pretty much everything on my system is built) failed the same way.