reactive-banana icon indicating copy to clipboard operation
reactive-banana copied to clipboard

Can't cabal install reactive-banana-wx without -fbuildExamples flag on OS X

Open erikkaplun opened this issue 9 years ago • 20 comments

OS X version 10.9.5 cabal version 1.22.3.0 GHC verison: 7.8.3 (from Haskell Platform)

~/code/haskell/reactive-bananas$ cabal sandbox delete
Deleting the sandbox located at
/Users/erik/code/haskell/reactive-bananas/.cabal-sandbox
~/code/haskell/reactive-bananas$ cabal sandbox init
Writing a default package environment file to
/Users/erik/code/haskell/reactive-bananas/cabal.sandbox.config
Creating a new sandbox at
/Users/erik/code/haskell/reactive-bananas/.cabal-sandbox
~/code/haskell/reactive-bananas$ cabal install cabal-macosx
Resolving dependencies...
Notice: installing into a sandbox located at
/Users/erik/code/haskell/reactive-bananas/.cabal-sandbox
Configuring fgl-5.4.2.4...
Building fgl-5.4.2.4...
Installed fgl-5.4.2.4
Configuring cabal-macosx-0.2.3...
Building cabal-macosx-0.2.3...
Installed cabal-macosx-0.2.3
Updating documentation index
/Users/erik/code/haskell/reactive-bananas/.cabal-sandbox/share/doc/x86_64-osx-ghc-7.8.3/index.html
~/code/haskell/reactive-bananas$ cabal install reactive-banana-wx
Resolving dependencies...
Notice: installing into a sandbox located at
/Users/erik/code/haskell/reactive-bananas/.cabal-sandbox
Configuring pqueue-1.2.1...
Configuring strict-0.3.2...
Configuring vault-0.3.0.4...
Building pqueue-1.2.1...
Building strict-0.3.2...
Building vault-0.3.0.4...
Installed strict-0.3.2
Configuring wxdirect-0.91.0.0...
Building wxdirect-0.91.0.0...
Installed vault-0.3.0.4
Installed pqueue-1.2.1
Configuring reactive-banana-0.8.1.1...
Building reactive-banana-0.8.1.1...
Installed wxdirect-0.91.0.0
Configuring wxc-0.91.0.0...
Building wxc-0.91.0.0...
Installed reactive-banana-0.8.1.1

Installed wxc-0.91.0.0
Configuring wxcore-0.91.0.0...
Building wxcore-0.91.0.0...
Installed wxcore-0.91.0.0
Configuring wx-0.91.0.0...
Building wx-0.91.0.0...
Installed wx-0.91.0.0
Configuring reactive-banana-wx-0.8.0.4...
Failed to install reactive-banana-wx-0.8.0.4
Build log ( /Users/erik/code/haskell/reactive-bananas/.cabal-sandbox/logs/reactive-banana-wx-0.8.0.4.log ):
Updating documentation index
/Users/erik/code/haskell/reactive-bananas/.cabal-sandbox/share/doc/x86_64-osx-ghc-7.8.3/index.html
cabal: Error: some packages failed to install:
reactive-banana-wx-0.8.0.4 failed during the configure step. The exception
was:
user error ('/usr/bin/ghc' exited with an error:

/var/folders/6t/1w8bgc395xz4k1n_85r2wjz00000gn/T/reactive-banana-wx-0.8.0.4-24164/reactive-banana-wx-0.8.0.4/dist/dist-sandbox-648e5c4b/setup/setup.hs:11:19:
Couldn't match type ‘Cabal-1.18.1.4:Distribution.Simple.Setup.BuildFlags’
with ‘Distribution.Simple.Setup.BuildFlags’
NB: ‘Cabal-1.18.1.4:Distribution.Simple.Setup.BuildFlags’
is defined in ‘Distribution.Simple.Setup’
in package ‘Cabal-1.18.1.4’
‘Distribution.Simple.Setup.BuildFlags’
is defined in ‘Distribution.Simple.Setup’
in package ‘Cabal-1.22.2.0’
Expected type: Args
-> Distribution.Simple.Setup.BuildFlags
-> Distribution.PackageDescription.PackageDescription
-> LocalBuildInfo
-> IO ()
Actual type: [String]
-> Cabal-1.18.1.4:Distribution.Simple.Setup.BuildFlags
-> Cabal-1.18.1.4:Distribution.PackageDescription.PackageDescription
-> Cabal-1.18.1.4:Distribution.Simple.LocalBuildInfo.LocalBuildInfo
-> IO ()
In the ‘postBuild’ field of a record
In the second argument of ‘($)’, namely
‘simpleUserHooks {postBuild = myPostBuild}’
)

erikkaplun avatar Apr 24 '15 12:04 erikkaplun

I also tried installing in multiple steps, to no avail:

~/code/haskell/reactive-bananas$ cabal sandbox delete
Deleting the sandbox located at
/Users/erik/code/haskell/reactive-bananas/.cabal-sandbox
~/code/haskell/reactive-bananas$ cabal sandbox init
Writing a default package environment file to
/Users/erik/code/haskell/reactive-bananas/cabal.sandbox.config
Creating a new sandbox at
/Users/erik/code/haskell/reactive-bananas/.cabal-sandbox
~/code/haskell/reactive-bananas$ cabal install cabal-macosx
Resolving dependencies...
Notice: installing into a sandbox located at
/Users/erik/code/haskell/reactive-bananas/.cabal-sandbox
Configuring fgl-5.4.2.4...
Building fgl-5.4.2.4...
Installed fgl-5.4.2.4
Configuring cabal-macosx-0.2.3...
Building cabal-macosx-0.2.3...
Installed cabal-macosx-0.2.3
Updating documentation index
/Users/erik/code/haskell/reactive-bananas/.cabal-sandbox/share/doc/x86_64-osx-ghc-7.8.3/index.html
~/code/haskell/reactive-bananas$ cabal install reactive-banana
Resolving dependencies...
Notice: installing into a sandbox located at
/Users/erik/code/haskell/reactive-bananas/.cabal-sandbox
Configuring pqueue-1.2.1...
Configuring vault-0.3.0.4...
Building pqueue-1.2.1...
Building vault-0.3.0.4...
Installed vault-0.3.0.4
Installed pqueue-1.2.1
Configuring reactive-banana-0.8.1.1...
Building reactive-banana-0.8.1.1...
Installed reactive-banana-0.8.1.1
Updating documentation index
/Users/erik/code/haskell/reactive-bananas/.cabal-sandbox/share/doc/x86_64-osx-ghc-7.8.3/index.html
~/code/haskell/reactive-bananas$ cabal install reactive-banana-wx
Resolving dependencies...
Notice: installing into a sandbox located at
/Users/erik/code/haskell/reactive-bananas/.cabal-sandbox
Configuring strict-0.3.2...
Building strict-0.3.2...
Installed strict-0.3.2
Configuring wxdirect-0.91.0.0...
Building wxdirect-0.91.0.0...
Installed wxdirect-0.91.0.0
Configuring wxc-0.91.0.0...
Building wxc-0.91.0.0...
Installed wxc-0.91.0.0
Configuring wxcore-0.91.0.0...
Building wxcore-0.91.0.0...
Installed wxcore-0.91.0.0
Configuring wx-0.91.0.0...
Building wx-0.91.0.0...
Installed wx-0.91.0.0
Configuring reactive-banana-wx-0.8.0.4...
Failed to install reactive-banana-wx-0.8.0.4
Build log ( /Users/erik/code/haskell/reactive-bananas/.cabal-sandbox/logs/reactive-banana-wx-0.8.0.4.log ):
Updating documentation index
/Users/erik/code/haskell/reactive-bananas/.cabal-sandbox/share/doc/x86_64-osx-ghc-7.8.3/index.html
cabal: Error: some packages failed to install:
reactive-banana-wx-0.8.0.4 failed during the configure step. The exception
was:
user error ('/usr/bin/ghc' exited with an error:

/var/folders/6t/1w8bgc395xz4k1n_85r2wjz00000gn/T/reactive-banana-wx-0.8.0.4-27987/reactive-banana-wx-0.8.0.4/dist/dist-sandbox-648e5c4b/setup/setup.hs:11:19:
Couldn't match type ‘Cabal-1.18.1.4:Distribution.Simple.Setup.BuildFlags’
with ‘Distribution.Simple.Setup.BuildFlags’
NB: ‘Cabal-1.18.1.4:Distribution.Simple.Setup.BuildFlags’
is defined in ‘Distribution.Simple.Setup’
in package ‘Cabal-1.18.1.4’
‘Distribution.Simple.Setup.BuildFlags’
is defined in ‘Distribution.Simple.Setup’
in package ‘Cabal-1.22.2.0’
Expected type: Args
-> Distribution.Simple.Setup.BuildFlags
-> Distribution.PackageDescription.PackageDescription
-> LocalBuildInfo
-> IO ()
Actual type: [String]
-> Cabal-1.18.1.4:Distribution.Simple.Setup.BuildFlags
-> Cabal-1.18.1.4:Distribution.PackageDescription.PackageDescription
-> Cabal-1.18.1.4:Distribution.Simple.LocalBuildInfo.LocalBuildInfo
-> IO ()
In the ‘postBuild’ field of a record
In the second argument of ‘($)’, namely
‘simpleUserHooks {postBuild = myPostBuild}’
)

erikkaplun avatar Apr 24 '15 13:04 erikkaplun

This problem is somewhat independent of reactive-banana-wx and has to do with the cabal library and utility. This is the same issue as #69.

The key hint is the following part of the error message:

NB: ‘Cabal-1.18.1.4:Distribution.Simple.Setup.BuildFlags’
is defined in ‘Distribution.Simple.Setup’
in package ‘Cabal-1.18.1.4’
‘Distribution.Simple.Setup.BuildFlags’
is defined in ‘Distribution.Simple.Setup’
in package ‘Cabal-1.22.2.0’

reactive-banana-wx uses a custom Setup.hs file. The problem is that the version of the cabal library that you have installed as a library (probably Cabal-1.22.2.0) does not match the version of the cabal library that you use for the cabal command (probably Cabal-1.18.1.4).

Use

> cabal --version
> cabal sandbox hc-pkg list

to find out which versions you are using. I think the solution is to install the version of the cabal library that matches cabal --version together with the cabal-macosx utility, e.g.

cabal install Cabal-1.22.2.0 cabal-macosx

HeinrichApfelmus avatar Apr 26 '15 14:04 HeinrichApfelmus

I did $ cabal install Cabal-1.22.2.0 cabal-macosx as you told, which lead me to another error, which is probably out of the scope of this issue:

~/code/haskell/reactive-bananas$ cabal install reactive-banana-wx
Resolving dependencies...
Notice: installing into a sandbox located at
/Users/erik/code/haskell/reactive-bananas/.cabal-sandbox
Configuring pqueue-1.2.1...
...
Installed wx-0.91.0.0
Building reactive-banana-wx-0.8.0.4...
Failed to install reactive-banana-wx-0.8.0.4
Build log ( /Users/erik/code/haskell/reactive-bananas/.cabal-sandbox/logs/reactive-banana-wx-0.8.0.4.log ):
[1 of 1] Compiling Main             ( /var/folders/6t/1w8bgc395xz4k1n_85r2wjz00000gn/T/reactive-banana-wx-0.8.0.4-53307/reactive-banana-wx-0.8.0.4/dist/dist-sandbox-648e5c4b/setup/setup.hs, /var/folders/6t/1w8bgc395xz4k1n_85r2wjz00000gn/T/reactive-banana-wx-0.8.0.4-53307/reactive-banana-wx-0.8.0.4/dist/dist-sandbox-648e5c4b/setup/Main.o )
Linking /var/folders/6t/1w8bgc395xz4k1n_85r2wjz00000gn/T/reactive-banana-wx-0.8.0.4-53307/reactive-banana-wx-0.8.0.4/dist/dist-sandbox-648e5c4b/setup/setup ...
Configuring reactive-banana-wx-0.8.0.4...
Building reactive-banana-wx-0.8.0.4...
Preprocessing library reactive-banana-wx-0.8.0.4...
[1 of 1] Compiling Reactive.Banana.WX ( src/Reactive/Banana/WX.hs, dist/dist-sandbox-648e5c4b/build/Reactive/Banana/WX.o )
[1 of 1] Compiling Reactive.Banana.WX ( src/Reactive/Banana/WX.hs, dist/dist-sandbox-648e5c4b/build/Reactive/Banana/WX.p_o )
In-place registering reactive-banana-wx-0.8.0.4...
Creating application bundle directory dist/dist-sandbox-648e5c4b/build/Asteroids.app
Copying executable Asteroids into place
setup: dist/dist-sandbox-648e5c4b/build/Asteroids/Asteroids: does not exist
Updating documentation index
/Users/erik/code/haskell/reactive-bananas/.cabal-sandbox/share/doc/x86_64-osx-ghc-7.8.3/index.html
cabal: Error: some packages failed to install:
reactive-banana-wx-0.8.0.4 failed during the building phase. The exception
was:
ExitFailure 1

erikkaplun avatar Apr 26 '15 20:04 erikkaplun

The last issue looks like a problem with reactive-banana. It appears that the custom installation script tries to install an example, but fails, because the executable has not been built. I think it should work if you use the buildExamples flag:

 cabal install reactive-banana-wx -fbuildExamples

