librelist archives

« back to archive

A modest packaging-microformat proposal

A modest packaging-microformat proposal

From:
Max Howell
Date:
2011-03-13 @ 13:38
I would like to propose the following: 

Open Source projects are invited to place homebrew.formula.rb in their 
tarballs. Thus projects can be installed thusly:

brew install http://example.com/tarball-0.1.tgz

Homebrew can download the tarball and extract the formula and then build 
the project.

Now, authors are invited to tell us they have done this. If we trust the 
maintainer sufficiently we will add a URL alias to our database. So for 
example, we trust the Node guys, so if they decided to maintain their own 
formula and we were happy with that then they add the following to their 
index page:

<link rel="homebrew" href="http://nodejs.org/node-0.4.2.tar.gz" />

And `brew install node` will in fact read the microformat at nodejs.org to
figure out what to do.

In the interest of improving packaging for future generations lets SPECIFY
precisely what a packaging version can be. I suggest:

[0-9]+\.[0-9]+(\.[0-9]+)?[a-z]

There are advantages to placing the formula *in* the tarball. For 
instance, if the formula has to be updated, then the tarball has to have 
its version bumped, so we no longer have cases where the formula is 
changed but the actual software it builds has the same version, removing 
ambiguity.

This naturally leads us to starting to create a specification for Linux 
and Windows builds that can be placed in this platform agnostic 
homebrew.formula that is placed in the tarball. HOWEVER, lets not think 
about that yet, eh?

Thoughts?

Max 

Re: [homebrew] A modest packaging-microformat proposal

From:
Camillo
Date:
2011-03-13 @ 18:28
On 13/mar/2011, at 14.38, Max Howell wrote:

> I would like to propose the following:
> 
> Open Source projects are invited to place homebrew.formula.rb in their 
tarballs. Thus projects can be installed thusly:
> 
> brew install http://example.com/tarball-0.1.tgz
> 
> Homebrew can download the tarball and extract the formula and then build
the project.
> 
> Now, authors are invited to tell us they have done this. If we trust the
maintainer sufficiently we will add a URL alias to our database. So for 
example, we trust the Node guys, so if they decided to maintain their own 
formula and we were happy with that then they add the following to their 
index page:

What happens if I don't like the way the upstream developer has set things
up, and want to have my own version of the formula?

In fact, if the upstream is capable of making a correct Mac install, 
they'll set up configure (or cmake or whatever else they use, but most of 
the time it'll be autotools) to do the install right; then all homebrew 
needs is the boilerplate "configure, make, make install" formula. It 
doesn't make sense for the upstream to keep a broken configure and include
a custom formula to work around it.

Then let's assume the upstream can't make a correct Mac install 
themselves, and needs help from a third party. Asking them to include a 
homebrew formula as a contribution they don't maintain makes it extremely 
likely that they'll ship tarballs with a broken formula without realizing 
it. I think the human oversight involved in making formulas is an 
advantage of homebrew, not something to be avoided.

> <link rel="homebrew" href="http://nodejs.org/node-0.4.2.tar.gz" />
> 
> And `brew install node` will in fact read the microformat at nodejs. org
to figure out what to do.
> 
> In the interest of improving packaging for future generations lets 
SPECIFY precisely what a packaging version can be. I suggest:
> 
> [0-9]+\.[0-9]+(\.[0-9]+)?[a-z]

I doubt projects are going to change their existing version number schemes
for this.

> There are advantages to placing the formula *in* the tarball. For 
instance, if the formula has to be updated, then the tarball has to have 
its version bumped, so we no longer have cases where the formula is 
changed but the actual software it builds has the same version, removing 
ambiguity.

If a formula is changed when the upstream tarball hasn't, it means there 
were bugs in the formula. What you're saying is "no formula fixes until 
upstream releases a new version". You can enforce that rule in your 
repository without building it into the architecture.

> This naturally leads us to starting to create a specification for Linux 
and Windows builds that can be placed in this platform agnostic 
homebrew.formula that is placed in the tarball. HOWEVER, lets not think 
about that yet, eh?

