[Haskell-cafe] ANN: custom-hackage

Albert Y. C. Lai trebla at vex.net
Sun Jun 16 20:42:59 CEST 2013


On 13-06-13 11:09 AM, Niklas Hambüchen wrote:
> https://github.com/nh2/custom-hackage
>
> An (almost trivial) script to generate 00-index.tar.gz which is
> necessary to run your own `remote-repo`.

I write the following critique with much reluctance, since I will be 
saying a lot of "this cannot possibly work, here is why", but I would 
also like to think that it had worked for you before you published it.

Assume the remote-repo line goes like

remote-repo: custom:http://127.0.0.1:8080/packages/archive

And assume it has just one package, formula-1.1

Then your scheme uses this layout:

   http://127.0.0.1:8080/00-index.tar.gz
   http://127.0.0.1:8080/packages/archive/formula/1.1/formula-1.1.tar.gz

However, cabal-install expects this layout:

   http://127.0.0.1:8080/packages/archive/00-index.tar.gz
   http://127.0.0.1:8080/packages/archive/package/formula-1.1.tar.gz

I know this by both reading cabal-install source code and empirical 
tests, both 0.14 and 1.16.

I have a working example at
http://www.vex.net/~trebla/haskell/conrepo

Lastly, I want to emphasize these points:

The layout is different from Hackage's; cabal-install source code 
hardcodes treating Hackage differently. Yes, it goes out of its way to 
detect "http://hackage.haskell.org/packages/archive" and do a different 
thing. Mimicking Hackage is futile, unless you go out of your way to 
also mimic the host name "hackage.haskell.org".

And the layout is different from local-repo's; local-repo's is in fact 
close to Hackage's.

See my
http://www.vex.net/~trebla/haskell/cabal-cabal.xhtml#remote-repo




More information about the Haskell-Cafe mailing list