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

remove library section becuase it breaks haddock with cabal 1.14 & 1.16 #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

dysinger
Copy link

No description provided.

@anttisalonen
Copy link
Owner

Hi Tim,

thanks for looking into this, however the reason the library section is there is because without it cabal will refuse to register cgen, making it impossible to list it as a dependency for other packages. You can test it:

$ vi cgen.cabal # remove library section
$ ghc-pkg unregister cgen # you probably have cgen registered if you've built it before
$ cabal install
$ cabal register
=> Package contains no library to register: cgen-0.0.5...

This makes e.g. hogre impossible to install as it depends on cgen. Removing the dependency would result in an ugly error when trying to configure packages that use cgen.

If you find a workaround for this I'll be happy to accept your patch - would be good to have working haddock docs.

Thanks,
Antti

@dysinger
Copy link
Author

What am I doing wrong here? All I'm trying to do is get this thing installed so I can try it.

[tim@ghost:~]$ rm -rf ~/.ghc ~/.cabal

[tim@ghost:~]$ cabal update
Config file path source is default config file.
Config file /home/tim/.cabal/config not found.
Writing default configuration to /home/tim/.cabal/config
Downloading the latest package list from hackage.haskell.org

[tim@ghost:~]$ cabal install --disable-documentation cgen
Resolving dependencies...
Downloading cgen-0.0.5...
Configuring cgen-0.0.5...
Building cgen-0.0.5...
Preprocessing library cgen-0.0.5...
In-place registering cgen-0.0.5...
Preprocessing executable 'grgen' for cgen-0.0.5...
[1 of 5] Compiling Options ( src/Options.hs, dist/build/grgen/grgen-tmp/Options.o )
[2 of 5] Compiling DeriveMod ( src/DeriveMod.hs, dist/build/grgen/grgen-tmp/DeriveMod.o )
[3 of 5] Compiling HeaderData ( src/HeaderData.hs, dist/build/grgen/grgen-tmp/HeaderData.o )
[4 of 5] Compiling HeaderParser ( src/HeaderParser.hs, dist/build/grgen/grgen-tmp/HeaderParser.o )
[5 of 5] Compiling Main ( src/GrGen.hs, dist/build/grgen/grgen-tmp/Main.o )
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Loading package array-0.4.0.1 ... linking ... done.
Loading package deepseq-1.3.0.1 ... linking ... done.
Loading package containers-0.5.0.0 ... linking ... done.
Loading package pretty-1.1.1.0 ... linking ... done.
Loading package template-haskell ... linking ... done.
Loading package safe-0.3.3 ... linking ... done.
Loading package bytestring-0.10.0.2 ... linking ... done.
Loading package transformers-0.3.0.0 ... linking ... done.
Loading package mtl-2.1.2 ... linking ... done.
Loading package regex-base-0.93.2 ... linking ... done.
Loading package regex-posix-0.95.2 ... linking ... done.
Loading package text-0.11.2.3 ... linking ... done.
Loading package parsec-3.1.3 ... linking ... done.
Loading package filepath-1.3.0.1 ... linking ... done.
Loading package old-locale-1.0.0.5 ... linking ... done.
Loading package time-1.4.0.1 ... linking ... done.
Loading package unix-2.6.0.1 ... linking ... done.
Loading package directory-1.2.0.1 ... linking ... done.
Linking dist/build/grgen/grgen ...
Preprocessing executable 'cgen-hs' for cgen-0.0.5...
[1 of 8] Compiling DeriveMod ( src/DeriveMod.hs, dist/build/cgen-hs/cgen-hs-tmp/DeriveMod.o )
[2 of 8] Compiling Utils ( src/Utils.hs, dist/build/cgen-hs/cgen-hs-tmp/Utils.o )
[3 of 8] Compiling HeaderData ( src/HeaderData.hs, dist/build/cgen-hs/cgen-hs-tmp/HeaderData.o )
[4 of 8] Compiling CppUtils ( src/CppUtils.hs, dist/build/cgen-hs/cgen-hs-tmp/CppUtils.o )
[5 of 8] Compiling Options ( src/Options.hs, dist/build/cgen-hs/cgen-hs-tmp/Options.o )
[6 of 8] Compiling HaskellGen ( src/HaskellGen.hs, dist/build/cgen-hs/cgen-hs-tmp/HaskellGen.o )
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Loading package array-0.4.0.1 ... linking ... done.
Loading package deepseq-1.3.0.1 ... linking ... done.
Loading package containers-0.5.0.0 ... linking ... done.
Loading package pretty-1.1.1.0 ... linking ... done.
Loading package template-haskell ... linking ... done.
Loading package safe-0.3.3 ... linking ... done.
Loading package bytestring-0.10.0.2 ... linking ... done.
Loading package transformers-0.3.0.0 ... linking ... done.
Loading package mtl-2.1.2 ... linking ... done.
Loading package regex-base-0.93.2 ... linking ... done.
Loading package regex-posix-0.95.2 ... linking ... done.
Loading package text-0.11.2.3 ... linking ... done.
Loading package parsec-3.1.3 ... linking ... done.
Loading package filepath-1.3.0.1 ... linking ... done.
Loading package old-locale-1.0.0.5 ... linking ... done.
Loading package time-1.4.0.1 ... linking ... done.
Loading package unix-2.6.0.1 ... linking ... done.
Loading package directory-1.2.0.1 ... linking ... done.
[7 of 8] Compiling HeaderParser ( src/HeaderParser.hs, dist/build/cgen-hs/cgen-hs-tmp/HeaderParser.o )
[8 of 8] Compiling Main ( src/CgenHs.hs, dist/build/cgen-hs/cgen-hs-tmp/Main.o )
Linking dist/build/cgen-hs/cgen-hs ...
Preprocessing executable 'cgen' for cgen-0.0.5...
[1 of 8] Compiling DeriveMod ( src/DeriveMod.hs, dist/build/cgen/cgen-tmp/DeriveMod.o )
[2 of 8] Compiling Options ( src/Options.hs, dist/build/cgen/cgen-tmp/Options.o )
[3 of 8] Compiling Utils ( src/Utils.hs, dist/build/cgen/cgen-tmp/Utils.o )
[4 of 8] Compiling HeaderData ( src/HeaderData.hs, dist/build/cgen/cgen-tmp/HeaderData.o )
[5 of 8] Compiling CppUtils ( src/CppUtils.hs, dist/build/cgen/cgen-tmp/CppUtils.o )
[6 of 8] Compiling CppGen ( src/CppGen.hs, dist/build/cgen/cgen-tmp/CppGen.o )
[7 of 8] Compiling HeaderParser ( src/HeaderParser.hs, dist/build/cgen/cgen-tmp/HeaderParser.o )
[8 of 8] Compiling Main ( src/Main.hs, dist/build/cgen/cgen-tmp/Main.o )
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Loading package array-0.4.0.1 ... linking ... done.
Loading package deepseq-1.3.0.1 ... linking ... done.
Loading package containers-0.5.0.0 ... linking ... done.
Loading package pretty-1.1.1.0 ... linking ... done.
Loading package template-haskell ... linking ... done.
Loading package safe-0.3.3 ... linking ... done.
Loading package bytestring-0.10.0.2 ... linking ... done.
Loading package transformers-0.3.0.0 ... linking ... done.
Loading package mtl-2.1.2 ... linking ... done.
Loading package regex-base-0.93.2 ... linking ... done.
Loading package regex-posix-0.95.2 ... linking ... done.
Loading package text-0.11.2.3 ... linking ... done.
Loading package parsec-3.1.3 ... linking ... done.
Loading package filepath-1.3.0.1 ... linking ... done.
Loading package old-locale-1.0.0.5 ... linking ... done.
Loading package time-1.4.0.1 ... linking ... done.
Loading package unix-2.6.0.1 ... linking ... done.
Loading package directory-1.2.0.1 ... linking ... done.
Linking dist/build/cgen/cgen ...
Installing library in /home/tim/.cabal/lib/cgen-0.0.5/ghc-7.6.2
Installing executable(s) in /home/tim/.cabal/bin
Registering cgen-0.0.5...
cabal: cgen-0.0.5: Warning: haddock-interfaces:
/home/tim/.cabal/share/doc/cgen-0.0.5/html/cgen.haddock doesn't exist or isn't
a file
cgen-0.0.5: Warning: haddock-html: /home/tim/.cabal/share/doc/cgen-0.0.5/html
doesn't exist or isn't a directory
cgen-0.0.5: dependency "mtl-2.1.2-f91f065011b3599955e0e909c0e0bc57" doesn't
exist (use --force to override)
cgen-0.0.5: dependency "parsec-3.1.3-00cd508f1d44e400957aefe2ddefc876" doesn't
exist (use --force to override)
cgen-0.0.5: dependency "regex-posix-0.95.2-456d7329d527a6f7f51c7a37d7cf6981"
doesn't exist (use --force to override)
cgen-0.0.5: dependency "safe-0.3.3-1f7018d16eca302e49ce3016d5f3560b" doesn't
exist (use --force to override)
Failed to install cgen-0.0.5
cabal: Error: some packages failed to install:
cgen-0.0.5 failed during the final install step. The exception was:
ExitFailure 1

@dysinger
Copy link
Author

If I remove the Library line, then it installs fine but then I can't use it (the problem you noted).

@dysinger
Copy link
Author

Maybe if we have at least one dummy module as the 'library' it will work?

@anttisalonen
Copy link
Owner

That's odd, I haven't seen that problem before. It works on my setup (Linux, Cabal 1.16.0.2, GHC 7.6.1). But I interpret your output so that it's not haddock causing problems but instead the cabal dependency handling. I needed to "cabal install mtl parsec regex-posix safe" before cabal would even start building cgen. Not sure what the root problem is though.

@dysinger
Copy link
Author

I have those libraries installed (you can see from the 'linking'). Yet you are right. This works on my Mac without a problem.

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

Successfully merging this pull request may close these issues.

2 participants