What do Linux and Windows people have to gain from this? Linux people have
package managers in their distros; Windows people have binary installers 
with uninstallers.

Camillo

Re: [homebrew] A modest packaging-microformat proposal

From:
Mike McQuaid
Date:
2011-03-14 @ 11:13
On 13 March 2011 18:28, Camillo <camillo.lists@gmail.com> wrote:
> What happens if I don't like the way the upstream developer has set 
things up, and want to have my own version of the formula?

What happens if you don't like the way the current Homebrew
contributors set things up? Same argument really.

> In fact, if the upstream is capable of making a correct Mac install, 
they'll set up configure (or cmake or whatever else they use, but most of 
the time it'll be autotools) to do the install right; then all homebrew 
needs is the boilerplate "configure, make, make install" formula. It 
doesn't make sense for the upstream to keep a broken configure and include
a custom formula to work around it.

Agreed.

> Then let's assume the upstream can't make a correct Mac install 
themselves, and needs help from a third party. Asking them to include a 
homebrew formula as a contribution they don't maintain makes it extremely 
likely that they'll ship tarballs with a broken formula without realizing 
it. I think the human oversight involved in making formulas is an 
advantage of homebrew, not something to be avoided.

Agreed here. It sounds like this idea is to partly save us time but
I'm not convinced it will do so if they ship a new version which
breaks it for all Homebrew users and we have to clean up the mess.
This is basically the situation we already have with HEAD-only builds
and I don't really like it. We're putting the QA process for certain
formulae in the hands of others and if e.g. their webserver gets
hacked then they can deliver whatever they want to any Homebrew users
machine.

> I doubt projects are going to change their existing version number 
schemes for this.

Agreed.

> If a formula is changed when the upstream tarball hasn't, it means there
were bugs in the formula. What you're saying is "no formula fixes until 
upstream releases a new version". You can enforce that rule in your 
repository without building it into the architecture.

Agreed.

> What do Linux and Windows people have to gain from this? Linux people 
have package managers in their distros; Windows people have binary 
installers with uninstallers.

Agreed. Also, this is basically what is already done with some
DPKG/RPM packages and generally they are ignored by distributions who
need to do things a different way.

I do like the sentiment behind this idea, I'm just not convinced it's
workable in practise.

-- 
Mike McQuaid
http://mikemcquaid.com

Re: [homebrew] A modest packaging-microformat proposal

From:
Adam Vandenberg
Date:
2011-03-13 @ 16:37
As a side note, I have projects that include a Bash script to do a diy
installer: https://github.com/adamv/figit/blob/master/installer/diy

On Sun, Mar 13, 2011 at 6:38 AM, Max Howell <max@methylblue.com> wrote:
> I would like to propose the following:
> Open Source projects are invited to place homebrew.formula.rb in their
> tarballs. Thus projects can be installed thusly:
> brew install http://example.com/tarball-0.1.tgz
> Homebrew can download the tarball and extract the formula and then build the
> project.
> Now, authors are invited to tell us they have done this. If we trust the
> maintainer sufficiently we will add a URL alias to our database. So for
> example, we trust the Node guys, so if they decided to maintain their own
> formula and we were happy with that then they add the following to their
> index page:
> <link rel="homebrew" href="http://nodejs.org/node-0.4.2.tar.gz" />
> And `brew install node` will in fact read the microformat at nodejs. org to
> figure out what to do.
> In the interest of improving packaging for future generations lets SPECIFY
> precisely what a packaging version can be. I suggest:
> [0-9]+\.[0-9]+(\.[0-9]+)?[a-z]
> There are advantages to placing the formula *in* the tarball. For instance,
> if the formula has to be updated, then the tarball has to have its version
> bumped, so we no longer have cases where the formula is changed but the
> actual software it builds has the same version, removing ambiguity.
> This naturally leads us to starting to create a specification for Linux and
> Windows builds that can be placed in this platform agnostic homebrew.formula
> that is placed in the tarball. HOWEVER, lets not think about that yet, eh?
> Thoughts?
> Max