Summary: | sys-apps/portage no longer installs in prefix (python-utils-r1.eclass relies on BROOT, unset in pkg_preinst) | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Marien Zwart <marien.zwart> |
Component: | Eclasses | Assignee: | Portage team <dev-portage> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | chewi, flow, ionen, python, sam, ulm |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
See Also: |
https://bugs.gentoo.org/show_bug.cgi?id=911574 https://github.com/gentoo/portage/pull/1077 https://github.com/gentoo/portage/pull/1078 |
||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: | build.log (with ECLASS_DEBUG_OUTPUT=on) |
Description
Marien Zwart
2023-08-06 06:42:02 UTC
Created attachment 867189 [details]
build.log (with ECLASS_DEBUG_OUTPUT=on)
This got added to PMS very recently wrt bug #911574, but looks like portage indeed does not set it (yet), so guess portage needs an update if that's effective for old EAPIs too (does feel a bit awkward without being in a new EAPI, considering we now don't know if the PM supports it or not and can't rely on this). Either way, will need a more immediate workaround in the eclass. (In reply to Ionen Wolkens from comment #2) > Either way, will need a more immediate workaround in the eclass. Or portage ebuild? Thinking about it, unsure if calling python_setup in pkg_preinst is considered valid. CC'ing eclass maintainers & committers for now anyhow. Ech, sorry, I didn't realise it wasn't available in all phases. The problem is the old behaviour was also buggy, so this requires a Portage fix either way. Here's a fix. Please could you try it. I don't have a regular prefix handy, only a cross prefix, where this problem doesn't apply. On a side-note, after seeing this bug, ulm did mention: 04:28 <@ulm> ionen: re bug 911797 comment #2, this was added to PMS under the assumption that portage would set BROOT globally 04:29 <@ulm> now I wonder if it should be reverted in PMS, and either restricted to EAPI 8 or postponed to EAPI 9 Also, even if changed in portage, the eclass remains an issue given it's still going to be used by older portage anyway when people update. Hmmm, that is true. In theory, you could base PYTHON on the PATH, but I fear that would break other things. I've realised that the original bug I was trying to fix was actually the same issue from the other side. It was using EPREFIX when it was supposed to use the blank BROOT, but BROOT was totally unset. Thinking that through some more, I guess I could revert my change once the Portage fix is merged. The cross-prefix case is very much less common and is still broken for sys-apps/portage anyway. As I read the EAPI 8 spec (https://projects.gentoo.org/pms/8/pms.html#x1-720008.1), I would conclude from tables 8.1 and 8.2 that BROOT should be defined in the pkg_*inst and pkg_*rm phases if the EAPI supports IDEPEND: - Table 8.1 says that IDEPEND should be satisfied for pkg_preinst, pkg_postinst, pkg_prerm, pkg_postrm (and _only_ these phases). - Table 8.2 lists ${BROOT} for IDEPEND. Updating the BROOT entry in the variables table was effectively overlooked when we added IDEPEND to PMS, leaving the spec in an (IMHO) inconsistent state. The bug has been closed via the following commit(s): https://gitweb.gentoo.org/proj/portage.git/commit/?id=cfa3149797c2204f3a156ec2909c444baa640a6b commit cfa3149797c2204f3a156ec2909c444baa640a6b Author: James Le Cuirot <chewi@gentoo.org> AuthorDate: 2023-08-06 09:40:02 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2023-08-06 22:28:50 +0000 Define BROOT in pkg_* phases following PMS change Closes: https://bugs.gentoo.org/911797 Bug: https://bugs.gentoo.org/911574 Signed-off-by: James Le Cuirot <chewi@gentoo.org> Closes: https://github.com/gentoo/portage/pull/1077 Signed-off-by: Sam James <sam@gentoo.org> NEWS | 3 +++ bin/phase-helpers.sh | 4 ++-- lib/portage/package/ebuild/config.py | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) I can confirm that the fix works for my prefix install (by dropping a patch without the NEWS changes into etc/portage/patches and reinstalling sys-apps/portage-3.0.49-r2) but also (as expected) that I had to temporarily re-revert the python-utils-r1.eclass change so I could install portage with that patch. Reopening, the portage half of this is fixed but prefix users still need that eclass change reverted or the portage ebuild's pkg_preinst changed so they can upgrade. The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=01e4a638c3decc74baa52975043bb4af89ae2c70 commit 01e4a638c3decc74baa52975043bb4af89ae2c70 Author: James Le Cuirot <chewi@gentoo.org> AuthorDate: 2023-08-07 11:59:34 +0000 Commit: James Le Cuirot <chewi@gentoo.org> CommitDate: 2023-08-07 12:09:48 +0000 Revert "python-utils-r1.eclass: Remove old EAPI hack for exporting PYTHON" This reverts commit 9e4dc068a3066434bfbfa3a0f979ec5d6d8020eb. It fixed cross-prefix but inadvertently broke regular prefix. Both were ultimately affected by the same PMS + Portage bug where BROOT was not set in pkg_preinst. This has now been fixed, but regular prefix users need to be able to update Portage without hitting the issue. Cross-prefix users are safe because the BROOT Portage can be updated without hitting the issue. Closes: https://bugs.gentoo.org/911797 Signed-off-by: James Le Cuirot <chewi@gentoo.org> eclass/python-utils-r1.eclass | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (In reply to Larry the Git Cow from comment #10) > The bug has been closed via the following commit(s): > > https://gitweb.gentoo.org/proj/portage.git/commit/ > ?id=cfa3149797c2204f3a156ec2909c444baa640a6b > > commit cfa3149797c2204f3a156ec2909c444baa640a6b > Author: James Le Cuirot <chewi@gentoo.org> > AuthorDate: 2023-08-06 09:40:02 +0000 > Commit: Sam James <sam@gentoo.org> > CommitDate: 2023-08-06 22:28:50 +0000 > > Define BROOT in pkg_* phases following PMS change > > Closes: https://bugs.gentoo.org/911797 > Bug: https://bugs.gentoo.org/911574 > Signed-off-by: James Le Cuirot <chewi@gentoo.org> > Closes: https://github.com/gentoo/portage/pull/1077 > Signed-off-by: Sam James <sam@gentoo.org> > > NEWS | 3 +++ > bin/phase-helpers.sh | 4 ++-- > lib/portage/package/ebuild/config.py | 2 +- > 3 files changed, 6 insertions(+), 3 deletions(-) Maybe this should be adjusted to behave differently for EAPIs that do not support IDEPEND, since PMS was also adjusted as noted in bug 911574 comment #6. (In reply to Zac Medico from comment #13) > Maybe this should be adjusted to behave differently for EAPIs that do not > support IDEPEND, since PMS was also adjusted as noted in bug 911574 comment > #6. Not necessarily, because PMS says that "variables that are not meaningful in a given phase or in global scope may be unset or set to any value." Probably it is cleaner to be more strict, so this patch restores the previous behaviour for EAPI 7: https://github.com/gentoo/portage/pull/1078 Please review if the logic is correct. (In reply to Zac Medico from comment #13) > > Maybe this should be adjusted to behave differently for EAPIs that do not > support IDEPEND, since PMS was also adjusted as noted in bug 911574 comment > #6. I asked ulm to not merge the change to do that, as it would break EAPI 7 ebuilds that use python-utils-r1.eclass for the cross-prefix case. It's a niche case, but gaining some interest, and I'm trying to make it work better. |