Gentoo Archives: gentoo-portage-dev

From: Zac Medico <zmedico@g.o>
To: Ulrich Mueller <ulm@g.o>, Zac Medico <zmedico@g.o>
Cc: "Michał Górny" <mgorny@g.o>, gentoo-portage-dev@l.g.o
Subject: Re: [gentoo-portage-dev] [PATCH] config.environ: delay export of A and AA (bug 720180)
Date: Tue, 26 May 2020 19:07:36
Message-Id: 8b483380-edb6-0498-febe-15d912866e00@gentoo.org
In Reply to: Re: [gentoo-portage-dev] [PATCH] config.environ: delay export of A and AA (bug 720180) by Ulrich Mueller
1 On 5/26/20 10:32 AM, Ulrich Mueller wrote:
2 >>>>>> On Tue, 26 May 2020, Zac Medico wrote:
3 >
4 >> On 5/26/20 12:48 AM, Michał Górny wrote:
5 >>> On Mon, 2020-05-25 at 21:31 -0700, Zac Medico wrote:
6 >>>> Since variables like A and AA can contain extremely large values which
7 >>>> may trigger E2BIG errors during attempts to execute subprocesses, delay
8 >>>> export until the last moment, and unexport when appropriate.
9 >>>
10 >>> Please don't. This will only hide the problem from developers who will
11 >>> unknowingly commit broken ebuilds and cause users of alternative package
12 >>> managers to suffer.
13 >
14 >> We've seen in https://bugs.gentoo.org/719202 that developers can already
15 >> do that with existing versions of portage, since the failure can be
16 >> dependent on USE configuration.
17 >
18 > We have seen in bug 719202 that A has exceeded _SC_ARG_MAX which is
19 > 128 KiB.
20 >
21 > However, your commit message mentions E2BIG which will trigger at a much
22 > larger value, namely 2 MiB. We are far away from reaching that limit in
23 > any ebuild.
24 >
25 > These are separate issues (although related), so I think we should make
26 > it very clear about which one we're talking.
27 >
28 > Ulrich
29 >
30 If we want to differentiate between these things then that's fine with me,
31 however, I have not seen an error other than errno 7 which I thought
32 corresponded to E2BIG. Test case:
33
34 $ python -c "import os, subprocess; os.environ['A'] = 131072 * ' '; subprocess.check_call(['echo', 'hello world'])"
35 Traceback (most recent call last):
36 File "<string>", line 1, in <module>
37 File "/usr/lib64/python3.6/subprocess.py", line 306, in check_call
38 retcode = call(*popenargs, **kwargs)
39 File "/usr/lib64/python3.6/subprocess.py", line 287, in call
40 with Popen(*popenargs, **kwargs) as p:
41 File "/usr/lib64/python3.6/subprocess.py", line 729, in __init__
42 restore_signals, start_new_session)
43 File "/usr/lib64/python3.6/subprocess.py", line 1364, in _execute_child
44 raise child_exception_type(errno_num, err_msg, err_filename)
45 OSError: [Errno 7] Argument list too long: 'echo'
46 --
47 Thanks,
48 Zac

Attachments

File name MIME type
signature.asc application/pgp-signature