Ticket #419 (new defect)

Opened 4 years ago

Last modified 15 months ago

cabal-install should handle packages that need a later Cabal version better

Reported by: jimburton Owned by:
Priority: normal Milestone: cabal-install-0.16
Component: cabal-install tool Version: 1.4.0.2
Severity: normal Keywords:
Cc: Difficulty: normal
GHC Version: 6.8.3 Platform:

Description

I am using cabal-install 0.5.2. I have previously installed cgi (and other packages) locally. Now when I try to upgrade them all:

Resolving dependencies... cabal: Couldn't read cabal file "./cgi/3001.1.7.1/cgi.cabal"

I presumed that the starting point in that path was ~/.cabal/packages/hackage.haskell.org. In cgi/3001.1.7.1 there is just the tarball for the package but opening it and putting the .cabal file in the right place didn't help.

Change History

follow-up: ↓ 2   Changed 4 years ago by duncan

  • summary changed from cabal-install: upgrade complains about missing .cabal file to cabal-install should handle packages that need a later Cabal version better

The problem is that cgi-3001.1.7.1 uses syntax that is new in Cabal-1.6 and your version of cabal-install is using Cabal-1.4. So it's not that the file is missing (it isn't) but the .cabal file cannot be parsed.

Try upgrading cabal-install and try again: cabal install cabal-install

So there's not a lot we can do about this now. However we should be able to make cabal-install be a bit more graceful in handling packages that require a later version of Cabal to parse properly.

in reply to: ↑ 1 ; follow-up: ↓ 3   Changed 4 years ago by jimburton

Replying to duncan:

The problem is that cgi-3001.1.7.1 uses syntax that is new in Cabal-1.6 and your version of cabal-install is using Cabal-1.4. So it's not that the file is missing (it isn't) but the .cabal file cannot be parsed. Try upgrading cabal-install and try again: cabal install cabal-install

Thanks, but upgrading Cabal lib and cabal-install haven't helped. I couldn't upgrade Cabal with cabal-install ("No packages to install") so I downloaded Cabal 1.6 and installed it myself then used ghc-pkg to unregister older version of Cabal. Then I reinstalled cabal-install but it is still reporting the older version of cabal:

jim@mowa624-jb162:~$ ghc-pkg list /usr/local/lib/ghc-6.8.3/package.conf:

HTTP-3001.0.4, HUnit-1.2.0.0, QuickCheck?-1.1.0.0, array-0.1.0.0, base-3.0.2.0, binary-0.4.3.1, bytestring-0.9.0.1.1, cgi-3001.1.6.0, containers-0.1.0.2, directory-1.0.0.1, fgl-5.4.2.0, filepath-1.1.0.0, {ghc-6.8.3}, haskell-src-1.0.1.2, haskell98-1.0.1.0, hpc-0.5.0.1, html-1.0.1.1, mtl-1.1.0.1, network-2.2.0.0, old-locale-1.0.0.0, old-time-1.0.0.0, packedstring-0.1.0.0, parallel-1.0.0.1, parsec-2.1.0.1, pretty-1.0.0.0, process-1.0.0.1, random-1.0.0.0, readline-1.0.1.0, regex-base-0.72.0.1, regex-compat-0.71.0.1, regex-posix-0.72.0.2, rts-1.0, stm-2.1.1.1, template-haskell-2.2.0.0, time-1.1.2.1, unix-2.3.0.1, xhtml-3000.2.0.0, zlib-0.4.0.4

/home/jim/.ghc/i386-linux-6.8.3/package.conf:

Agda-2.1.3, Cabal-1.6.0.1, HTTP-3001.1.3, HTTP-3001.1.4, QuickCheck?-1.2.0.0, QuickCheck?-2.1.0.1, X11-1.4.3, X11-xft-0.3, binary-0.4.3.1, binary-0.4.4, bytestring-0.9.1.3, cgi-3001.1.7.0, fgl-5.4.2.2, haskell-src-1.0.1.3, html-1.0.1.2, mtl-1.1.0.2, network-2.2.0.0, network-2.2.0.1, parsec-3.0.0, regex-base-0.93.1, regex-compat-0.92, regex-posix-0.93.2, stm-2.1.1.2, time-1.1.2.2, utf8-string-0.3.1.1, utf8-string-0.3.2, xhtml-3000.2.0.1, xmonad-0.8, xmonad-contrib-0.8, zlib-0.5.0.0

jim@mowa624-jb162:~$ cabal install cabal-install Resolving dependencies... 'cabal-install-0.6.0' is cached. Configuring cabal-install-0.6.0... Preprocessing executables for cabal-install-0.6.0... Building cabal-install-0.6.0... [ 1 of 29] Compiling Distribution.Client.Utils ( Distribution/Client/Utils.hs, dist/build/cabal .. [29 of 29] Compiling Main ( ./Main.hs, dist/build/cabal/cabal-tmp/Main.o ) Linking dist/build/cabal/cabal ... Installing: /home/jim/.cabal/bin jim@mowa624-jb162:~$ cabal --version cabal-install version 0.5.2 using version 1.4.0.2 of the Cabal library

##############

And cabal upgrade still doesn't work. I thought I might need to clean and reconfigure the cabal-install package myself so I tried that too, manually deleting ~/.cabal/bin/cabal and using `runhaskell Setup.hs --user ...' etc in the packages directory. After that I am still told I'm using Cabal 1.4.

Thanks,

in reply to: ↑ 2 ; follow-up: ↓ 4   Changed 4 years ago by duncan

Replying to jimburton:

Installing: /home/jim/.cabal/bin jim@mowa624-jb162:~$ cabal --version cabal-install version 0.5.2 using version 1.4.0.2 of the Cabal library

You must have another instance of the cabal program on your $PATH that is shadowing the one you just installed.

See which cabal it'll report something other than /home/jim/.cabal/bin/cabal.

in reply to: ↑ 3   Changed 4 years ago by jimburton

Replying to duncan:

Replying to jimburton:

Installing: /home/jim/.cabal/bin jim@mowa624-jb162:~$ cabal --version cabal-install version 0.5.2 using version 1.4.0.2 of the Cabal library

You must have another instance of the cabal program on your $PATH that is shadowing the one you just installed. See which cabal it'll report something other than /home/jim/.cabal/bin/cabal.

Of course! Thanks, that was silly of me.

  Changed 4 years ago by duncan

  • milestone set to cabal-install-0.8

The solution to this is to parse the hackage index when we download it into a local format that is a bit quicker. At the same time we can ignore or handle packages we cannot read.

  Changed 15 months ago by kosmikus

  • milestone changed from cabal-install-0.8 to cabal-install-0.16

I think Duncan's last comment is at least partially done

Sun Oct 23 23:32:53 CEST 2011  Duncan Coutts <duncan@community.haskell.org>
  * Add a source package index cache to speed up reading
  e.g. about 3x faster for cabal info pkgname
Note: See TracTickets for help on using tickets.