On Sat, 28 Aug 2021, Michał Górny wrote:
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
On Sat, Aug 28, 2021 at 06:35:06PM +0200, Michał Górny wrote:
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:
...
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.
I would go with 1 and 2 b, but I also propose another option for the
next eapi which may be a bit controversial.
Starting with eapi 9, make export_functions a noop (you can't remove it
until all eclasses/ebuilds only support eapis that don't require it).
I understand that this is controversial, because it would require a lot
of work to convert ebuilds to eapi 9, but it would eliminate this ambiguity/inconsistency in the future because it would require all
ebuilds to have phase functions unless they can use the default phases
the eapis provide.
Thoughts?
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:
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
On Sat, Aug 28, 2021 at 06:35:06PM +0200, Michał Górny wrote:
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:
...
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.
I would go with 1 and 2 b, but I also propose another option for the
next eapi which may be a bit controversial.
Starting with eapi 9, make export_functions a noop (you can't remove it
until all eclasses/ebuilds only support eapis that don't require it).
I understand that this is controversial, because it would require a lot
of work to convert ebuilds to eapi 9, but it would eliminate this ambiguity/inconsistency in the future because it would require all
ebuilds to have phase functions unless they can use the default phases
the eapis provide.
Thoughts?
On Sun, Aug 29, 2021 at 12:23:22PM -0500, William Hubbs wrote:
On Sat, Aug 28, 2021 at 06:35:06PM +0200, Michał Górny wrote:
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:
...
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.
I would go with 1 and 2 b, but I also propose another option for the
next eapi which may be a bit controversial.
Starting with eapi 9, make export_functions a noop (you can't remove it until all eclasses/ebuilds only support eapis that don't require it).
I understand that this is controversial, because it would require a lot
of work to convert ebuilds to eapi 9, but it would eliminate this ambiguity/inconsistency in the future because it would require all
ebuilds to have phase functions unless they can use the default phases
the eapis provide.
Thoughts?
If anything I'd personally prefer the rough opposite of this, in the
event multiple eclass export the same, have the package manager merge
them.
e.g. rather than have `inherit cmake xdg` run xdg_src_prepare over
cmake's, would export:
src_prepare() {
cmake_src_prepare
xdg_src_prepare
}
unless the ebuild redefines it (which I imagine would often be because
of optional support, e.g. use lua &&, or occasional incompatibilities)
Some ebuilds have special needs, but then there's all those generic
ebuilds that should stay nearly empty.
On 29 Aug 2021, at 19:44, Michał Górny <mgorny@gentoo.org> wrote:
On Sun, 2021-08-29 at 14:41 -0400, Ionen Wolkens wrote:
[snip]
If anything I'd personally prefer the rough opposite of this, in the
event multiple eclass export the same, have the package manager merge
them.
e.g. rather than have `inherit cmake xdg` run xdg_src_prepare over
cmake's, would export:
src_prepare() {
cmake_src_prepare
xdg_src_prepare
}
unless the ebuild redefines it (which I imagine would often be because
of optional support, e.g. use lua &&, or occasional incompatibilities)
Some ebuilds have special needs, but then there's all those generic
ebuilds that should stay nearly empty.
What about transitive inherits? Say, foo.eclass inherits bar.eclass.
Does that imply that the ebuild calls foo_src_prepare
and bar_src_prepare, and the eclass has no way of overriding this? What
if the eclass needs bar_src_prepare called explicitly before or after
its own src_prepare?
On 29 Aug 2021, at 19:41, Ionen Wolkens <ionen@gentoo.org> wrote:
On Sun, Aug 29, 2021 at 12:23:22PM -0500, William Hubbs wrote:
On Sat, Aug 28, 2021 at 06:35:06PM +0200, Michał Górny wrote:
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:
...
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.
I would go with 1 and 2 b, but I also propose another option for the
next eapi which may be a bit controversial.
Starting with eapi 9, make export_functions a noop (you can't remove it
until all eclasses/ebuilds only support eapis that don't require it).
I understand that this is controversial, because it would require a lot
of work to convert ebuilds to eapi 9, but it would eliminate this
ambiguity/inconsistency in the future because it would require all
ebuilds to have phase functions unless they can use the default phases
the eapis provide.
Thoughts?
If anything I'd personally prefer the rough opposite of this, in the
event multiple eclass export the same, have the package manager merge
them.
e.g. rather than have `inherit cmake xdg` run xdg_src_prepare over
cmake's, would export:
src_prepare() {
cmake_src_prepare
xdg_src_prepare
}
unless the ebuild redefines it (which I imagine would often be because
of optional support, e.g. use lua &&, or occasional incompatibilities)
Some ebuilds have special needs, but then there's all those generic
ebuilds that should stay nearly empty.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 475 |
Nodes: | 16 (2 / 14) |
Uptime: | 20:00:48 |
Calls: | 9,487 |
Calls today: | 6 |
Files: | 13,617 |
Messages: | 6,121,093 |