Hi Prefix Wizards. After resolving python and perl I'm still unable to bootstrap prefix on my equipment. I initially assumed that this had to do with resuming the prefix build, however in a clean, single execution of `prefix-bootstrap.sh` build my install ends with: ``` install: cannot change ownership of '/flash/tmp/gentoo/var/tmp/portage/sys-apps/grep-3.11-r1/image/flash/tmp/gentoo//bin/egrep': Operation not permitted * ERROR ``` I am unable to see any real reason for this, however some investigation appears to point to `dobin` failing, likely due to `PORTAGE_INST_UID` and/or `PORTAGE_INST_GID` being unset: https://github.com/gentoo/portage/blob/120b2ec988eebf6cd90365d5b50a1a718eebb116/bin/ebuild-helpers/dobin#L32C3-L32C90 ``` install -m0755 -o ${PORTAGE_INST_UID:-0} -g ${PORTAGE_INST_GID:-0} "${x}" "${ED%/}/${__E_DESTTREE#/}/bin" ``` Any thoughts on this one? I'm a little stumped.
Created attachment 894585 [details] build.log
stage3.log https://0x0.st/XNa3.log Apologies for the pastebin, even with xz and zstd pushed to their limits I couldn't get it below 1k.
Added some "debug logging" to the dobin helper: ``` + newbin - egrep install -m0755 -o 0 -g 0 /flash/tmp/gentoo/var/tmp/portage/sys-apps/grep-3.11-r1/temp/.newins_tmp_I6AGbr/egrep /flash/tmp/gentoo/var/tmp/portage/sys-apps/grep-3.11-r1/image/flash/tmp/gentoo//bin install: cannot change ownership of '/flash/tmp/gentoo/var/tmp/portage/sys-apps/grep-3.11-r1/image/flash/tmp/gentoo//bin/egrep': Operation not permitted ``` So, why at this specific point in the bootstrap process is `PORTAGE_INST_{UID,GID}` getting unset? Since this is a new portage invocation, obviously something is changing between the previous run for app-arch/tar and this one for sys-apps/grep.
Curious, These vars aren't unset, they're set to '0'.
I've tried again on SLES 15 SP5 and encountered the same issue. I make it to here just fine: https://gitweb.gentoo.org/repo/proj/prefix.git/tree/scripts/bootstrap-prefix.sh#n2322 The next time Portage is invoked it seems to get confused and sets `PORTAGE_INST_UID` and `PORTAGE_INST_GID` to 0. We're still using the bootstrap `emerge` and `python` explicitly at this stage, but I did note on my most recent prefix attempt that Python, Portage, and Perl are all built and installed in the last successful `emerge`. I wonder if something is going awry there. genr8eofl noted that there are some SUSE specific notes in `startprefix`: https://gitweb.gentoo.org/proj/prefix/prefix-toolkit.git/tree/startprefix?h=main#n56 Not sure if this is related, but a possible avenue of investigation. I think I need to dig into the Portage code and work out how the environment gets setup which might shed some light on exactly where it gets these values from and why it seems to think it's running as `root`.
This is RAP, which uses mainline Portage. I'm not sure how this has worked previously, but apparently it did. non-RAP uses Prefix Portage which doesn't fall back to '0', but to the user that installed Portage. So the problem here is that you're neither user 250, nor 0. Maybe this rootuid/rootgrp stuff from Prefix branch should be brought down to main.
I ran some tests today. Steps to reproduce: - Install OpenSUSE Leap (15.5) in a VM. - `zypper in autoconf automake gcc gcc-c++` - curl bootstrap-prefix.sh - bootstrap prefix It will fail at the same point after around an hour on 15 threads. > I'm not sure how this has worked previously, but apparently it did. It appears to only fail on SUSE flavours - other users report it working for them on other distros. > non-RAP uses Prefix Portage which doesn't fall back to '0', What I'm seeing after modifying the `dobin` script is that the uid and gid are set in the environment when it's invoked, I'm assuming the rootuid bits will fix that?
Hi, I get the same message with Rocky Linux release 8.10. ... install: cannot change ownership of '/home/prefix/gentoo/var/tmp/portage/sys-apps/grep-3.11-r1/image/home/prefix/gentoo//bin/egrep': Operation not permitted * ERROR: sys-apps/grep-3.11-r1::gentoo failed (install phase): * dobin failed ... * ERROR: sys-apps/grep-3.11-r1::gentoo failed (install phase): * newbin failed ...
Hi, tried again today. >>> Install sys-apps/grep-3.11-r1 into /home/prefix/gentoo/var/tmp/portage/sys-apps/grep-3.11-r1/image make SHELL=/home/prefix/gentoo/bin/bash -j48 DESTDIR=/home/prefix/gentoo/var/tmp/portage/sys-apps/grep-3.11-r1/image install Making install in po make[1]: Entering directory '/home/prefix/gentoo/var/tmp/portage/sys-apps/grep-3.11-r1/work/grep-3.11/po' ``` /home/prefix/gentoo/usr/bin/install -c -m 644 grep.1 '/home/prefix/gentoo/var/tmp/portage/sys-apps/grep-3.11-r1/image/home/prefix/gentoo/usr/share/man/man1' /home/prefix/gentoo/usr/bin/install -c -m 644 ./grep.info '/home/prefix/gentoo/var/tmp/portage/sys-apps/grep-3.11-r1/image/home/prefix/gentoo/usr/share/info' install-info --info-dir='/home/prefix/gentoo/var/tmp/portage/sys-apps/grep-3.11-r1/image/home/prefix/gentoo/usr/share/info' '/home/prefix/gentoo/var/tmp/portage/sys-apps/grep-3.11-r1/image/home/prefix/gentoo/usr/share/info/grep.info' ``` make[1]: Leaving directory '/home/prefix/gentoo/var/tmp/portage/sys-apps/grep-3.11-r1/work/grep-3.11' install: cannot change ownership of '/home/prefix/gentoo/var/tmp/portage/sys-apps/grep-3.11-r1/image/home/prefix/gentoo//bin/egrep': Operation not permitted * ERROR: sys-apps/grep-3.11-r1::gentoo failed (install phase): * dobin failed ``` CHOST: x86_64-pc-linux-gnu IDENT: x86_64-rap-linux-rocky8.10
*** Bug 933681 has been marked as a duplicate of this bug. ***
Those vars looks like to be set to default 0/0 in lib/portage/package/ebuild/config.py (lines around 1095), but the bash scripts already puts a default if unset, maybe a clean way to resolve this bug. BTW, a few lines below, there is unreachable code (a raise OSError before os.stat(), as well as its else clause), and i'm not sure it makes sense to use eroot stat results for that.
Created attachment 897541 [details, diff] bugfix Bootstraps ok with that.
yes thank you, let's do this
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=55888020536b3866ff29f27d6b4e6ede77ae791f commit 55888020536b3866ff29f27d6b4e6ede77ae791f Author: Fabian Groffen <grobian@gentoo.org> AuthorDate: 2024-07-14 13:09:51 +0000 Commit: Fabian Groffen <grobian@gentoo.org> CommitDate: 2024-07-14 13:09:51 +0000 scripts/bootstrap-prefix: define PORTAGE_INST_{UID,GID} Based on the patch by Etienne Buira <etienne.buira@free.fr> in bug #933100. Mainline Portage doesn't set the Portage UID/GID, so define them in make.conf during bootstrap for RAP targets. Closes: https://bugs.gentoo.org/933100 Signed-off-by: Fabian Groffen <grobian@gentoo.org> scripts/bootstrap-prefix.sh | 9 +++++++++ 1 file changed, 9 insertions(+)