EDIT:

Actually, this is an issue with the cabal-macosx package, documented in gimbo/cabal-macosx#7 . It looks like the fix doesn't work with sandboxes, or didn't make it into the version of cabal-macosx that is currently available on hackage.

HeinrichApfelmus avatar May 01 '15 15:05 HeinrichApfelmus

Any luck with this issue? I am trying to install reactive-banana-wx 0.9.0.1 on Mac but I am stuck with the same error reported above.

danfran avatar Aug 28 '15 19:08 danfran

Did you try to add the -fbuildExamples flag?

HeinrichApfelmus avatar Aug 28 '15 19:08 HeinrichApfelmus

after deleted and re-init the sandbox with that flag I am getting:

$ cabal configure -fbuildExamples && cabal build Resolving dependencies... Configuring reactive-banana-wx-0.9.0.1... setup: At least the following dependencies are missing: array >=0.3 && <0.5, cabal-macosx >=0.1 && <0.3, executable-path ==0.0.*, process >=1.0 && <1.2, reactive-banana >=0.8 && <0.10, wx >=0.13.2.1 && <0.90 || >=0.90.0.1 && <0.93, wxcore >=0.13.2.1 && <0.90 || >=0.90.0.1 && <0.93

danfran avatar Aug 28 '15 19:08 danfran

After a 'cabal install' without flag, I re-run the cabal install with the flag and I get:

$ cabal configure -fbuildExamples && cabal build Resolving dependencies... Configuring reactive-banana-wx-0.9.0.1... setup: At least the following dependencies are missing: array >=0.3 && <0.5, process >=1.0 && <1.2

I have installed separately executable-path that was required too but I cannot install right versions for process and array.

danfran avatar Aug 28 '15 19:08 danfran

This looks like a mistake on my part, there are newer dependencies available. You can try to change the upper bounds for array and process to < 0.6 and < 1.4 in the cabal file.

HeinrichApfelmus avatar Aug 28 '15 19:08 HeinrichApfelmus

Thank you! It's working now. I can push the cabal file change if you want me to do so.

danfran avatar Aug 28 '15 20:08 danfran

Your report that everything works is sufficient for me. :smile: I have uploaded a new version to hackage that (hopfully) includes the updated dependencies.

HeinrichApfelmus avatar Aug 28 '15 20:08 HeinrichApfelmus

Thank you. I saw you managed to push the new reactive-banana-wx 0.9.0.2 to hackage but I still have some problems to include it as normal dependency in one of my projects. I am using a sandbox and this is the list of dependencies I use in the proj at the moment:

build-depends: base >=4.7 && <4.8 , http-conduit , aeson , text , bytestring , network-uri , HTTP , wx , wxcore , file-embed , directory , mtl , time , old-locale , random , transformers-base , reactive-banana >=0.9 && <0.10 , reactive-banana-wx ==0.9.0.2

and this is what I am getting

$ cabal install reactive-banana-wx-0.9.0.2 Resolving dependencies... cabal: Could not resolve dependencies: next goal: reactive-banana-wx (user goal) rejecting: reactive-banana-wx-0.9.0.1, 0.9.0.0, 0.8.0.4, 0.8.0.0, 0.7.1.0, 0.7.0.0, 0.6.0.1, 0.6.0.0, 0.5.0.0, 0.4.3.2, 0.4.3.1, 0.4.3.0, 0.4.2.0, 0.4.1.1, 0.4.1.0, 0.4.0.0, 0.3.0.1, 0.3.0.0, 0.2.0.3, 0.2.0.1, 0.1.0.2, 0.1.0.1, 0.1.0.0 (global constraint requires ==0.9.0.2) Dependency tree exhaustively searched.

Note: when using a sandbox, all packages are required to have consistent dependencies. Try reinstalling/unregistering the offending packages or recreating the sandbox.

any idea?

danfran avatar Aug 30 '15 06:08 danfran

It looks like the cabal program on your machine doesn't know about version 0.9.0.2 yet. Try

cabal update

to download the latest package list. And I still recommend the -fbuildExamples option, i.e.

cabal install -fbuildExamples reactive-banana-wx-0.9.0.2

HeinrichApfelmus avatar Aug 30 '15 07:08 HeinrichApfelmus

oooops true :) thanks. Anyway after that update, I wiped out again the local sandbox, and reinstalled the needed dependencies, but when I run

cabal install -fbuildExamples reactive-banana-wx-0.9.0.2

I get:

