Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Gentoo Development (http://www.linux-archive.org/gentoo-development/)
-   -   write to filesystem in pkg_pretend (http://www.linux-archive.org/gentoo-development/541036-write-filesystem-pkg_pretend.html)

Michał Górny 06-17-2011 04:36 PM

write to filesystem in pkg_pretend
 
On Fri, 17 Jun 2011 18:25:21 +0200
Torsten Veller <ml-en@veller.net> wrote:

> * justin <jlec@gentoo.org>:
> > Now using the new pkg_pretend for EAPI=4
>
> While T is defined in all phases, PMS also says that "pkg_pretend must
> not write to the filesystem".
>
> Is it allowed to write to T or not? Can the specs be clearer if it's
> allowed?

No, it's not allowed. pkg_pretend() should work without creating
the ebuild temporary dirs. But that's only my PoV.

--
Best regards,
Michał Górny

Ulrich Mueller 06-17-2011 04:42 PM

write to filesystem in pkg_pretend
 
>>>>> On Fri, 17 Jun 2011, Torsten Veller wrote:

> While T is defined in all phases, PMS also says that "pkg_pretend
> must not write to the filesystem".

> Is it allowed to write to T or not? Can the specs be clearer if it's
> allowed?

"Must not write to the filesystem" seems to be very clear to me.

Ulrich

Mike Frysinger 06-17-2011 05:18 PM

write to filesystem in pkg_pretend
 
On Friday, June 17, 2011 12:25:21 Torsten Veller wrote:
> * justin <jlec@gentoo.org>:
> > Now using the new pkg_pretend for EAPI=4
>
> While T is defined in all phases, PMS also says that "pkg_pretend must
> not write to the filesystem".
>
> Is it allowed to write to T or not? Can the specs be clearer if it's
> allowed?

sounds like a good reason to use emktemp as that'll utilize /tmp for files
when $T is unavailable

or just drop EAPI=4 support ;)
-mike

Petteri Rty 06-18-2011 11:18 AM

write to filesystem in pkg_pretend
 
On 17.06.2011 20:18, Mike Frysinger wrote:
> On Friday, June 17, 2011 12:25:21 Torsten Veller wrote:
>> * justin <jlec@gentoo.org>:
>>> Now using the new pkg_pretend for EAPI=4
>>
>> While T is defined in all phases, PMS also says that "pkg_pretend must
>> not write to the filesystem".
>>
>> Is it allowed to write to T or not? Can the specs be clearer if it's
>> allowed?
>
> sounds like a good reason to use emktemp as that'll utilize /tmp for files
> when $T is unavailable
>

That approach would still write to the filesystem. With the current text
the PM is probably allowed to set the sandbox so that writing is
anywhere is denied.

Regards,
Petteri

justin 06-18-2011 12:18 PM

write to filesystem in pkg_pretend
 
On 18/06/11 13:18, Petteri Rty wrote:
> On 17.06.2011 20:18, Mike Frysinger wrote:
>> On Friday, June 17, 2011 12:25:21 Torsten Veller wrote:
>>> * justin <jlec@gentoo.org>:
>>>> Now using the new pkg_pretend for EAPI=4
>>>
>>> While T is defined in all phases, PMS also says that "pkg_pretend must
>>> not write to the filesystem".
>>>
>>> Is it allowed to write to T or not? Can the specs be clearer if it's
>>> allowed?
>>
>> sounds like a good reason to use emktemp as that'll utilize /tmp for files
>> when $T is unavailable
>>
>
> That approach would still write to the filesystem. With the current text
> the PM is probably allowed to set the sandbox so that writing is
> anywhere is denied.
>
> Regards,
> Petteri
>

The reason why it would be beneficial to use is the pkg_pretend phase is
simply that the checks would run at the beginning of a emerge and it
would fail directly instead somewhere in the middle. For a single
package it won't change much but for a huge emerge it changes the things.

But when there is no writing allowed during the pretend phase. then the
only chance is to move it to pkg_setup.

thanks for clarification.

Ulrich Mueller 06-18-2011 12:57 PM

write to filesystem in pkg_pretend
 
>>>>> On Sat, 18 Jun 2011, justin wrote:

> On 18/06/11 13:18, Petteri Rty wrote:
>> That approach would still write to the filesystem. With the current
>> text the PM is probably allowed to set the sandbox so that writing
>> is anywhere is denied.

> The reason why it would be beneficial to use is the pkg_pretend
> phase is simply that the checks would run at the beginning of a
> emerge and it would fail directly instead somewhere in the middle.
> For a single package it won't change much but for a huge emerge it
> changes the things.

> But when there is no writing allowed during the pretend phase. then
> the only chance is to move it to pkg_setup.

I wonder if we could loosen up that requirement in PMS. In Portage
at least, T seems to point to an existing directory in pkg_pretend.
I don't know about the other package managers though.

Ulrich

Ciaran McCreesh 06-18-2011 01:08 PM

write to filesystem in pkg_pretend
 
On Sat, 18 Jun 2011 14:18:28 +0200
justin <jlec@gentoo.org> wrote:
> The reason why it would be beneficial to use is the pkg_pretend phase
> is simply that the checks would run at the beginning of a emerge and
> it would fail directly instead somewhere in the middle. For a single
> package it won't change much but for a huge emerge it changes the
> things.

Hang on... What happens if someone doesn't have a fortran compiler
installed, but installs one and then installs a fortran-using package
all as part of the same group of packages? Then your pkg_pretend will
fail incorrectly.

Also, you appear to be assuming that environment variable saving
carries over from pkg_pretend to later phases. It doesn't.

--
Ciaran McCreesh

justin 06-18-2011 01:30 PM

write to filesystem in pkg_pretend
 
On 18/06/11 15:08, Ciaran McCreesh wrote:
> On Sat, 18 Jun 2011 14:18:28 +0200
> justin <jlec@gentoo.org> wrote:
>> The reason why it would be beneficial to use is the pkg_pretend phase
>> is simply that the checks would run at the beginning of a emerge and
>> it would fail directly instead somewhere in the middle. For a single
>> package it won't change much but for a huge emerge it changes the
>> things.
>
> Hang on... What happens if someone doesn't have a fortran compiler
> installed, but installs one and then installs a fortran-using package
> all as part of the same group of packages? Then your pkg_pretend will
> fail incorrectly.

That's a serious reason to go to pkg_Setup, which ends the discusion.
thanks.

>
> Also, you appear to be assuming that environment variable saving
> carries over from pkg_pretend to later phases. It doesn't.
>

If I get it correctly the pretend phase is also executed when the
individual packages gets emerged not only when the emerge of multiple
packages is started. But the original intention of everything is that
user can do FC=myFortranCompiler emerge foo. And there the FC will be
preserved for every package.

Thanks justin


All times are GMT. The time now is 07:53 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.