Brew does not detect interrupted installs #8555

Closed
knl opened this Issue Nov 12, 2011 · 10 comments

Projects

None yet

7 participants

@knl
knl commented Nov 12, 2011

Hi, a couple of days ago, I did brew up && brew upgrade. This lead to detecting plt-racket as outdated and brew started building new plt-racket 5.2. However, my computer froze during the build, and I had to reboot it.

The issue is that brew reports plt-racket as updated, because /usr/local/Cellar/plt-racket/5.2 exists. However, this directory is not complete, and call to racket results in this:

$ racket 
Welcome to Racket v5.1.3.
>

brew info plt-racket shows the following:

plt-racket 5.2
http://racket-lang.org/
/usr/local/Cellar/plt-racket/5.1.3 (17822 files, 267M)
/usr/local/Cellar/plt-racket/5.2 (12471 files, 127M) *
http://github.com/mxcl/homebrew/commits/master/Library/Formula/plt-racket.rb
@adamv
adamv commented Nov 12, 2011

Possible fix: Homebrew adds a .brewing file to the prefix during installation, rm's it at the very end.

If the .brewing file exists, then the install was interrupted some how.

@jacknagel

@adamv Makes sense.

@knl
knl commented Nov 13, 2011

Yes, something like that would work. Then brew doctor could be used to report such problems.

I remember that MacPorts(?) had a mechanism to log the current phase. If something would go wrong, once you fix it, you would be able to continue from that point.

@mxcl
Member
mxcl commented Mar 7, 2012

Yes, we need something like this in general, since you can currently install the same thing twice simultaneously in different shells. We need a lock for a few operations. I guess install and link/unlink (to prevent simultaneous link and unlink on the same keg which would result in a mess).

@samueljohn

+1

@samhocevar

+1

I just had a build fail because I was using brew from two terminals for two different packages that had a common dependency.

@mxcl
Member
mxcl commented Aug 21, 2012

Exists back to 1.8.6 so we're golden: http://www.ruby-doc.org/core-1.8.6/File.html#method-i-flock

@adamv
adamv commented Jan 31, 2013

Is this closable now that we have the installer lock?

@MikeMcQuaid
Member

Yes, I think so. Reopen if not.

@MikeMcQuaid MikeMcQuaid closed this Feb 1, 2013
@xu-cheng xu-cheng locked and limited conversation to collaborators Feb 16, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.