[Haskell-cafe] is there a way to patch the build-depends line of a cabal file without breaking backwards compatibility?
cafe, is there a way to patch the build-depends line of a cabal file without breaking backwards compatibility? I just patched HDBC head to compile under ghc 6.7. Unfortunately it now won't compile in 6.6.1. is there a way for build-depends to detect which version of ghc you're on? also I seem to recall that -fglasgow-exts was deprecated under 6.7. is there a better way to beat back the error message below than this? thanks, thomas. { hunk ./Database/HDBC/Statement.hs 1 +{-# LANGUAGE TypeSynonymInstances #-} hunk ./Database/HDBC/Types.hs 1 +{-# OPTIONS_GHC -fglasgow-exts #-} +{- +-- without -fglasgow-exts you get: [_$_] +Database/HDBC/Types.hs:202:0: +Illegal polymorphic or qualified type: forall conn. + (IConnection conn) = + conn - b +In the type signature for `withWConn': + withWConn :: forall b. + ConnWrapper - (forall conn. (IConnection conn) = conn - b) - b +-} hunk ./HDBC.cabal 13 -Build-Depends: base, mtl + +Build-Depends: base, mtl, old-time, bytestring, containers +-- breaks backwards compability with ghc 6.6.1 + } --- This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] is there a way to patch the build-depends line of a cabal file without breaking backwards compatibility?
On 20 aug 2007, at 18.37, Thomas Hartman wrote: cafe, is there a way to patch the build-depends line of a cabal file without breaking backwards compatibility? I just patched HDBC head to compile under ghc 6.7. Unfortunately it now won't compile in 6.6.1. is there a way for build-depends to detect which version of ghc you're on? also I seem to recall that -fglasgow-exts was deprecated under 6.7. is there a better way to beat back the error message below than this? The next release of Cabal (and the current HEAD) supports conditionals to test for flags, os/arch, and implementation (+version). Note that the problem isn't the GHC version, but the new base version, in which the old base was split up into smaller packages, so we have something roughly like: base-1.0 = base-2.0 + bytestring + old-time + mtl. Take a look at the Cabal.cabal file, how this is solved, atm. Please also note that this might not be the best way to use the new features; as I suggested in another thread, simulating base-1.0 on systems with base-2.0 is probably best handled with a base.cabal file that imports base-2.0, old-time, etc. and re- exports all imported modules to get a virtual base-1.0. / Thomas ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] is there a way to patch the build-depends line of a cabal file without breaking backwards compatibility?
Take a look at the Cabal.cabal file, how this is solved, atm. where is this, how can I take a look at it? The next release of Cabal (and the current HEAD) supports conditionals I couldn't install head, but since I'm running 6.7, do I already have it? [EMAIL PROTECTED]:~/installs/cabal-head/cabalrunghc Setup.lhs configure Distribution/Simple/InstallDirs.hs:267:36: Not in scope: `dropDrive' [EMAIL PROTECTED]:~/installs/cabal-head/caballs -l `which ghc` lrwxrwxrwx 1 root root 31 2007-08-20 11:08 /usr/local/bin/ghc - /usr/local/bin/ghc-6.7.20070816 [EMAIL PROTECTED]:~/installs/cabal-head/cabalghc-pkg list | grep -i cabal Cabal-1.1.7 Please also note that this might not be the best way to use the new features; as I suggested in another thread, simulating base-1.0 on systems with base-2.0 is probably best handled with a base.cabal file that imports base-2.0, old-time, etc. and re- exports all imported modules to get a virtual base-1.0. I'm interested in seeing how this works, but I couldn't find that other thread. Where is the documentation for the new functionality in cabal head, or do you just have to read the source code for now? thanks, t Thomas Schilling [EMAIL PROTECTED] 08/20/2007 01:37 PM To Thomas Hartman/ext/[EMAIL PROTECTED] cc haskell-cafe haskell-cafe@haskell.org Subject Re: [Haskell-cafe] is there a way to patch the build-depends line of a cabal file without breaking backwards compatibility? On 20 aug 2007, at 18.37, Thomas Hartman wrote: cafe, is there a way to patch the build-depends line of a cabal file without breaking backwards compatibility? I just patched HDBC head to compile under ghc 6.7. Unfortunately it now won't compile in 6.6.1. is there a way for build-depends to detect which version of ghc you're on? also I seem to recall that -fglasgow-exts was deprecated under 6.7. is there a better way to beat back the error message below than this? The next release of Cabal (and the current HEAD) supports conditionals to test for flags, os/arch, and implementation (+version). Note that the problem isn't the GHC version, but the new base version, in which the old base was split up into smaller packages, so we have something roughly like: base-1.0 = base-2.0 + bytestring + old-time + mtl. Take a look at the Cabal.cabal file, how this is solved, atm. Please also note that this might not be the best way to use the new features; as I suggested in another thread, simulating base-1.0 on systems with base-2.0 is probably best handled with a base.cabal file that imports base-2.0, old-time, etc. and re- exports all imported modules to get a virtual base-1.0. / Thomas --- This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] is there a way to patch the build-depends line of a cabal file without breaking backwards compatibility?
Hi Distribution/Simple/InstallDirs.hs:267:36: Not in scope: `dropDrive' [EMAIL PROTECTED]:~/installs/cabal-head/caballs -l `which ghc` lrwxrwxrwx 1 root root 31 2007-08-20 11:08 /usr/local/bin/ghc - /usr/local/bin/ghc-6.7.20070816 You'll need to upgrade the filepath library as well, since cabal depends on it, and a very recent version at that. Thanks Neil ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] is there a way to patch the build-depends line of a cabal file without breaking backwards compatibility?
On 20 aug 2007, at 20.58, Thomas Hartman wrote: Take a look at the Cabal.cabal file, how this is solved, atm. where is this, how can I take a look at it? http://darcs.haskell.org/cabal/Cabal.cabal See below for a little more explaination. The next release of Cabal (and the current HEAD) supports conditionals I couldn't install head, but since I'm running 6.7, do I already have it? Yes, you already have it. It should be in ghc/libraries/Cabal, or contrib/Cabal [EMAIL PROTECTED]:~/installs/cabal-head/cabalrunghc Setup.lhs configure Distribution/Simple/InstallDirs.hs:267:36: Not in scope: `dropDrive' [EMAIL PROTECTED]:~/installs/cabal-head/caballs -l `which ghc` lrwxrwxrwx 1 root root 31 2007-08-20 11:08 /usr/local/bin/ghc - / usr/local/bin/ghc-6.7.20070816 See Neil's reply. [EMAIL PROTECTED]:~/installs/cabal-head/cabalghc-pkg list | grep - i cabal Cabal-1.1.7 Please also note that this might not be the best way to use the new features; as I suggested in another thread, simulating base-1.0 on systems with base-2.0 is probably best handled with a base.cabal file that imports base-2.0, old-time, etc. and re- exports all imported modules to get a virtual base-1.0. I'm interested in seeing how this works, but I couldn't find that other thread. There is no formal proposal, yet, and I think the note was in a recent thread on cabal-devel or libraries. Therefore, I won't discuss it here. I can tell you the current solution, though. Where is the documentation for the new functionality in cabal head, or do you just have to read the source code for now? Performing (in the Cabal directory) make doc should build the haddocks and the latest user's guide. Performing make users-guide should only build the user's guide, but since that requires some tools which might be non-trivial to set up on some systems, I didn't recommend it. So here's the relevant part of how Cabal.cabal does it: if flag(small_base) { -- For ghc 6.2 you need to add 'unix' to Build-Depends: Build-Depends: base, filepath, pretty, directory, old-time, process, containers } else { Build-Depends: base, filepath } Note, that the format changed to a sectioned format, and that it is quite likely that it will still change slightly before the release. Consult the Cabal user's guide or (probably easier) take a look at other .cabal files in the ghc tree. It's quite straightforward, actually. The interesting feature here is that unless overridden explicitly, the flag small_base will be assigned to a value appropriate for the system, thus, if you don't have any of the packages pretty, directory, etc, it will automatically be assigned to false. (I think it better should be base = 2.0, though.) (Also, the comment can now be replaced by an actual test like: if impl (ghc =6.2) ..) HTH / Thomas ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe