Re: [gentoo-dev] The future of ebuild

2008-02-25 Thread Sebastian Volke
On Monday 25 February 2008 11:59:35 Jakub Moc wrote:
> While we are switching the whole tree to Nix, I'd strongly advocate that:
>
> 1/ All ebuilds must be rewritten in whitespace [1]; that will have the
> great side-effect that all those pesky whitespace repoman checks will
> start to be meaningful finally.
>
> 2/ All eclasses must be rewritten in Piet [2] at the same time, so that
> we make dev's life a bit more colorful once the former step. is
> finished. There is already a platform-independent IDE ready for this
> purpose after all [3].
>
> Since the benefits of the above are so obvious, I suppose this doesn't
> even require a GLEP and the porting work should therefore start
> immediately to make it in time for 2008.0.
>

Nice "mockery" :-)


-- 
*Sebastian Volke*
registered Linux user #426550

mail address: echo [EMAIL PROTECTED] | perl -pe 'y/a-z/v-za-w/'

If your mail client doesn't support GPG signatures, please ignore this
little "signature.asc" file.


signature.asc
Description: This is a digitally signed message part.


Re: [gentoo-dev] The future of ebuild

2008-02-25 Thread Jakub Moc

Santiago M. Mola napsal(a):

This is not going to happen. "Migrating to Nix" means "rewriting the
distro from scratch".  If you´re interested in a distro built on top
of Nix, you can try NixOS (which looks really nice IMO).

Regards,
Santiago


While we are switching the whole tree to Nix, I'd strongly advocate that:

1/ All ebuilds must be rewritten in whitespace [1]; that will have the 
great side-effect that all those pesky whitespace repoman checks will 
start to be meaningful finally.


2/ All eclasses must be rewritten in Piet [2] at the same time, so that 
we make dev's life a bit more colorful once the former step. is 
finished. There is already a platform-independent IDE ready for this 
purpose after all [3].


Since the benefits of the above are so obvious, I suppose this doesn't 
even require a GLEP and the porting work should therefore start 
immediately to make it in time for 2008.0.


Have a nice day. :P

[1] http://compsoc.dur.ac.uk/whitespace/
[2] http://en.wikipedia.org/wiki/Piet_(programming_language)
[3] http://www.rapapaing.com/piet/


--
Best regards,

 Jakub Moc
 mailto:[EMAIL PROTECTED]
 GPG signature:
 http://subkeys.pgp.net:11371/pks/lookup?op=get&search=0xCEBA3D9E
 Primary key fingerprint: D2D7 933C 9BA1 C95B 2C95  B30F 8717 D5FD CEBA 
3D9E


 ... still no signature   ;)


--
gentoo-dev@lists.gentoo.org mailing list



Re: [gentoo-dev] The future of ebuild

2008-02-24 Thread Alec Warner
On 2/24/08, Felipe Contreras <[EMAIL PROTECTED]> wrote:
> On Sat, Feb 23, 2008 at 10:45 PM, Alec Warner <[EMAIL PROTECTED]> wrote:
>  > On 2/20/08, Felipe Contreras <[EMAIL PROTECTED]> wrote:
>
> >  >  b) Error are difficult to handle since bash doesn't have exceptions
>  >
>  >  I disagree here: most errors are fatal anyway any non fatal errors can
>  >  be printed and saved via the elog facility.
>
>
> Yes, for the most common usage that's true, but that think about this
>  example: I'm compiling gstreamer-plugins-good, which needs libraw1394,
>  but the compilation fails, perhaps that user is not interested in that
>  particular plugin so a dialog can pop up and the user can choose if to
>  continue without the libraw stuff or fail.
>
>  I'm sure that can be done without exceptions but as the complexity
>  increases properly checking/passing around error values/messages
>  becomes tedious.

This has nothing to do with the build system and everything to do with
the package manager actually processing information provided.

>
>
>  >  >  c) Persistent information is difficult to achieve (no database stuff)
>  >
>  >  How is this a bash limitation?  Most languages don't have 'database
>  >  stuff' built in.
>  >  I don't see how saving stuff to files is much different than the env
>  >  dumping we do in bash?
>
>
> I guess it's mostly the burden of serializing/parsing all that stuff.

But the code is written already...

>
>
>  >  >  A more featured language could allow for example: filtered output,
>  >  >  exception handling->state storage->resuming.
>  >  >
>  >  >  But the big deal is with the package definition, recently I learned
>  >  >  about Domain Specific Languages, and I think that is the best option.
>  >  >
>  >  >  A new dsl allows many interesting features in the package definition
>  >  >  itself like: inheritance, exceptions, arrays, hash tables, objects,
>  >  >  modules, documentation, information messages, etc.
>  >
>  >  Note that most languages allow for the same things...so why would we
>  >  author our own language?  What runtime would it use?
>
>
> The language can be something very simple that has bash embedded. That
>  has the advantage that you can just copy paste what you are doing
>  already.
>
>  As more ideas appear the DSL can be updated, but still, the embedded
>  bash would always be there.
>
>  
>
> >  >  This is based on an already working prototype made in Ruby, so it's
>  >  >  biased towards Ruby facilities.
>  >
>  >  It looks Rakish ;)
>
>
> Perhaps, the only interesting thing here is that those commands are
>  not defined internally. There's an auxiliary bash shell that is
>  running those commands. Not like "system" calls, which loose the
>  environment between calls, this is something that cooperates nicely.
>
>
>  >  >  I've tried different build systems: rpm, dpkg, autopackage.
>  >  >  Unfortunately I never tried ebuild because it was based on bash as far
>  >  >  as I could tell.
>  >
>  >  Typically a 'build system' would refer to 'autotools' or 'ant' or
>  >  'setuptools' not an ebuild.
>
>
> Is there such a big difference?
>
>  I'm sure it's possible to by-pass autotools and write down all the
>  commands required to build something in an ebuild. Similarly it's
>  possible to use autotools to compile and install a bunch of packages.
>
>  Those "build systems" also need to be updated, but that's another story.

Updating for the sake of 'stuff being old' is not a compelling case.

>
>
>  >  >  After almost a decade of using Linux I still haven't found a build
>  >  >  system that suits all my needs. AFAIK ebuild is the most advanced but
>  >  >  it's still relying on ancient technology (bash scripts) so there will
>  >  >  always be limitations despite the brilliant ideas.
>  >
>  >  Bash is not 'ancient' and it works suprisingly well for the vast
>  >  majority of cases.  I realize using a high level language would
>  >  probably make some tasks easier (mmm dicts and real arrays).  There is
>  >  the matter of porting over 1 ebuilds however ;)
>
>
> Yeah, bash is pretty good for many things, just doesn't scale that much.
>
>  At some point someone decided the current status was not good enough
>  and decided to create ebuild, even though he was well aware that
>  thousands of already existing instructions about how to build packages
>  would have to be re-written.
>
>  If it's easy to write people will possibly even write more of those.
>  Take for example ArchLinux which also has around 10,000 packages
>  simply because it's so easy to write them.
>
>  And with something that is distribution agnostic, different
>  communities can benefit from sharing the same rules.

What is 'distribution agnostic'?

Technically most things are; rpm is used by many distros and is
basically similar to what we have (phases, a meta language used to
move files around, bad dependencies).  So is a debian rules file.  How
are these 'distro specific'?

>
>
>  >  >
>  >  >  The

Re: [gentoo-dev] The future of ebuild

2008-02-24 Thread Duncan Coutts

On Sun, 2008-02-24 at 13:02 +0200, Felipe Contreras wrote:

> >  Take a look at Nix. It's a distribution-agnostic package manager that
> >  uses a purely functional DSL for package specifications.
> >  http://nix.cs.uu.nl/index.html
> 
> That's exactly what I'm taking about :) I'll try it out. Thanks for
> sharing the link.
> 
> Is there any interest in the Gentoo community to migrate to Nix?

It's quite a radical departure and requires more accurate information
about packages. We'll see how the NixOS people get on.

-- 
Duncan Coutts : Gentoo Developer (Haskell team)

-- 
gentoo-dev@lists.gentoo.org mailing list



Re: [gentoo-dev] The future of ebuild

2008-02-24 Thread Santiago M. Mola
On Sun, Feb 24, 2008 at 12:02 PM, Felipe Contreras
<[EMAIL PROTECTED]> wrote:
> On Thu, Feb 21, 2008 at 2:29 PM, Duncan Coutts <[EMAIL PROTECTED]> wrote:
> >  >
> >  > Why not create a new build system with a state of the art programming
> >  > language, and an advanced DSL that actually other distributions could
> >  > use?
> >  >
> >  > I would like to hear your opinions on this matter.
> >
> >  Take a look at Nix. It's a distribution-agnostic package manager that
> >  uses a purely functional DSL for package specifications.
> >  http://nix.cs.uu.nl/index.html
>
> That's exactly what I'm taking about :) I'll try it out. Thanks for
> sharing the link.
>
> Is there any interest in the Gentoo community to migrate to Nix?
>

This is not going to happen. "Migrating to Nix" means "rewriting the
distro from scratch".  If you´re interested in a distro built on top
of Nix, you can try NixOS (which looks really nice IMO).

Regards,
Santiago

-- 
Santiago M. Mola
Jabber ID: [EMAIL PROTECTED]
���^�X�����(��&j)b�b�

Re: [gentoo-dev] The future of ebuild

2008-02-24 Thread Luis Francisco Araujo

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Felipe Contreras wrote:
| On Sat, Feb 23, 2008 at 10:45 PM, Alec Warner <[EMAIL PROTECTED]> wrote:
|> On 2/20/08, Felipe Contreras <[EMAIL PROTECTED]> wrote:
|>  >  b) Error are difficult to handle since bash doesn't have exceptions
|>
|>  I disagree here: most errors are fatal anyway any non fatal errors can
|>  be printed and saved via the elog facility.
|
| Yes, for the most common usage that's true, but that think about this
| example: I'm compiling gstreamer-plugins-good, which needs libraw1394,
| but the compilation fails, perhaps that user is not interested in that
| particular plugin so a dialog can pop up and the user can choose if to
| continue without the libraw stuff or fail.
|
| I'm sure that can be done without exceptions but as the complexity
| increases properly checking/passing around error values/messages
| becomes tedious.
|

That's what USE flags are for.

- --

Luis F. Araujo "araujo at gentoo.org"
Gentoo Linux

-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.7 (GNU/Linux)

iD8DBQFHwbyIBCmRZan6aegRArK/AJ9wBvqPZ9PErpxiVHgpkSLuCZIixQCdGiEB
wvdMli4taTHJFVBoHYIzyLs=
=/1k7
-END PGP SIGNATURE-
--
gentoo-dev@lists.gentoo.org mailing list



Re: [gentoo-dev] The future of ebuild

2008-02-24 Thread Felipe Contreras
On Sat, Feb 23, 2008 at 10:45 PM, Alec Warner <[EMAIL PROTECTED]> wrote:
> On 2/20/08, Felipe Contreras <[EMAIL PROTECTED]> wrote:
>  >  b) Error are difficult to handle since bash doesn't have exceptions
>
>  I disagree here: most errors are fatal anyway any non fatal errors can
>  be printed and saved via the elog facility.

Yes, for the most common usage that's true, but that think about this
example: I'm compiling gstreamer-plugins-good, which needs libraw1394,
but the compilation fails, perhaps that user is not interested in that
particular plugin so a dialog can pop up and the user can choose if to
continue without the libraw stuff or fail.

I'm sure that can be done without exceptions but as the complexity
increases properly checking/passing around error values/messages
becomes tedious.

>  >  c) Persistent information is difficult to achieve (no database stuff)
>
>  How is this a bash limitation?  Most languages don't have 'database
>  stuff' built in.
>  I don't see how saving stuff to files is much different than the env
>  dumping we do in bash?

I guess it's mostly the burden of serializing/parsing all that stuff.

>  >  A more featured language could allow for example: filtered output,
>  >  exception handling->state storage->resuming.
>  >
>  >  But the big deal is with the package definition, recently I learned
>  >  about Domain Specific Languages, and I think that is the best option.
>  >
>  >  A new dsl allows many interesting features in the package definition
>  >  itself like: inheritance, exceptions, arrays, hash tables, objects,
>  >  modules, documentation, information messages, etc.
>
>  Note that most languages allow for the same things...so why would we
>  author our own language?  What runtime would it use?

The language can be something very simple that has bash embedded. That
has the advantage that you can just copy paste what you are doing
already.

As more ideas appear the DSL can be updated, but still, the embedded
bash would always be there.


>  >  This is based on an already working prototype made in Ruby, so it's
>  >  biased towards Ruby facilities.
>
>  It looks Rakish ;)

Perhaps, the only interesting thing here is that those commands are
not defined internally. There's an auxiliary bash shell that is
running those commands. Not like "system" calls, which loose the
environment between calls, this is something that cooperates nicely.

>  >  I've tried different build systems: rpm, dpkg, autopackage.
>  >  Unfortunately I never tried ebuild because it was based on bash as far
>  >  as I could tell.
>
>  Typically a 'build system' would refer to 'autotools' or 'ant' or
>  'setuptools' not an ebuild.

Is there such a big difference?

I'm sure it's possible to by-pass autotools and write down all the
commands required to build something in an ebuild. Similarly it's
possible to use autotools to compile and install a bunch of packages.

Those "build systems" also need to be updated, but that's another story.

>  >  After almost a decade of using Linux I still haven't found a build
>  >  system that suits all my needs. AFAIK ebuild is the most advanced but
>  >  it's still relying on ancient technology (bash scripts) so there will
>  >  always be limitations despite the brilliant ideas.
>
>  Bash is not 'ancient' and it works suprisingly well for the vast
>  majority of cases.  I realize using a high level language would
>  probably make some tasks easier (mmm dicts and real arrays).  There is
>  the matter of porting over 1 ebuilds however ;)

Yeah, bash is pretty good for many things, just doesn't scale that much.

At some point someone decided the current status was not good enough
and decided to create ebuild, even though he was well aware that
thousands of already existing instructions about how to build packages
would have to be re-written.

If it's easy to write people will possibly even write more of those.
Take for example ArchLinux which also has around 10,000 packages
simply because it's so easy to write them.

And with something that is distribution agnostic, different
communities can benefit from sharing the same rules.

>  >
>  >  The core of a distribution is the "packaging" system, and the core of
>  >  the packaging system is the building system, which has no reason not
>  >  to be distribution agnostic, and actually, packaging system agnostic.
>  >
>  >  Why not create a new build system with a state of the art programming
>  >  language, and an advanced DSL that actually other distributions could
>  >  use?
>
>  I would talk to Drobbins, he was talking about something like this to
>  manage complexity.

Will do.

Best regards.

-- 
Felipe Contreras
-- 
gentoo-dev@lists.gentoo.org mailing list



Re: [gentoo-dev] The future of ebuild

2008-02-24 Thread Felipe Contreras
On Thu, Feb 21, 2008 at 2:29 PM, Duncan Coutts <[EMAIL PROTECTED]> wrote:
>
>  On Wed, 2008-02-20 at 22:40 +0200, Felipe Contreras wrote:
>
>  > The core of a distribution is the "packaging" system, and the core of
>  > the packaging system is the building system, which has no reason not
>  > to be distribution agnostic, and actually, packaging system agnostic.
>  >
>  > Why not create a new build system with a state of the art programming
>  > language, and an advanced DSL that actually other distributions could
>  > use?
>  >
>  > I would like to hear your opinions on this matter.
>
>  Take a look at Nix. It's a distribution-agnostic package manager that
>  uses a purely functional DSL for package specifications.
>  http://nix.cs.uu.nl/index.html

That's exactly what I'm taking about :) I'll try it out. Thanks for
sharing the link.

Is there any interest in the Gentoo community to migrate to Nix?

Best regards.

-- 
Felipe Contreras
-- 
gentoo-dev@lists.gentoo.org mailing list



Re: [gentoo-dev] The future of ebuild

2008-02-23 Thread Alec Warner
On 2/23/08, Alec Warner <[EMAIL PROTECTED]> wrote:
> On 2/20/08, Felipe Contreras <[EMAIL PROTECTED]> wrote:
>  > Hi gentooists,
>  >
>  >  I've been reading news sites about some changes happening in Gentoo
>  >  and I thought it might be a good time to submit some ideas I've been
>  >  baking for several years.
>  >
>  >  I come from a Linux From Scratch background, I like the feeling of
>  >  knowing every single corner of my system and the fact that there isn't
>  >  anything that I don't want or need. However, typing every single
>  >  command by hand is far from ideal, so at first I started writing some
>  >  scripts and eventually I wrote a build system that suited my needs. I
>  >  did it in bash for several reasons.
>  >
>  >  After a while I realized bash wasn't exactly the best language to
>  >  write such thing. Mainly because:
>  >
>  >  a) The code ends up with a lot of stuff for handling strings properly
>  >  (like escaping sequences)
>
>
> Yes this is annoying
>
>
>  >  b) Error are difficult to handle since bash doesn't have exceptions
>
>
> I disagree here: most errors are fatal anyway any non fatal errors can
>  be printed and saved via the elog facility.
>
>
>  >  c) Persistent information is difficult to achieve (no database stuff)
>
>
> How is this a bash limitation?  Most languages don't have 'database
>  stuff' built in.
>  I don't see how saving stuff to files is much different than the env
>  dumping we do in bash?

Er, I meant saving stuff to databases ;)

>
>
>  >  d) Package information is difficult to fetch/store (no objects/struct)
>
>
> Yes.
>
>
>  >
>  >  A more featured language could allow for example: filtered output,
>  >  exception handling->state storage->resuming.
>  >
>  >  But the big deal is with the package definition, recently I learned
>  >  about Domain Specific Languages, and I think that is the best option.
>  >
>  >  A new dsl allows many interesting features in the package definition
>  >  itself like: inheritance, exceptions, arrays, hash tables, objects,
>  >  modules, documentation, information messages, etc.
>
>
> Note that most languages allow for the same things...so why would we
>  author our own language?  What runtime would it use?
>
>
>  >
>  >  Take this example:
>  >
>  >  package Binutils < Gnu
>  >   definition
>  > @version = "2.17"
>  > @name = "binutils"
>  > super() # run the Gnu definition stuff
>  >
>  > @config_opts = "--disable-nls --with-sysroot=\"#{$sys_root}\"
>  >  --enable-shared --disable-multilib"
>  >   end
>  >
>  >   steps
>  > build
>  >   cd #{$top_build_dir}
>  >   mkdir -p [EMAIL PROTECTED]
>  >   cd [EMAIL PROTECTED]
>  >   :configure "script" => "../[EMAIL PROTECTED]/configure", "opts" => 
> @config_opts
>  >   make configure-host
>  >   make
>  > end
>  >
>  > install
>  >   cd #{$top_build_dir}
>  >   cd [EMAIL PROTECTED]
>  >   make install
>  > end
>  >   end
>  >  end
>  >
>  >  This is based on an already working prototype made in Ruby, so it's
>  >  biased towards Ruby facilities.
>
>
> It looks Rakish ;)
>
>
>  >
>  >  I've tried different build systems: rpm, dpkg, autopackage.
>  >  Unfortunately I never tried ebuild because it was based on bash as far
>  >  as I could tell.
>
>
> Typically a 'build system' would refer to 'autotools' or 'ant' or
>  'setuptools' not an ebuild.
>
>
>  >
>  >  After almost a decade of using Linux I still haven't found a build
>  >  system that suits all my needs. AFAIK ebuild is the most advanced but
>  >  it's still relying on ancient technology (bash scripts) so there will
>  >  always be limitations despite the brilliant ideas.
>
>
> Bash is not 'ancient' and it works suprisingly well for the vast
>  majority of cases.  I realize using a high level language would
>  probably make some tasks easier (mmm dicts and real arrays).  There is
>  the matter of porting over 1 ebuilds however ;)
>
>
>  >
>  >  The core of a distribution is the "packaging" system, and the core of
>  >  the packaging system is the building system, which has no reason not
>  >  to be distribution agnostic, and actually, packaging system agnostic.
>  >
>  >  Why not create a new build system with a state of the art programming
>  >  language, and an advanced DSL that actually other distributions could
>  >  use?
>
>
> I would talk to Drobbins, he was talking about something like this to
>  manage complexity.
>
>
>  >
>  >  I would like to hear your opinions on this matter.
>  >
>  >  --
>  >  Felipe Contreras
>  >
>  > --
>  >  gentoo-dev@lists.gentoo.org mailing list
>  >
>  >
>
-- 
gentoo-dev@lists.gentoo.org mailing list



