Skip to content

Regression: cannot install some packages with custom setup #1004

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

Closed
bos opened this issue Aug 14, 2012 · 17 comments
Closed

Regression: cannot install some packages with custom setup #1004

bos opened this issue Aug 14, 2012 · 17 comments
Assignees

Comments

@bos
Copy link
Contributor

bos commented Aug 14, 2012

I'm using recent builds of Cabal:

$ cabal --version
cabal-install version 0.14.0
using version 1.14.0 of the Cabal library 

If I try to install syb now, the installation bails:

$ PATH=/usr/local/ghc/7.2.1/bin:$PATH cabal install syb
Resolving dependencies...
[1 of 1] Compiling Main             ( /tmp/syb-0.3.7-12271/syb-0.3.7/Setup.hs, /tmp/syb-0.3.7-12271/syb-0.3.7/dist/setup/Main.o )

/tmp/syb-0.3.7-12271/syb-0.3.7/Setup.hs:4:30:
    Warning: In the use of `runTests'
             (imported from Distribution.Simple, but defined in Distribution.Simple.UserHooks):
             Deprecated: "Please use the new testing interface instead!"
Linking /tmp/syb-0.3.7-12271/syb-0.3.7/dist/setup/setup ...
unrecognized option `--disable-benchmarks'

The issue is that cabal is invoking syb's setup program with options it doesn't understand.

At the very least --disable-benchmarks isn't working. It's possible that syb would reject --disable-tests too, but that the first error is masking this.

@ghost ghost assigned ttuegel Aug 14, 2012
@tibbe
Copy link
Member

tibbe commented Aug 14, 2012

@ttuegel Would you mind taking a look?

@bos
Copy link
Contributor Author

bos commented Aug 14, 2012

I just checked by hand, and it's only --disable-benchmarks that's the problem.

@bos
Copy link
Contributor Author

bos commented Aug 14, 2012

I see that bits-atomic is affected by the same problem.

@tibbe
Copy link
Member

tibbe commented Aug 14, 2012

I'm having a hard time reproducing this:

Making sure I use the same Cabal/cabal-install as you:

$ git checkout -b debug cabal-install-0.14.0
$ cd Cabal
$ cabal clean
cleaning...
$ cabal configure && cabal build
...
$ cd ../cabal-install
$ cabal configure --package-db=../Cabal/dist/package.conf.inplace 
...
$ cabal build
...
$ ~/src/cabal/cabal-install/dist/build/cabal/cabal --version
cabal-install version 0.14.0
using version 1.14.0 of the Cabal library

Installing bits-atomic:

$ ~/src/cabal/cabal-install/dist/build/cabal/cabal --reinstall install bits-atomic
Warning: /Users/tibbe/.cabal/config: Unrecognized field jobs on line 57
Resolving dependencies...
In order, the following will be installed:
bits-atomic-0.1.3 (reinstall)
Warning: Note that reinstalls are always dangerous. Continuing anyway...
[1 of 1] Compiling Main             ( /var/folders/4z/7867658n33bckfymwsmh6z8w0000gp/T/bits-atomic-0.1.3-68239/bits-atomic-0.1.3/Setup.hs, /var/folders/4z/7867658n33bckfymwsmh6z8w0000gp/T/bits-atomic-0.1.3-68239/bits-atomic-0.1.3/dist/setup/Main.o )

/var/folders/4z/7867658n33bckfymwsmh6z8w0000gp/T/bits-atomic-0.1.3-68239/bits-atomic-0.1.3/Setup.hs:2:1:
    Warning: In the use of `runTests'
             (imported from Distribution.Simple, but defined in Distribution.Simple.UserHooks):
             Deprecated: "Please use the new testing interface instead!"
Linking /var/folders/4z/7867658n33bckfymwsmh6z8w0000gp/T/bits-atomic-0.1.3-68239/bits-atomic-0.1.3/dist/setup/setup ...
Configuring bits-atomic-0.1.3...
Building bits-atomic-0.1.3...
Preprocessing library bits-atomic-0.1.3...
[1 of 1] Compiling Data.Bits.Atomic ( Data/Bits/Atomic.hs, dist/build/Data/Bits/Atomic.o )
Registering bits-atomic-0.1.3...
Running Haddock for bits-atomic-0.1.3...
Warning: The documentation for the following packages are not installed. No
links will be generated to these packages: rts-1.0
Preprocessing library bits-atomic-0.1.3...
Haddock coverage:
 100% (  5 /  5) in 'Data.Bits.Atomic'
Documentation created: dist/doc/html/bits-atomic/index.html
Installing library in /Users/tibbe/.cabal/lib/bits-atomic-0.1.3/ghc-7.4.1
Registering bits-atomic-0.1.3...
Updating documentation index /Users/tibbe/.cabal/share/doc/index.html

@tibbe
Copy link
Member

tibbe commented Aug 14, 2012

Same thing happens if I install Cabal/cabal-install from Hackage:

$ cabal install cabal-install-0.14.0 Cabal-1.14.0
...
$ cabal --version
cabal-install version 0.14.0
using version 1.14.0 of the Cabal library
$ cabal --reinstall install bits-atomic
Resolving dependencies...
In order, the following will be installed:
bits-atomic-0.1.3 (reinstall)
Warning: Note that reinstalls are always dangerous. Continuing anyway...
[1 of 1] Compiling Main             ( /var/folders/4z/7867658n33bckfymwsmh6z8w0000gp/T/bits-atomic-0.1.3-70853/bits-atomic-0.1.3/Setup.hs, /var/folders/4z/7867658n33bckfymwsmh6z8w0000gp/T/bits-atomic-0.1.3-70853/bits-atomic-0.1.3/dist/setup/Main.o )

/var/folders/4z/7867658n33bckfymwsmh6z8w0000gp/T/bits-atomic-0.1.3-70853/bits-atomic-0.1.3/Setup.hs:2:1:
    Warning: In the use of `runTests'
             (imported from Distribution.Simple, but defined in Distribution.Simple.UserHooks):
             Deprecated: "Please use the new testing interface instead!"
Linking /var/folders/4z/7867658n33bckfymwsmh6z8w0000gp/T/bits-atomic-0.1.3-70853/bits-atomic-0.1.3/dist/setup/setup ...
Configuring bits-atomic-0.1.3...
Building bits-atomic-0.1.3...
Preprocessing library bits-atomic-0.1.3...
[1 of 1] Compiling Data.Bits.Atomic ( Data/Bits/Atomic.hs, dist/build/Data/Bits/Atomic.o )
Registering bits-atomic-0.1.3...
Running Haddock for bits-atomic-0.1.3...
Warning: The documentation for the following packages are not installed. No
links will be generated to these packages: rts-1.0
Preprocessing library bits-atomic-0.1.3...
Haddock coverage:
 100% (  5 /  5) in 'Data.Bits.Atomic'
Documentation created: dist/doc/html/bits-atomic/index.html
Installing library in /Users/tibbe/.cabal/lib/bits-atomic-0.1.3/ghc-7.4.1
Registering bits-atomic-0.1.3...
Updating documentation index /Users/tibbe/.cabal/share/doc/index.html

@bos
Copy link
Contributor Author

bos commented Aug 14, 2012

Well huh. Cabal and cabal-install swore they were the versions they claimed, but I rebuilt both, and now everything works. That's deeply weird.

@tibbe
Copy link
Member

tibbe commented Aug 14, 2012

What might have happened is that because we don't bump the versions numbers until just before a release, a build from HEAD, made after e.g. 1.14.0 was made, will be identified as 1.14.0.

@tibbe tibbe closed this as completed Aug 14, 2012
@bos bos reopened this Aug 14, 2012
@bos
Copy link
Contributor Author

bos commented Aug 14, 2012

@bos
Copy link
Contributor Author

bos commented Aug 14, 2012

This seems to be specific to GHC 7.2.1, though?

@tibbe
Copy link
Member

tibbe commented Aug 14, 2012

Each GHC has its own version of Cabal the library installed. Could you check which one is used by your 7.2.1. Perhaps the custom Setup is linking against an older Cabal than we thing?

@tibbe
Copy link
Member

tibbe commented Aug 14, 2012

Perhaps you could build using just the bits-atomic package using -v3 so we can see exactly which libraries are picked up. My suspicion is that the Cabal that shipped with 7.2.1 didn't support benchmarks, but the cabal binary you're using does.

@bos
Copy link
Contributor Author

bos commented Aug 14, 2012

Perhaps you could build using just the bits-atomic package using -v3 so
we can see exactly which libraries are picked up. My suspicion is that the
Cabal that shipped with 7.2.1 didn't support benchmarks, but the cabal
binary you're using does.

That seems quite likely. Does that mean I need to build the newest Cabal
separately for each version of GHC I have installed? That's not much
trouble. I'll give it a try.

@tibbe
Copy link
Member

tibbe commented Aug 14, 2012

That seems quite likely. Does that mean I need to build the newest Cabal separately for each version of GHC I have installed? That's not much trouble. I'll give it a try.

I'd like that to not be the case (and we might be able to change things so that's not the case), but feel free to try it out and report back.

@23Skidoo
Copy link
Member

I stumbled into this issue a while ago, and IIRC it is caused by the line configBenchmarks = toFlag False in installConfiguredPackage in Distribution.Client.Install. This field should be set to NoFlag if the Cabal version that the Setup.hs uses is too old.

@23Skidoo
Copy link
Member

Possible duplicate: #932

23Skidoo added a commit to 23Skidoo/cabal that referenced this issue Nov 26, 2012
We must not pass '--disable-benchmarks' to setup scripts built with Cabal <
1.14; the same is also true for '--disable-tests' and Cabal < 1.10.

Fixes haskell#932 and haskell#1004.

Without this patch:

    $ cabal install -w /path/to/ghc-7.2.1/bin/ghc syb
    [...]
    unrecognized option `--disable-benchmarks'
    Failed to install syb-0.3.7

With this patch:

    $ cabal install -w /path/to/ghc-7.2.1/bin/ghc syb
    [...]
    Registering syb-0.3.7...
    Installed syb-0.3.7
@tibbe
Copy link
Member

tibbe commented Nov 29, 2012

Fixed by 582d12e.

@tibbe tibbe closed this as completed Nov 29, 2012
@rrnewton
Copy link
Member

rrnewton commented May 8, 2013

FYI, my Jenkins also ran into this with GHC 7.2.2 on "haskell-src-exts". This was using a single cabal binary across all GHC versions (cabal-install 1.16.0.2). I'll see if Cabal HEAD fixes it.

http://tester-lin.soic.indiana.edu:8080/job/HackageReleased_monad-par/GHC_VERS=7.2.2,label=linux/7/console

I couldn't quite make out from the above exchange -- @bos, did you get things to work by building a separate cabal with each GHC?

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

No branches or pull requests

5 participants