librelist archives

« back to archive

Proposed: keg-only brews are exempt from "cleanup"

Proposed: keg-only brews are exempt from "cleanup"

From:
Adam Vandenberg
Date:
2011-03-11 @ 04:53
While waiting for a more comprehensive solution for updating keg-only
brews (and I'm not convinced that the refactor branch solves all the
issues here), I propose that keg-only brews be exempt from "brew
cleanup".

So if I have readline 6.0, 6.1, and 6.2 all installed, "brew cleanup"
will NOT try to remove older ones, since it is keg-only, and things I
have installed will be linking directly to a versioned cellar path.

This change will let us accept some keg-only stuff that could stand to
be updated (readline, gettext) without causing people to have to
rebrew a ton of stuff all of a sudden, as happened with Readline 6.1
was merged in.

Thoughts?

Re: [homebrew] Proposed: keg-only brews are exempt from "cleanup"

From:
Camillo
Date:
2011-03-13 @ 00:33
On 11/mar/2011, at 05.53, Adam Vandenberg wrote:

> While waiting for a more comprehensive solution for updating keg-only
> brews (and I'm not convinced that the refactor branch solves all the
> issues here), I propose that keg-only brews be exempt from "brew
> cleanup".
> 
> So if I have readline 6.0, 6.1, and 6.2 all installed, "brew cleanup"
> will NOT try to remove older ones, since it is keg-only, and things I
> have installed will be linking directly to a versioned cellar path.
> 
> This change will let us accept some keg-only stuff that could stand to
> be updated (readline, gettext) without causing people to have to
> rebrew a ton of stuff all of a sudden, as happened with Readline 6.1
> was merged in.
> 
> Thoughts?

We should do this instead:

Let's say you're installing formula xyz version 1.2. Ordinarily you'd make
the installation prefix Cellar/xyz/1.2, but for keg-only formulas that's a
problem, because then dependencies refer to that version-specific path. 
So, instead, we create the directory Cellar/xyz/1.2 and a symlink 
Cellar/xyz/current -> 1.2; then we install xyz with prefix 
Cellar/xyz/current. This way, the install names of the libraries, together
with any other paths that may be saved during installation (eg paths to 
configuration files) all refer to the version-agnostic path 
Cellar/xyz/current.

When we build formula zyx, which depends on xyz, we add Cellar/xyz/current
to the appropriate paths (instead of Cellar/xyz/1.2), so we are sure that 
zyx also points to the version-agnostic path (thus covering things other 
than libraries).
When xyz 1.3 is released, we simply create the empty directory 
Cellar/xyz/1.3, point the symlink Cellar/xyz/current to 1.3, and again 
install with prefix Cellar/xyz/current. Since zyx was linking to 
Cellar/zyx/current/lib/libxyz.dylib and the new version of the library is 
still available at that path, everything keeps working.

Camillo

Re: [homebrew] Proposed: keg-only brews are exempt from "cleanup"

From:
Max Howell
Date:
2011-03-13 @ 13:46
I proposed something like this several times. We sort of plan it.

But adding CURRENT to the keg is a no go. Too much stuff depends on kegs 
in racks only being viable versions, not dupes or symlinks.

But we can stick that symlink somewhere else.
On Sunday, 13 March 2011 at 00:33, Camillo wrote: 
> On 11/mar/2011, at 05.53, Adam Vandenberg wrote:
> 
> > While waiting for a more comprehensive solution for updating keg-only
> > brews (and I'm not convinced that the refactor branch solves all the
> > issues here), I propose that keg-only brews be exempt from "brew
> > cleanup".
> > 
> > So if I have readline 6.0, 6.1, and 6.2 all installed, "brew cleanup"
> > will NOT try to remove older ones, since it is keg-only, and things I
> > have installed will be linking directly to a versioned cellar path.
> > 
> > This change will let us accept some keg-only stuff that could stand to
> > be updated (readline, gettext) without causing people to have to
> > rebrew a ton of stuff all of a sudden, as happened with Readline 6.1
> > was merged in.
> > 
> > Thoughts?
> 
> We should do this instead:
> 
> Let's say you're installing formula xyz version 1.2. Ordinarily you'd 
make the installation prefix Cellar/xyz/1.2, but for keg-only formulas 
that's a problem, because then dependencies refer to that version-specific
path. So, instead, we create the directory Cellar/xyz/1.2 and a symlink 
Cellar/xyz/current -> 1.2; then we install xyz with prefix 
Cellar/xyz/current. This way, the install names of the libraries, together
with any other paths that may be saved during installation (eg paths to 
configuration files) all refer to the version-agnostic path 
Cellar/xyz/current.
> 
> When we build formula zyx, which depends on xyz, we add 
Cellar/xyz/current to the appropriate paths (instead of Cellar/xyz/1.2), 
so we are sure that zyx also points to the version-agnostic path (thus 
covering things other than libraries).
> When xyz 1.3 is released, we simply create the empty directory 
Cellar/xyz/1.3, point the symlink Cellar/xyz/current to 1.3, and again 
install with prefix Cellar/xyz/current. Since zyx was linking to 
Cellar/zyx/current/lib/libxyz.dylib and the new version of the library is 
still available at that path, everything keeps working.
> 
> Camillo
> 

Re: [homebrew] Proposed: keg-only brews are exempt from "cleanup"

From:
Mike McQuaid
Date:
2011-03-14 @ 10:39
On 13 March 2011 13:46, Max Howell <max@methylblue.com> wrote:
> I proposed something like this several times. We sort of plan it.
> But adding CURRENT to the keg is a no go. Too much stuff depends on kegs in
> racks only being viable versions, not dupes or symlinks.
> But we can stick that symlink somewhere else.

I'd rather we try and exhaust the install_name_tool options first
before hacking around with symlinks. This is exactly what
install_name_tool is designed for and if we run it on all executables
there shouldn't be any of these keg-only problems any more and we get
to keep our current elegant layout.

-- 
Mike McQuaid
http://mikemcquaid.com

Re: [homebrew] Proposed: keg-only brews are exempt from "cleanup"

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

> I proposed something like this several times. We sort of plan it.
> 
> But adding CURRENT to the keg is a no go. Too much stuff depends on kegs
in racks only being viable versions, not dupes or symlinks.
> 
> But we can stick that symlink somewhere else.

Good! Let's do it, then. Last time I suggested this (jan. 1) I was 
thinking of $prefix/share/homebrew/keg_only/xyz as an alternate location 
for the symlink (I assume a location inside Cellar has the same problems 
as one inside the keg). Would that work?

As an aside, if changing the directory layout of kegs requires changes in 
more than one place, that means the code could use a bit of refactoring. 
There should be a single place that tells homebrew what versions of a keg 
are installed, which one is active, and so on. That would also allow 
formulas to check for known incompatible versions of dependencies, and 
present the user with advice (something I've wanted to do before).

Camillo

Re: [homebrew] Proposed: keg-only brews are exempt from "cleanup"

From:
Adam Vandenberg
Date:
2011-03-13 @ 18:16
How about: /usr/local/Cellar/PrivateReserve <- link the current
keg-onlys in to new folders under there.

On Sun, Mar 13, 2011 at 11:12 AM, Camillo <camillo.lists@gmail.com> wrote:
> On 13/mar/2011, at 14.46, Max Howell wrote:
>
>> I proposed something like this several times. We sort of plan it.
>>
>> But adding CURRENT to the keg is a no go. Too much stuff depends on 
kegs in racks only being viable versions, not dupes or symlinks.
>>
>> But we can stick that symlink somewhere else.
>
> Good! Let's do it, then. Last time I suggested this (jan. 1) I was 
thinking of $prefix/share/homebrew/keg_only/xyz as an alternate location 
for the symlink (I assume a location inside Cellar has the same problems 
as one inside the keg). Would that work?
>
> As an aside, if changing the directory layout of kegs requires changes 
in more than one place, that means the code could use a bit of 
refactoring. There should be a single place that tells homebrew what 
versions of a keg are installed, which one is active, and so on. That 
would also allow formulas to check for known incompatible versions of 
dependencies, and present the user with advice (something I've wanted to 
do before).
>
> Camillo
>

Re: [homebrew] Proposed: keg-only brews are exempt from "cleanup"

From:
Charlie Sharpsteen
Date:
2011-03-13 @ 19:24
On Sun, Mar 13, 2011 at 11:16 AM, Adam Vandenberg <flangy@gmail.com> wrote:

> How about: /usr/local/Cellar/PrivateReserve <- link the current
> keg-onlys in to new folders under there.


I like the name, but would it cause problems having a directory in Cellar
that is not a keg?  Lots of Homebrew assumes that `ls /usr/local/Cellar`
returns a list of kegs and nothing but kegs.

Re: [homebrew] Proposed: keg-only brews are exempt from "cleanup"

From:
Max Howell
Date:
2011-03-11 @ 10:28
Agreed.

Of course the final solution is to know installed dependencies and I have 
a solution for that that doesn't increase the complexity of Homebrew loads
like other PM systems do. 
On Friday, 11 March 2011 at 04:53, Adam Vandenberg wrote:
While waiting for a more comprehensive solution for updating keg-only
> brews (and I'm not convinced that the refactor branch solves all the
> issues here), I propose that keg-only brews be exempt from "brew
> cleanup".
> 
> So if I have readline 6.0, 6.1, and 6.2 all installed, "brew cleanup"
> will NOT try to remove older ones, since it is keg-only, and things I
> have installed will be linking directly to a versioned cellar path.
> 
> This change will let us accept some keg-only stuff that could stand to
> be updated (readline, gettext) without causing people to have to
> rebrew a ton of stuff all of a sudden, as happened with Readline 6.1
> was merged in.
> 
> Thoughts?
> 

Re: [homebrew] Proposed: keg-only brews are exempt from "cleanup"

From:
Dreamcat4
Date:
2011-03-11 @ 09:24
Is there still going to be some other command to list / remove old
kegs? Even just a file listing of those outdated keg directories could
be easily piped into find / rm. So as long as theres some provisions
elsewhere for that - then I agree with you.

On Fri, Mar 11, 2011 at 4:53 AM, Adam Vandenberg <flangy@gmail.com> wrote:
> While waiting for a more comprehensive solution for updating keg-only
> brews (and I'm not convinced that the refactor branch solves all the
> issues here), I propose that keg-only brews be exempt from "brew
> cleanup".
>
> So if I have readline 6.0, 6.1, and 6.2 all installed, "brew cleanup"
> will NOT try to remove older ones, since it is keg-only, and things I
> have installed will be linking directly to a versioned cellar path.
>
> This change will let us accept some keg-only stuff that could stand to
> be updated (readline, gettext) without causing people to have to
> rebrew a ton of stuff all of a sudden, as happened with Readline 6.1
> was merged in.
>
> Thoughts?
>