Re: [gentoo-dev] The future of ebuild

2008-02-23 Thread Alec Warner
On 2/20/08, Felipe Contreras <[EMAIL PROTECTED]> wrote:
> Hi gentooists,
>
>  I've been reading news sites about some changes happening in Gentoo
>  and I thought it might be a good time to submit some ideas I've been
>  baking for several years.
>
>  I come from a Linux From Scratch background, I like the feeling of
>  knowing every single corner of my system and the fact that there isn't
>  anything that I don't want or need. However, typing every single
>  command by hand is far from ideal, so at first I started writing some
>  scripts and eventually I wrote a build system that suited my needs. I
>  did it in bash for several reasons.
>
>  After a while I realized bash wasn't exactly the best language to
>  write such thing. Mainly because:
>
>  a) The code ends up with a lot of stuff for handling strings properly
>  (like escaping sequences)

Yes this is annoying

>  b) Error are difficult to handle since bash doesn't have exceptions

I disagree here: most errors are fatal anyway any non fatal errors can
be printed and saved via the elog facility.

>  c) Persistent information is difficult to achieve (no database stuff)

How is this a bash limitation?  Most languages don't have 'database
stuff' built in.
I don't see how saving stuff to files is much different than the env
dumping we do in bash?

>  d) Package information is difficult to fetch/store (no objects/struct)

Yes.

>
>  A more featured language could allow for example: filtered output,
>  exception handling->state storage->resuming.
>
>  But the big deal is with the package definition, recently I learned
>  about Domain Specific Languages, and I think that is the best option.
>
>  A new dsl allows many interesting features in the package definition
>  itself like: inheritance, exceptions, arrays, hash tables, objects,
>  modules, documentation, information messages, etc.

Note that most languages allow for the same things...so why would we
author our own language?  What runtime would it use?

>
>  Take this example:
>
>  package Binutils < Gnu
>   definition
> @version = "2.17"
> @name = "binutils"
> super() # run the Gnu definition stuff
>
> @config_opts = "--disable-nls --with-sysroot=\"#{$sys_root}\"
>  --enable-shared --disable-multilib"
>   end
>
>   steps
> build
>   cd #{$top_build_dir}
>   mkdir -p [EMAIL PROTECTED]
>   cd [EMAIL PROTECTED]
>   :configure "script" => "../[EMAIL PROTECTED]/configure", "opts" => 
> @config_opts
>   make configure-host
>   make
> end
>
> install
>   cd #{$top_build_dir}
>   cd [EMAIL PROTECTED]
>   make install
> end
>   end
>  end
>
>  This is based on an already working prototype made in Ruby, so it's
>  biased towards Ruby facilities.

It looks Rakish ;)

>
>  I've tried different build systems: rpm, dpkg, autopackage.
>  Unfortunately I never tried ebuild because it was based on bash as far
>  as I could tell.

Typically a 'build system' would refer to 'autotools' or 'ant' or
'setuptools' not an ebuild.

>
>  After almost a decade of using Linux I still haven't found a build
>  system that suits all my needs. AFAIK ebuild is the most advanced but
>  it's still relying on ancient technology (bash scripts) so there will
>  always be limitations despite the brilliant ideas.

Bash is not 'ancient' and it works suprisingly well for the vast
majority of cases.  I realize using a high level language would
probably make some tasks easier (mmm dicts and real arrays).  There is
the matter of porting over 1 ebuilds however ;)

>
>  The core of a distribution is the "packaging" system, and the core of
>  the packaging system is the building system, which has no reason not
>  to be distribution agnostic, and actually, packaging system agnostic.
>
>  Why not create a new build system with a state of the art programming
>  language, and an advanced DSL that actually other distributions could
>  use?

I would talk to Drobbins, he was talking about something like this to
manage complexity.

>
>  I would like to hear your opinions on this matter.
>
>  --
>  Felipe Contreras
>
> --
>  gentoo-dev@lists.gentoo.org mailing list
>
>
-- 
gentoo-dev@lists.gentoo.org mailing list



Re: [gentoo-dev] The future of ebuild

2008-02-21 Thread Duncan Coutts

On Wed, 2008-02-20 at 22:40 +0200, Felipe Contreras wrote:

> The core of a distribution is the "packaging" system, and the core of
> the packaging system is the building system, which has no reason not
> to be distribution agnostic, and actually, packaging system agnostic.
> 
> Why not create a new build system with a state of the art programming
> language, and an advanced DSL that actually other distributions could
> use?
> 
> I would like to hear your opinions on this matter.

Take a look at Nix. It's a distribution-agnostic package manager that
uses a purely functional DSL for package specifications.
http://nix.cs.uu.nl/index.html

-- 
Duncan Coutts : Gentoo Developer (Haskell team)

-- 
gentoo-dev@lists.gentoo.org mailing list



[gentoo-dev] The future of ebuild

2008-02-20 Thread Felipe Contreras
Hi gentooists,

I've been reading news sites about some changes happening in Gentoo
and I thought it might be a good time to submit some ideas I've been
baking for several years.

I come from a Linux From Scratch background, I like the feeling of
knowing every single corner of my system and the fact that there isn't
anything that I don't want or need. However, typing every single
command by hand is far from ideal, so at first I started writing some
scripts and eventually I wrote a build system that suited my needs. I
did it in bash for several reasons.

After a while I realized bash wasn't exactly the best language to
write such thing. Mainly because:

a) The code ends up with a lot of stuff for handling strings properly
(like escaping sequences)
b) Error are difficult to handle since bash doesn't have exceptions
c) Persistent information is difficult to achieve (no database stuff)
d) Package information is difficult to fetch/store (no objects/struct)

A more featured language could allow for example: filtered output,
exception handling->state storage->resuming.

But the big deal is with the package definition, recently I learned
about Domain Specific Languages, and I think that is the best option.

A new dsl allows many interesting features in the package definition
itself like: inheritance, exceptions, arrays, hash tables, objects,
modules, documentation, information messages, etc.

Take this example:

package Binutils < Gnu
  definition
@version = "2.17"
@name = "binutils"
super() # run the Gnu definition stuff

@config_opts = "--disable-nls --with-sysroot=\"#{$sys_root}\"
--enable-shared --disable-multilib"
  end

  steps
build
  cd #{$top_build_dir}
  mkdir -p [EMAIL PROTECTED]
  cd [EMAIL PROTECTED]
  :configure "script" => "../[EMAIL PROTECTED]/configure", "opts" => 
@config_opts
  make configure-host
  make
end

install
  cd #{$top_build_dir}
  cd [EMAIL PROTECTED]
  make install
end
  end
end

This is based on an already working prototype made in Ruby, so it's
biased towards Ruby facilities.

I've tried different build systems: rpm, dpkg, autopackage.
Unfortunately I never tried ebuild because it was based on bash as far
as I could tell.

After almost a decade of using Linux I still haven't found a build
system that suits all my needs. AFAIK ebuild is the most advanced but
it's still relying on ancient technology (bash scripts) so there will
always be limitations despite the brilliant ideas.

The core of a distribution is the "packaging" system, and the core of
the packaging system is the building system, which has no reason not
to be distribution agnostic, and actually, packaging system agnostic.

Why not create a new build system with a state of the art programming
language, and an advanced DSL that actually other distributions could
use?

I would like to hear your opinions on this matter.

-- 
Felipe Contreras
-- 
gentoo-dev@lists.gentoo.org mailing list