Nix for Hackage/Cabal

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Nix for Hackage/Cabal

Heinrich Apfelmus
Hello,

   http://nix.cs.uu.nl/index.html

"Nix is a purely functional package manager. This means that it treats
packages like values in purely functional programming languages such as
Haskell - they are built by functions that don't have side-effects, and
they never change after they have been built."

To me, it sounds like the ideal solution to package/make/build
management in general and Cabal/Hackage/Cabal-install in particular.
After all, compilation is just a _pure_ function

  compile :: Source -> Dependencies -> Object

So, the suggestion is to use Nix for Hackage/Cabal. This way, we get
package installation/deinstallation for free. I didn't look into it, but
it seems that the package description language can express most content
from .cabal files and I guess that it even eliminates the need for most
of Cabal's functionality like finding compilers and such.

The only drawback is that Nix uses a home-brew functional language for
package descriptions. Of course, it would be ideal to have a Haskell DSL
for that :)

Regards,
apfelmus

_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Nix for Hackage/Cabal

Duncan Coutts
On Fri, 2007-07-06 at 16:47 +0200, apfelmus wrote:

> Hello,
>
>    http://nix.cs.uu.nl/index.html
>
> "Nix is a purely functional package manager. This means that it treats
> packages like values in purely functional programming languages such as
> Haskell - they are built by functions that don't have side-effects, and
> they never change after they have been built."
>
> To me, it sounds like the ideal solution to package/make/build
> management in general and Cabal/Hackage/Cabal-install in particular.
> After all, compilation is just a _pure_ function
>
>   compile :: Source -> Dependencies -> Object
>
> So, the suggestion is to use Nix for Hackage/Cabal. This way, we get
> package installation/deinstallation for free. I didn't look into it, but
> it seems that the package description language can express most content
> from .cabal files and I guess that it even eliminates the need for most
> of Cabal's functionality like finding compilers and such.

I was under the impression that it didn't work on Windows. From another
quick look at the website, it looks like that's right. Does anybody
happen to know otherwise?

Duncan

_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Nix for Hackage/Cabal

Heinrich Apfelmus
Duncan Coutts wrote:
> On Fri, 2007-07-06 at 16:47 +0200, apfelmus wrote:
>>
>>    http://nix.cs.uu.nl/index.html
>
> I was under the impression that it didn't work on Windows. From another
> quick look at the website, it looks like that's right. Does anybody
> happen to know otherwise?

I have no idea, but the manual states

"E.2. Release 0.10 (October 6, 2006)
[...]
- Added support for Cygwin (Windows, i686-cygwin), Mac OS X on Intel
(i686-darwin) and Linux on PowerPC (powerpc-linux)"

Regards,
apfelmus

_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Re: Nix for Hackage/Cabal

Bulat Ziganshin-2
Hello apfelmus,

Friday, July 6, 2007, 8:19:58 PM, you wrote:

>> I was under the impression that it didn't work on Windows. From another
> - Added support for Cygwin (Windows, i686-cygwin), Mac OS X on Intel

cygwin isn't windows, it's backdoors :))))


--
Best regards,
 Bulat                            mailto:[hidden email]

_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Re: Nix for Hackage/Cabal

Esa Ilari Vuokko
In reply to this post by Heinrich Apfelmus
On 7/6/07, apfelmus <[hidden email]> wrote:

> Duncan Coutts wrote:
> > On Fri, 2007-07-06 at 16:47 +0200, apfelmus wrote:
> >>
> >>    http://nix.cs.uu.nl/index.html
> >
> > I was under the impression that it didn't work on Windows. From another
> > quick look at the website, it looks like that's right. Does anybody
> > happen to know otherwise?
>
> I have no idea, but the manual states
>
> "E.2. Release 0.10 (October 6, 2006)
> [...]
> - Added support for Cygwin (Windows, i686-cygwin), Mac OS X on Intel
> (i686-darwin) and Linux on PowerPC (powerpc-linux)"

Cygwin support might mean that native Windows support is still miles away, if
possible at all, and assuming Cygwin is a huge leap.

Best regards,
Esa
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Re: Nix for Hackage/Cabal

Andreas Marth
In reply to this post by Heinrich Apfelmus
If that means I have to have cygwin installed to use the installation tools
thats not only a show stopper,  but against the direction ghc took in the
past to become independend of cygwin.

----- Original Message -----
From: "apfelmus" <[hidden email]>
To: <[hidden email]>
Sent: Friday, July 06, 2007 6:19 PM
Subject: [Haskell-cafe] Re: Nix for Hackage/Cabal


