On 28-07-2022 19:57:50 +0200, Arfrever Frehtes Taifersar Arahesis wrote:
> 2022-07-28 17:47 UTCに、Fabian Groffen <grob...@gentoo.org>は書いた:
> > bin/isolated-functions.sh does the following bit:
> >
> > if [[ -z ${USERLAND} ]] ; then
> >    case $(uname -s) in
> >    *BSD|DragonFly)
> >        export USERLAND="BSD"
> >        ;;
> >    *)
> >        export USERLAND="GNU"
> >        ;;
> >    esac
> > fi
> >
> > (after which it uses USERLAND for a single purpose, to export XARGS to
> > either GNU '[g]xargs -r', or BSD 'xargs')
> >
> > This bit is problematic for Prefix, because Prefix may run on *BSD, but
> > use USERLAND=GNU.
> 
> But this code starts with 'if [[ -z ${USERLAND} ]]', so it should not
> be run when USERLAND="GNU".
> 
> USERLAND="GNU" is set in make.defaults, which is parsed by Portage
> early (at Python side) and these values are passed by Portage to
> ebuild.sh subprocess.

Hmmm, that would be nice, features/prefix/make.defaults includes setting
that.

Makes me still wonder why we do this, is it a fallback for when the
profiles aren't available (no tree yet) or something?

It exports XARGS, which only used in the ___parallel_xargs function.
That function in turn is used in 2 places.  So all this stuff is done to
add -r to xargs if xargs isn't BSD xargs.  Iow --no-run-if-empty, which
is cool, but apparently not strictly necessary (fugly warning I guess at
worst).  We're already checking xargs to support --max-procs=, so we
could in the same go check for support of --no-run-if-empty, and drop
the whole XARGS thing and declutter the code quite a lot :)

Thanks,
Fabian

-- 
Fabian Groffen
Gentoo on a different level

Attachment: signature.asc
Description: PGP signature

Reply via email to