public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] The inherit-EXPORT_FUNCTIONS ordering problem
@ 2021-08-28 16:35 Michał Górny
  2021-08-28 17:27 ` Ulrich Mueller
  2021-08-29 17:23 ` William Hubbs
  0 siblings, 2 replies; 8+ messages in thread
From: Michał Górny @ 2021-08-28 16:35 UTC (permalink / raw
  To: gentoo-dev

Hi,

I've been informed of a slight inconsistency in package manager behavior
that affects combining EXPORT_FUNCTIONS with inherit (by ionic, thanks
for the report!).  Please consider the three following snippets:

xdg.eclass:

  EXPORT_FUNCTIONS src_prepare

ecm-1.eclass:

  inherit xdg
  EXPORT_FUNCTIONS src_prepare

ecm-2.eclass:

  EXPORT_FUNCTIONS src_prepare
  inherit xdg


Now, ecm-1.eclass produces consistent behavior across all PMs --
ecm-1_src_prepare takes precedence.  However, ecm-2.eclass is not
consistent:

- Portage will take ecm-2_src_prepare, i.e. applies precedence based
on inherit order and not actual call order

- PkgCore and Paludis will take xdg_src_prepare since its
EXPORT_FUNCTIONS are called later (since the inherit is done later).

Apparently, the Portage behavior was changed in 2009 [1].  PMS is not
very clear on what should happen.


Therefore:

1. I'd like to propose that we explicitly require all inherits to happen
before EXPORT_FUNCTIONS.  This will ensure consistent behavior across
all package managers.

2. I'd like to ask your opinion whether we should:

a. revert the Portage behavior to be consistent with PkgCore/Paludis

b. update PMS to identify the behavior as 'undefined', i.e. either
solution is correct.


WDYT?


[1] https://github.com/gentoo/portage/commit/06d4433e8b8be60d606733b9e23f57f8a5869d8f

-- 
Best regards,
Michał Górny




^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-08-29 18:58 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-08-28 16:35 [gentoo-dev] The inherit-EXPORT_FUNCTIONS ordering problem Michał Górny
2021-08-28 17:27 ` Ulrich Mueller
2021-08-29 17:23 ` William Hubbs
2021-08-29 17:40   ` Michał Górny
2021-08-29 18:41   ` Ionen Wolkens
2021-08-29 18:44     ` Sam James
2021-08-29 18:44     ` Michał Górny
2021-08-29 18:57       ` Sam James

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox