Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 721088

Summary: [Future EAPI] Don't export A
Product: Gentoo Hosted Projects Reporter: Ulrich Müller <ulm>
Component: PMS/EAPIAssignee: PMS/EAPI <pms>
Status: RESOLVED INVALID    
Severity: normal CC: esigra, mgorny
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=719202
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 174380    

Description Ulrich Müller gentoo-dev 2020-05-05 13:26:22 UTC
Variables exported to the environment are limited to MAX_ARG_STRLEN of Linux, which is 128 KiB. In the case of A this can be a problem for ebuilds with many distfiles.
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2020-05-05 13:48:41 UTC
We should probably make a clear definitive list of which variables are exported and which are not.  We could also kill A altogether, I suppose it's only needed as a convenience variable for default_src_unpack.
Comment 2 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2020-05-05 18:37:17 UTC
Let me expand on this.  In my opinion, having A as 'defined but not exported' is against the principle of the least surprise.  This is something people will simply miss or get wrong.  Someone implementing a PM on top of this is most likely not to care much whether A is exported or not, and fall into the same trap.

In the end, changing this doesn't really solve the problem.  It merely shifts the claim from 'ebuild is making unreasonable assumptions' to 'package manager author did not read our fine print'.  The end result is the same -- instead of making it easier to write compatible and reliable PMs, PMS just serves as an excuse to justify whatever implementation Portage achieved after working around hundred of issues.

In my opinion, this isn't worth the effort.  What we should do instead is set a tree policy preventing this issue from happening again.  We can change PMS to indicate that exporting it is *optional* but saying it *must not* be exported is just asking people to stand head down.
Comment 3 Zac Medico gentoo-dev 2020-05-26 04:59:42 UTC
(In reply to Michał Górny from comment #1)
> We could also kill A altogether, I suppose it's
> only needed as a convenience variable for default_src_unpack.

If we specify that DISTDIR is supposed to contain exactly those files which should be unpacked, then that suffices, and allows us to avoid the need to specify an unexported variable.
Comment 4 Ulrich Müller gentoo-dev 2020-05-26 07:05:07 UTC
(In reply to Zac Medico from comment #3)
> (In reply to Michał Górny from comment #1)
> > We could also kill A altogether, I suppose it's
> > only needed as a convenience variable for default_src_unpack.
> 
> If we specify that DISTDIR is supposed to contain exactly those files which
> should be unpacked, then that suffices, and allows us to avoid the need to
> specify an unexported variable.

unpack ${A} is very common and very convenient. So I guess if the package manager won't define A any longer, then ebuilds would either start defining it themselves, or do horrible things like globbing inside ${DISTDIR}.
Comment 5 Ulrich Müller gentoo-dev 2021-06-05 10:10:40 UTC
(In reply to Michał Górny from comment #2)

Closing.