> Duncan Coutts wrote:
> > On Fri, 2007-07-06 at 16:47 +0200, apfelmus wrote:
> >>
> >>    http://nix.cs.uu.nl/index.html
> >
> > I was under the impression that it didn't work on Windows. From another
> > quick look at the website, it looks like that's right. Does anybody
> > happen to know otherwise?
>
> I have no idea, but the manual states
>
> "E.2. Release 0.10 (October 6, 2006)
> [...]
> - Added support for Cygwin (Windows, i686-cygwin), Mac OS X on Intel
> (i686-darwin) and Linux on PowerPC (powerpc-linux)"
>
> Regards,
> apfelmus
>
> _______________________________________________
> Haskell-Cafe mailing list
> [hidden email]
> http://www.haskell.org/mailman/listinfo/haskell-cafe

_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Nix for Hackage/Cabal

Arthur van Leeuwen
In reply to this post by Duncan Coutts

On 6-jul-2007, at 18:08, Duncan Coutts wrote:

> On Fri, 2007-07-06 at 16:47 +0200, apfelmus wrote:
>> Hello,
>>
>>    http://nix.cs.uu.nl/index.html
>>
>> "Nix is a purely functional package manager. This means that it  
>> treats
>> packages like values in purely functional programming languages  
>> such as
>> Haskell - they are built by functions that don't have side-
>> effects, and
>> they never change after they have been built."
>>
>> To me, it sounds like the ideal solution to package/make/build
>> management in general and Cabal/Hackage/Cabal-install in particular.
>> After all, compilation is just a _pure_ function
>>
>>   compile :: Source -> Dependencies -> Object
>>
>> So, the suggestion is to use Nix for Hackage/Cabal. This way, we get
>> package installation/deinstallation for free. I didn't look into  
>> it, but
>> it seems that the package description language can express most  
>> content
>> from .cabal files and I guess that it even eliminates the need for  
>> most
>> of Cabal's functionality like finding compilers and such.
>
> I was under the impression that it didn't work on Windows. From  
> another
> quick look at the website, it looks like that's right. Does anybody
> happen to know otherwise?

It does in fact work under Windows. However, it currently depends on
cygwin for most of its building infrastructure. This is not fundamental
to the system, fortunately. There is just too little manpower behind it
to lift it from its Linuxy start...

Oh, and Daan Leijen seems to have written something about the same
subject for some reason or another.

With regards, Arthur van Leeuwen. (Who has forwarded the initial mail
        to Eelco Dolstra, designer of Nix, to see if he wants to chime in)

--

   /\    / |       [hidden email]       | Work like you don't need  
the money
/__\  /  | A friend is someone with whom | Love like you have never  
been hurt
/    \/__ | you can dare to be yourself   | Dance like there's nobody  
watching



_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Nix for Hackage/Cabal

Marc Weber
In reply to this post by Duncan Coutts
> > of Cabal's functionality like finding compilers and such.
> I was under the impression that it didn't work on Windows. From another
> quick look at the website, it looks like that's right. Does anybody
> happen to know otherwise?

It actually does. I've managed to compile it.
You have one major problem when trying to install nix from source on
windows: You need another lex/ bison version. I've already proposed
adding the parser files to the svn repository so that this problem would
be gone. I didn't check that this already has happened.
GHC is not yet supported on windows. But adding the binary installer
shouldn't be hard.

On windows there are some minor quirks with symlinks. And you need NTFS
(fat32 doesn't work)..

each package description (it's called derivation) has an property
builder. This is a script which sources another basch script defining
default targets (unpack, build, ...). But you can specify any other
executable to do the build task.

Beeing totally pure means also that you have to download a lot of
packages more than once (linux header files glibc etc ...)
Because nix won't use the ones beeing installed by your system.
This doesn't matter as you can use NixOs. I think more than one
developper is using NixOS as main os. But you will have to hack a lot to
get what you already have.. (I think. I haven't tried yet)..

I'm currently working on moving all hackagedb packages to nix with
automatic dependency resolving.
I already have list of package descriptions from the hackage site which
looks roughly like this (thus each package chooses which dependencies it
needs by selector functions filtering the whole hackage package list by
itself..)


<start list>
  ({ cabaldeps=[
  ({descr="base"; filter_func=d : ("base" == d.id.name);})
  ({descr="parsec"; filter_func=d : ("parsec" == d.id.name);})
  ({descr="mtl"; filter_func=d : ("mtl" == d.id.name);})
  ({descr="template-haskell"; filter_func=d : ("template_haskell" == d.id.name);}) ];
 name="harpy";
 src="http://hackage.haskell.org/packages/archive/harpy/0.2/harpy-0.2.tar.gz";
 version=[(0) (2) ];
})
....
<end list>

The cool thing: You can not only automatically download/ compile
dependencies but also distribute the packages and update by
automatically generated binary diffs (you should read the nix manual to
get more accurate information because I still feel like a noob).

I'll post another message to the nix dev list so that the main
developpers can give a more accurate status report if they wish.

Marc Weber
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe