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 build very simple package with latest cabal-install #1241

Closed
dmwit opened this issue Mar 15, 2013 · 5 comments · Fixed by #1249
Closed

can't build very simple package with latest cabal-install #1241

dmwit opened this issue Mar 15, 2013 · 5 comments · Fixed by #1249
Assignees

Comments

@dmwit
Copy link
Collaborator

dmwit commented Mar 15, 2013

See also #1236. For a quick review, I have the following problem:

crabgrass:~% wget http://dmwit.com/tmp.tar.gz && tar xf tmp.tar.gz && cd tmp/foo && cabal install
--2013-03-15 13:49:51--  http://dmwit.com/tmp.tar.gz
Resolving dmwit.com (dmwit.com)... 69.90.123.70
Connecting to dmwit.com (dmwit.com)|69.90.123.70|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 584 [application/x-gzip]
Saving to: ‘tmp.tar.gz’

100%[=====================================================================================>] 584         --.-K/s   in 0s      

2013-03-15 13:49:51 (50.8 MB/s) - ‘tmp.tar.gz’ saved [584/584]

Warning: The package list for 'hackage.haskell.org' is 17 days old.
Run 'cabal update' to get the latest list of available packages.
Resolving dependencies...
In order, the following will be installed:
foo-0.0 (latest: 1.0) (reinstall)
Warning: Note that reinstalls are always dangerous. Continuing anyway...
[1 of 1] Compiling Main             ( Setup.hs, dist/setup/Main.o )
Linking ./dist/setup/setup ...
Configuring foo-0.0...
Building foo-0.0...
Preprocessing library foo-0.0...
In-place registering foo-0.0...
setup: foo-0.0: Warning: haddock-interfaces:
/home/dmwit/tmp/foo/dist/doc/html/foo/foo.haddock doesn't exist or isn't a
file
foo-0.0: Warning: haddock-html: /home/dmwit/tmp/foo/dist/doc/html/foo doesn't
exist or isn't a directory
foo-0.0: cannot find libHSfoo-0.0.a on library path (use --force to override)
Failed to install foo-0.0
cabal: Error: some packages failed to install:
foo-0.0 failed during the building phase. The exception was:
ExitFailure 1
zsh: exit 1     cabal install

With the following additional details:

crabgrass:~% cabal --version
cabal-install version 1.17.0
using version 1.17.0 of the Cabal library 
crabgrass:~% uname -a
Linux crabgrass 3.2.0-4-amd64 #1 SMP Debian 3.2.35-2 x86_64 GNU/Linux
crabgrass:~% grep -v 'password\|--\|^$' ~/.cabal/config
remote-repo: hackage.haskell.org:http://hackage.haskell.org/packages/archive
remote-repo-cache: /home/dmwit/.cabal/packages
library-profiling: True
documentation: False
doc-index-file: $datadir/doc/index.html
build-summary: /home/dmwit/.cabal/$arch/logs/build.log
remote-build-reporting: anonymous
username: DanielWagner
install-dirs user
  prefix: /home/dmwit/.cabal/$arch
install-dirs global
@23Skidoo
Copy link
Member

Still can't reproduce:

$ wget http://dmwit.com/tmp.tar.gz && tar xf tmp.tar.gz && cd tmp/foo && cabal install
[...]
Resolving dependencies...
In order, the following will be installed:
foo-0.0 (latest: 1.0) (reinstall)
Warning: Note that reinstalls are always dangerous. Continuing anyway...
Configuring foo-0.0...
Building foo-0.0...
Installed foo-0.0

System config:

$ uname -a
Linux blackbox 3.2.0-38-generic #61-Ubuntu SMP Tue Feb 19 12:20:02 UTC 2013 i686 athlon i386 GNU/Linux

$ cabal --version
cabal-install version 1.17.0
using version 1.17.0 of the Cabal library 

$ grep -v 'password\|--\|^$' ~/.cabal/config
remote-repo: hackage.haskell.org:http://hackage.haskell.org/packages/archive
remote-repo-cache: /home/cabal-test/.cabal/packages
world-file: /home/cabal-test/.cabal/world
library-profiling: True
documentation: False
doc-index-file: $datadir/doc/index.html
build-summary: /home/cabal-test/.cabal/$arch/logs/build.log
remote-build-reporting: anonymous
jobs: 2 -- Changing to 1 doesn't make any difference
install-dirs user
  prefix: /home/cabal-test/.cabal/$arch
install-dirs global

This is using a freshly built cabal-install from current TOT.

@23Skidoo
Copy link
Member

Managed to reproduce this using the following .cabal file:

name: issue1244
Cabal-version: >= 1.2
version: 1.0
build-type: Simple

Library

Then I get:

$ cabal configure && cabal build
Resolving dependencies...
Configuring issue1244-1.0...
Building issue1244-1.0...
Preprocessing library issue1244-1.0...
In-place registering issue1244-1.0...
cabal: issue1244-1.0: Warning: haddock-interfaces:
/home/cabal-test/issue1244/dist/doc/html/issue1244/issue1244.haddock doesn't
exist or isn't a file
issue1244-1.0: Warning: haddock-html:
/home/cabal-test/issue1244/dist/doc/html/issue1244 doesn't exist or isn't a
directory
issue1244-1.0: cannot find libHSissue1244-1.0.a on library path (use --force
to override)

$ ls
dist  issue1244.cabal

$ head -1 dist/setup-config
Saved package config for issue1244-1.0 written by Cabal-1.17.0 using ghc-7.4

System configuration:

$ ghc-pkg list Cabal --simple-output
Cabal-1.14.0

$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.4.2

$ cabal --version
cabal-install version 1.17.0
using version 1.17.0 of the Cabal library 

@23Skidoo
Copy link
Member

Some things I've discovered:

a) The error is encountered when we invoke ghc-pkg like that:

("/home/gman/bin/ghc-7.4.2/bin/ghc-pkg",["update","-","--global","--user",
"--package-conf=dist/package.conf.inplace","-v2"])

b) In 1.16, cat dist/package.conf.inplace produces

[InstalledPackageInfo {installedPackageId = InstalledPackageId
"issue1244-1.0-inplace", sourcePackageId = PackageIdentifier {pkgName =
PackageName "issue1244", pkgVersion = Version {versionBranch = [1,0],
versionTags = []}}, license = AllRightsReserved, copyright = "", maintainer =
"", author = "", stability = "", homepage = "", pkgUrl = "", synopsis = "",
description = "", category = "", exposed = True, exposedModules = [],
hiddenModules = [], trusted = False, importDirs = [], libraryDirs = [],
hsLibraries = [], extraLibraries = [], extraGHCiLibraries = [], includeDirs =
[], includes = [], depends = [], hugsOptions = [], ccOptions = [], ldOptions =
[], frameworkDirs = [], frameworks = [], haddockInterfaces =
["/home/cabal-test/issue1244/dist/doc/html/issue1244/issue1244.haddock"],
haddockHTMLs = ["/home/cabal-test/issue1244/dist/doc/html/issue1244"]} ]

However, in the TOT version the contents of that file are just [].

@23Skidoo
Copy link
Member

Input given to ghc-pkg via stdin is also different.

TOT:

name: issue1244
version: 1.0
id: issue1244-1.0-inplace
license: AllRightsReserved
copyright:
maintainer:
stability:
homepage:
package-url:
synopsis:
description:
category:
author:
exposed: True
exposed-modules:
hidden-modules:
trusted: False
import-dirs:
library-dirs:
hs-libraries: HSissue1244-1.0
extra-libraries:
extra-ghci-libraries:
include-dirs:
includes:
depends:
hugs-options:
cc-options:
ld-options:
framework-dirs:
frameworks:
haddock-interfaces: /home/cabal-test/issue1244/dist/doc/html/issue1244/issue1244.haddock
haddock-html: /home/cabal-test/issue1244/dist/doc/html/issue1244

1.16:

name: issue1244
version: 1.0
id: issue1244-1.0-inplace
license: AllRightsReserved
copyright:
maintainer:
stability:
homepage:
package-url:
synopsis:
description:
category:
author:
exposed: True
exposed-modules:
hidden-modules:
trusted: False
import-dirs:
library-dirs:
hs-libraries:
extra-libraries:
extra-ghci-libraries:
include-dirs:
includes:
depends:
hugs-options:
cc-options:
ld-options:
framework-dirs:
frameworks:
haddock-interfaces: /home/cabal-test/issue1244/dist/doc/html/issue1244/issue1244.haddock
haddock-html: /home/cabal-test/issue1244/dist/doc/html/issue1244

@23Skidoo
Copy link
Member

hs-libraries: HSissue1244-1.0

Looks like this is what was causing the problem. Bug introduced by @igfoo in 8395c5d. package-conf.inplace is updated by ghc-pkg itself, which is why it was empty when I tested with 1.17.

23Skidoo added a commit to 23Skidoo/cabal that referenced this issue Mar 20, 2013
23Skidoo added a commit to 23Skidoo/cabal that referenced this issue Mar 21, 2013
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 a pull request may close this issue.

2 participants