Gentoo Archives: gentoo-portage-dev

From: Fabian Groffen <grobian@g.o>
To: gentoo-portage-dev@l.g.o
Subject: Re: [gentoo-portage-dev] bin/isolated-functions.sh USERLAND setting
Date: Thu, 28 Jul 2022 18:11:30
Message-Id: YuLRTNcuewKR/mAA@gentoo.org
In Reply to: Re: [gentoo-portage-dev] bin/isolated-functions.sh USERLAND setting by Arfrever Frehtes Taifersar Arahesis
1 On 28-07-2022 19:57:50 +0200, Arfrever Frehtes Taifersar Arahesis wrote:
2 > 2022-07-28 17:47 UTCに、Fabian Groffen <grobian@g.o>は書いた:
3 > > bin/isolated-functions.sh does the following bit:
4 > >
5 > > if [[ -z ${USERLAND} ]] ; then
6 > > case $(uname -s) in
7 > > *BSD|DragonFly)
8 > > export USERLAND="BSD"
9 > > ;;
10 > > *)
11 > > export USERLAND="GNU"
12 > > ;;
13 > > esac
14 > > fi
15 > >
16 > > (after which it uses USERLAND for a single purpose, to export XARGS to
17 > > either GNU '[g]xargs -r', or BSD 'xargs')
18 > >
19 > > This bit is problematic for Prefix, because Prefix may run on *BSD, but
20 > > use USERLAND=GNU.
21 >
22 > But this code starts with 'if [[ -z ${USERLAND} ]]', so it should not
23 > be run when USERLAND="GNU".
24 >
25 > USERLAND="GNU" is set in make.defaults, which is parsed by Portage
26 > early (at Python side) and these values are passed by Portage to
27 > ebuild.sh subprocess.
28
29 Hmmm, that would be nice, features/prefix/make.defaults includes setting
30 that.
31
32 Makes me still wonder why we do this, is it a fallback for when the
33 profiles aren't available (no tree yet) or something?
34
35 It exports XARGS, which only used in the ___parallel_xargs function.
36 That function in turn is used in 2 places. So all this stuff is done to
37 add -r to xargs if xargs isn't BSD xargs. Iow --no-run-if-empty, which
38 is cool, but apparently not strictly necessary (fugly warning I guess at
39 worst). We're already checking xargs to support --max-procs=, so we
40 could in the same go check for support of --no-run-if-empty, and drop
41 the whole XARGS thing and declutter the code quite a lot :)
42
43 Thanks,
44 Fabian
45
46 --
47 Fabian Groffen
48 Gentoo on a different level

Attachments

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

Replies

Subject Author
Re: [gentoo-portage-dev] bin/isolated-functions.sh USERLAND setting Fabian Groffen <grobian@g.o>