Summary: | linux-info.eclass: linux_info_pkg_setup M="${S}" setting creates ${S} with root ownership which breaks builds with FEATURES=userpriv | ||
---|---|---|---|
Product: | Portage Development | Reporter: | Tobias Klausmann (RETIRED) <klausman> |
Component: | Unclassified | Assignee: | Gentoo Kernel Bug Wranglers and Kernel Maintainers <kernel> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | dev-portage, fedora.dm0, kernel, mbartoszkiewicz, mceier, ulm |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
See Also: | https://bugs.gentoo.org/show_bug.cgi?id=469210 | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- |
Description
Tobias Klausmann (RETIRED)
2020-06-22 13:44:29 UTC
* Fetching https://anongit.gentoo.org/git/proj/portage.git ... git fetch https://anongit.gentoo.org/git/proj/portage.git +HEAD:refs/git-r3/HEAD git symbolic-ref refs/git-r3/sys-apps/portage/0/__main__ refs/git-r3/HEAD * Checking out https://anongit.gentoo.org/git/proj/portage.git to /var/tmp/portage/sys-apps/portage-9999/work/portage-9999 ... /var/tmp/portage/sys-apps/portage-9999/work/portage-9999/.git: Permission denied * ERROR: sys-apps/portage-9999::gentoo failed (unpack phase): * (no error message) I have the same issue with sys-apps/portage-2.3.101-r2 and in order to merge some packages (tested with mesa, portage, qemu) I have to remove userpriv from the FEATURES. Downgrading to sys-apps/portage-2.3.100-r1 doesn't help, so I guess it's some eclass bug. It seems that ${S} is created as root:root before src_unpack. I think it is related to linux-info.eclass running the kernel Makefile with M=${S} to check the config. The problem form me only occurs on one of three similar hosts – one with Linux 5.8-rc2 in /usr/src/linux. It seems that the kernel Makefile from Linux v5.8-rc2 always creates ${M}, while earlier didn't: $ git reset --hard v5.8-rc1; rm -r foo; echo -e 'e: \ninclude Makefile' | make -f - M=$PWD/foo; ls -ld foo HEAD is now at b3a9e3b9622a Linux 5.8-rc1 arch/x86/Makefile:147: CONFIG_X86_X32 enabled but no binutils support arch/x86/Makefile:168: Disabling CONFIG_CC_OPTIMIZE_FOR_SIZE. Your compiler does not have -mfentry so you cannot optimize for size with CONFIG_FUNCTION_GRAPH_TRACER. make: Nothing to be done for 'e'. ls: cannot access 'foo': No such file or directory $ git reset --hard v5.8-rc2; rm -r foo; echo -e 'e: \ninclude Makefile' | make -f - M=$PWD/foo; ls -ld foo HEAD is now at 48778464bb7d Linux 5.8-rc2 rm: cannot remove 'foo': No such file or directory make: Nothing to be done for 'e'. drwxr-xr-x 1 embe embe 0 06-23 16:53 foo which causes linux-info.eclass to create ${S} as root before src_unpack, causing permission errors. (In reply to Michał Bartoszkiewicz from comment #4) > It seems that the kernel Makefile from Linux v5.8-rc2 always creates ${M}, > while earlier didn't: > I confirm that I also have v5.8-rc2. Please test this eclass fix:
> diff --git a/eclass/linux-info.eclass b/eclass/linux-info.eclass
> index 405ef5571e1..d043b2c4492 100644
> --- a/eclass/linux-info.eclass
> +++ b/eclass/linux-info.eclass
> @@ -187,3 +187,3 @@ getfilevar() {
> case ${EBUILD_PHASE_FUNC} in
> - pkg_info|pkg_nofetch|pkg_pretend) M="${T}" ;;
> + pkg_info|pkg_nofetch|pkg_pretend|pkg_setup) M="${T}" ;;
> esac
(In reply to Zac Medico from comment #6) > Please test this eclass fix: > > > diff --git a/eclass/linux-info.eclass b/eclass/linux-info.eclass > > index 405ef5571e1..d043b2c4492 100644 > > --- a/eclass/linux-info.eclass > > +++ b/eclass/linux-info.eclass > > @@ -187,3 +187,3 @@ getfilevar() { > > case ${EBUILD_PHASE_FUNC} in > > - pkg_info|pkg_nofetch|pkg_pretend) M="${T}" ;; > > + pkg_info|pkg_nofetch|pkg_pretend|pkg_setup) M="${T}" ;; > > esac This fixes the problem for me. Also note that S is only valid in src_* phases. PMS reference: https://projects.gentoo.org/pms/7/pms.html#x1-109002 (In reply to Zac Medico from comment #6) > Please test this eclass fix: > > > diff --git a/eclass/linux-info.eclass b/eclass/linux-info.eclass > > index 405ef5571e1..d043b2c4492 100644 > > --- a/eclass/linux-info.eclass > > +++ b/eclass/linux-info.eclass > > @@ -187,3 +187,3 @@ getfilevar() { > > case ${EBUILD_PHASE_FUNC} in > > - pkg_info|pkg_nofetch|pkg_pretend) M="${T}" ;; > > + pkg_info|pkg_nofetch|pkg_pretend|pkg_setup) M="${T}" ;; > > esac This fixes the issue for me. (In reply to Zac Medico from comment #6) > Please test this eclass fix: > > > diff --git a/eclass/linux-info.eclass b/eclass/linux-info.eclass > > index 405ef5571e1..d043b2c4492 100644 > > --- a/eclass/linux-info.eclass > > +++ b/eclass/linux-info.eclass > > @@ -187,3 +187,3 @@ getfilevar() { > > case ${EBUILD_PHASE_FUNC} in > > - pkg_info|pkg_nofetch|pkg_pretend) M="${T}" ;; > > + pkg_info|pkg_nofetch|pkg_pretend|pkg_setup) M="${T}" ;; > > esac Looking at the fix again, I wonder if the eclass couldn't just use M="${T}" unconditionally. M is the object output dir used by the Linux Makefile. It was added in this commit: https://gitweb.gentoo.org/repo/gentoo/historical.git/commit/?id=bba72b7037d567f5d9147be6c6998c1e90c4b9d4 The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5a3acd443c3347568d14d000776f46177317744a commit 5a3acd443c3347568d14d000776f46177317744a Author: Ulrich Müller <ulm@gentoo.org> AuthorDate: 2020-06-24 16:00:10 +0000 Commit: Ulrich Müller <ulm@gentoo.org> CommitDate: 2020-06-26 20:11:12 +0000 linux-info.eclass: Pass M=${T} to the Linux Makefile unconditionally. Using M="${S}" breaks in the pkg_setup phase where the S variable is not valid. Previous commit messages don't give any rationale why some phases would need the dir pointing to ${S}. Therefore, use ${T} in all phases unconditionally. Closes: https://bugs.gentoo.org/729178 Bug: https://bugs.gentoo.org/469210 Acked-by: Thomas Deutschmann <whissi@gentoo.org> Signed-off-by: Ulrich Müller <ulm@gentoo.org> eclass/linux-info.eclass | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) |