librelist archives

« back to archive

incorrect permissions after brew install

incorrect permissions after brew install

From:
Jason Lewis
Date:
2011-09-19 @ 06:05
Hi,

I've been working on a formula to build mythtv and I'm having an issue
with some files being installed with incorrect permissions.

my formula is here:
https://raw.github.com/jasonblewis/homebrew/master/Library/Formula/mythtv.rb


If I do:  brew unlink mythtv;  brew install -force -vd mythtv

the install proceeds until it gets to:
INSTALL mythffplay
INSTALL install-libs
Error: #<BuildError: Failed executing: make install >
/usr/local/Library/Homebrew/formula.rb:522:in `system'
/usr/local/Library/Formula/mythtv.rb:57:in `install'
/usr/local/Library/Homebrew/build.rb:74:in `install'
/usr/local/Library/Homebrew/formula.rb:264:in `brew'
/usr/local/Library/Homebrew/formula.rb:591:in `stage'
/usr/local/Library/Homebrew/formula.rb:542:in `mktemp'
/usr/local/Library/Homebrew/formula.rb:589:in `stage'
/usr/local/Library/Homebrew/formula.rb:259:in `brew'
/usr/local/Library/Homebrew/build.rb:53:in `install'
/usr/local/Library/Homebrew/build.rb:27
/usr/local/Library/Formula/mythtv.rb:62
==> Rescuing build...
When you exit this shell Homebrew will attempt to finalise the installation.
If nothing is installed or the shell exits with a non-zero error code,
Homebrew will abort. The installation prefix is:
/usr/local/Cellar/mythtv/0.24.1
.bash_profile



now in the terminal, I do a make -j1 install:
INSTALL mythffmpeg
INSTALL mythffplay
INSTALL install-libs
make[1]: Leaving directory

`/private/tmp/homebrew-mythtv-0.24.1-Rz82/MythTV-mythtv-8f865a6/mythtv/external/FFmpeg'
make -C bindings/perl install INSTALL_ROOT=
make[1]: Entering directory

`/private/tmp/homebrew-mythtv-0.24.1-Rz82/MythTV-mythtv-8f865a6/mythtv/bindings/perl'
make[2]: Entering directory

`/private/tmp/homebrew-mythtv-0.24.1-Rz82/MythTV-mythtv-8f865a6/mythtv/bindings/perl'
make[2]: Leaving directory

`/private/tmp/homebrew-mythtv-0.24.1-Rz82/MythTV-mythtv-8f865a6/mythtv/bindings/perl'
make -f Makefile.perl pure_install PREFIX="/usr/local/Cellar/mythtv/0.24.1"
make[2]: Entering directory

`/private/tmp/homebrew-mythtv-0.24.1-Rz82/MythTV-mythtv-8f865a6/mythtv/bindings/perl'
Can't open file

/usr/local/Cellar/mythtv/0.24.1/lib/site_perl/5.14.0/darwin-2level/auto/MythTV/.packlist:
Permission denied at
/Users/jason/perl5/perlbrew/perls/perl-5.14.0/lib/5.14.0/ExtUtils/Install.pm
line 846
make[2]: *** [pure_site_install] Error 13
make[2]: Leaving directory

`/private/tmp/homebrew-mythtv-0.24.1-Rz82/MythTV-mythtv-8f865a6/mythtv/bindings/perl'
make[1]: *** [install] Error 2
make[1]: Leaving directory

`/private/tmp/homebrew-mythtv-0.24.1-Rz82/MythTV-mythtv-8f865a6/mythtv/bindings/perl'
make: *** [bindings/perl_install] Error 2
make: Leaving directory
`/private/tmp/homebrew-mythtv-0.24.1-Rz82/MythTV-mythtv-8f865a6/mythtv'


looking at that file:

jason@woodhouse:/private/tmp/homebrew-mythtv-0.24.1-Rz82/MythTV-mythtv-8f865a6/mythtv$
ls -l

/usr/local/Cellar/mythtv/0.24.1/lib/site_perl/5.14.0/darwin-2level/auto/MythTV/.packlist
-r--r--r--  1 jason  wheel  432 Sep 19 14:54

/usr/local/Cellar/mythtv/0.24.1/lib/site_perl/5.14.0/darwin-2level/auto/MythTV/.packlist

it's obvious that it can't write the .packlist due to it being read
only, but I cannot work out why it would be created with those permissions.


according to make, the command in question is:
/Users/jason/perl5/perlbrew/perls/perl-5.14.0/bin/perl
-MExtUtils::Install -e 'install([ from_to => {@ARGV}, verbose =>
'\''0'\'', uninstall_shadows => '\''0'\'', dir_mode => '\''755'\'' ]);' -- \
                read

/Users/jason/perl5/perlbrew/perls/perl-5.14.0/lib/site_perl/5.14.0/darwin-2level/auto/MythTV/.packlist
\
                write

/usr/local/Cellar/mythtv/0.24.1/lib/site_perl/5.14.0/darwin-2level/auto/MythTV/.packlist
\
                blib/lib
/usr/local/Cellar/mythtv/0.24.1/lib/site_perl/5.14.0 \
                blib/arch
/usr/local/Cellar/mythtv/0.24.1/lib/site_perl/5.14.0/darwin-2level \
                blib/bin /usr/local/Cellar/mythtv/0.24.1/bin \
                blib/script /usr/local/Cellar/mythtv/0.24.1/bin \
                blib/man1 /usr/local/Cellar/mythtv/0.24.1/man/man1 \
                blib/man3 /usr/local/Cellar/mythtv/0.24.1/man/man3


if I chmod that file 644 then the above command works with no error. and
then after that, make followed by make install seems to run fine. in
fact if I delete the offending file and do a make; make install, it
works fine. it seems as though it gets the incorrect permissions when
make/make install is run from the brew script, but not when i run the
make/make install from the command line.

Any ideas how I can determine why the .packlist file is being created
with the wrong permissions? or how I might work around this? or get more
verbose output from brew that might give me some clues?

Thanks,

Jason

PS. This is my first brew formula and also my first experience with
ruby. I'm really liking both of them.

Re: [homebrew] incorrect permissions after brew install

From:
Jason Lewis
Date:
2011-09-19 @ 07:34
Jason Lewis wrote:
> Hi,
>
> I've been working on a formula to build mythtv and I'm having an issue
> with some files being installed with incorrect permissions.

To answer my own question. it appears as though you need to do a brew
uninstall before doing a new brew install of the same formula.

I was not doing this and I think that was causing me grief.

Jason

Re: [homebrew] incorrect permissions after brew install

From:
Max Howell
Date:
2011-09-19 @ 09:52
>> I've been working on a formula to build mythtv and I'm having an issue
>> with some files being installed with incorrect permissions.
> 
> To answer my own question. it appears as though you need to do a brew
> uninstall before doing a new brew install of the same formula.
> 
> I was not doing this and I think that was causing me grief.

Yes it can break, it won't always though, depends on the build script in 
question. But it can, hence the --force being required in these cases.