Re: [gentoo-dev] rfc: $PROPERTIES, $FEATURES and pms
> On Mon, 18 May 2020, William Hubbs wrote: > I have been acting as a backup maintainer for dev-vcs/cli. A pull > request was opened today that changes the way we detect whether the > ebuild is live from looking for "live" in $PROPERTIES to the version > number [1]. > A different dev referred me to PMS which indicates that ebuilds should > not rely on $PROPERTIES for anything [2]. PMS says that ebuilds may not rely on any package manager support for PROPERTIES. That doesn't prevent them (or eclasses) from assigning tokens to it, and of course it is perfectly legal to check for such tokens later in the ebuild. That said, current practice is to check for in PV. Maybe ebuilds could check for "live" in PROPERTIES instead, but presumably that should be discussed in gentoo-dev first and made a general policy if it would be accepted. > I see quite a few ebuilds in the tree checking $FEATURES however, > which imo is even less reliable since $FEATURES is not specified > anywhere in pms and the $FEATURES variable is portage-specific. > I guess I'm looking for consistency. If we are going to allow > $FEATURES to be checked, should we allow $PROPERTIES to be checked? > Or, should we ban checking both of them? > IMO if we allow $FEATURES to be checked, we really should reword PMS > to not say anything about $PROPERTIES other than to define the tokens > it can contain. In my understanding, ebuilds really shouldn't check FEATURES. If they do it nevertheless (sometime there's no other way), then there should be a non-catastrophic fallback. Ulrich > [1] https://github.com/gentoo/gentoo/pull/15851 > [2] https://dev.gentoo.org/~ulm/pms/head/pms.html#x1-670007.3.5 signature.asc Description: PGP signature
Re: [gentoo-dev] rfc: $PROPERTIES, $FEATURES and pms
On Sun, May 17, 2020 at 7:44 PM William Hubbs wrote: > > All, > > I have been acting as a backup maintainer for dev-vcs/cli. A pull > request was opened today that changes the way we detect whether the > ebuild is live from looking for "live" in $PROPERTIES to the version > number [1]. > > A different dev referred me to PMS which indicates that ebuilds should > not rely on $PROPERTIES for anything [2]. That's not what PMS says, and I think you are misinterpreting it. > I see quite a few ebuilds in the tree checking $FEATURES however, which > imo is even less reliable since $FEATURES is not specified anywhere in pms > and the $FEATURES variable is portage-specific. We don't really support checking FEATURES officially. It's a last-resort when no better option presents itself. > I guess I'm looking for consistency. If we are going to allow > $FEATURES to be checked, should we allow $PROPERTIES to be checked? Or, > should we ban checking both of them? Inspecting PROPERTIES is technically fine, but seems fairly useless to me. Its value is defined in ebuild code, so there's no "new" information to be gained from it. The code in dev-vcs/cli is broken: the "has" function takes a value list as separate arguments, but the ebuild is passing a single string to it. It is also done inconsistently: On line 10, it checks ${PV} == *, and then switches to checking ${PROPERTIES} later in the ebuild. I think it is better to use the same logic in both places.