`Resolving dependencies... Notice: installing into a sandbox located at /Users/df/haskell-scripts/hxkcd/.cabal-sandbox Configuring reactive-banana-wx-0.9.0.2... Failed to install reactive-banana-wx-0.9.0.2 Build log ( /Users/df/haskell-scripts/hxkcd/.cabal-sandbox/logs/reactive-banana-wx-0.9.0.2.log ): cabal: Error: some packages failed to install: reactive-banana-wx-0.9.0.2 failed during the configure step. The exception was: user error ('/usr/bin/ghc' exited with an error:

/var/folders/v_/lqvmght96572wbxsmy2zb74c0000gn/T/reactive-banana-wx-0.9.0.2-27762/reactive-banana-wx-0.9.0.2/dist/dist-sandbox-266817a0/setup/setup.hs:11:19: Couldn't match type ‘Cabal-1.18.1.4:Distribution.Simple.Setup.BuildFlags’ with ‘Distribution.Simple.Setup.BuildFlags’ NB: ‘Cabal-1.18.1.4:Distribution.Simple.Setup.BuildFlags’ is defined in ‘Distribution.Simple.Setup’ in package ‘Cabal-1.18.1.4’ ‘Distribution.Simple.Setup.BuildFlags’ is defined in ‘Distribution.Simple.Setup’ in package ‘Cabal-1.22.3.0’ Expected type: Args -> Distribution.Simple.Setup.BuildFlags -> Distribution.PackageDescription.PackageDescription -> LocalBuildInfo -> IO () Actual type: [String] -> Cabal-1.18.1.4:Distribution.Simple.Setup.BuildFlags -> Cabal-1.18.1.4:Distribution.PackageDescription.PackageDescription -> Cabal-1.18.1.4:Distribution.Simple.LocalBuildInfo.LocalBuildInfo -> IO () In the ‘postBuild’ field of a record In the second argument of ‘($)’, namely ‘simpleUserHooks {postBuild = myPostBuild}’ )`

danfran avatar Aug 30 '15 08:08 danfran

I can see:

$ ghc-pkg field reactive-banana-wx depends depends: base-4.7.0.1-df210ede1eb79477fef5662549c32927 cabal-macosx-0.2.3-7cbbafda65837f20448272f6f7cb7da9 reactive-banana-0.9.0.0-3e49472893c6621893cb78025611f40c wx-0.91.0.0-34ccf045cef0084fe3dac1953a31bc93 wxcore-0.91.0.0-18855b523ece236d6dfdca62a20deff3

I have not specified wx/core versions so for default cabal picked the last ones 0.92. Maybe that is one of the reasons.

danfran avatar Aug 30 '15 08:08 danfran

Finally I made it. I needed to install:

cabal install cabal-install-1.22.3.0

Then finally using the cabal just installed in the sandbox:

.cabal-sandbox/bin/cabal install -fbuildExamples reactive-banana-wx-0.9.0.2

I have been able to install it.

Is the package building 'coupled' with that specific version of cabal?

danfran avatar Aug 30 '15 09:08 danfran

Is the package building 'coupled' with that specific version of cabal?

No, it's just that the version of the cabal program used to build reactive-banana-wx must agree with the version of the cabal library that was chosen to build the cabal-macosx package.

If there is a newer version of the cabal library on hackage, than it may happen that this one will get used for cabal-macosx package, even though the cabal program on your machine is not updated. That's why installing cabal-install (the program) fixed your problem.

HeinrichApfelmus avatar Aug 30 '15 12:08 HeinrichApfelmus

True, If I just use 'cabal install cabal-install' the version 1.22.4.0 will be picked up. But that still gives a problem like for the version 1.18. So you need to specify the version 1.22.3.0 at the moment.

danfran avatar Aug 30 '15 16:08 danfran

it seems that stack is able to build reactive-banana-wx properly, at least when using ghc-7.8.4 as the resolver and by using --flag reactive-banana-wx:buildExamples. however, the latter requires the manual addition of random-1.0.1.1 (not 1.0.1.3 which seems to require GHC 7.10.2) and executable-path-0.0.3 to extra-deps, which stack solver wasn't able to figure out after having added the buildExamples flag to stack.yaml (I've filed a bug on this to stack).

in any case, I'm able to run (most) reactive-banana-wx examples successfully now.

erikkaplun avatar Sep 28 '15 12:09 erikkaplun

Just FYI I became mantainer on Hackage/Github for the package cabal-macosx. If you need to pull requests and suggest some change use my github fork repo. Thank you.

danfran avatar Oct 06 '15 21:10 danfran