openSUSE / obs-build

OBS build script, can be used with OBS or stand alone
GNU General Public License v2.0
133 stars 185 forks source link

Whole `/home/abuild` tree owned by root under `osc shell --vm-type=kvm` #1014

Open jirislaby opened 3 months ago

jirislaby commented 3 months ago

Not sure if this is a rpmbuild bug, osc's, or obs'…

When I build something (e.g. network/dpdk) in a VM:

osc build --root=/dev/shm/jslaby/xxvm  --no-verify --download-api-only --disable-debug -x vim -x vim-data -x strace --release 100  --ccache  --no-service --vm-type kvm --vm-disk=30000 --alternative-project  Kernel:HEAD QA

it can fail for some reason. Then I want to debug the failure inside the VM using osc shell:

osc shell --root=/dev/shm/jslaby/xxvm  --no-verify --download-api-only --disable-debug -x vim -x vim-data -x strace --release 100  --ccache  --no-service --vm-type kvm --vm-disk=30000 --alternative-project  Kernel:HEAD QA

But the whole tree under /home/abuild is:

drwxr-xr-x 3 root root 4096 Jul 16 04:40 /home/abuild

owned by root, so the build failure cannot be actually investigated properly. This didn't use to be the case some months ago.

SUSE Linux Enterprise Server 15 SP6
osc-1.8.3-150600.415.1.noarch

It's still owned by 399/abuild after osc build according to debugfs /dev/shm/jslaby/xxvm/img:

 261634   40755 (2)    399    399    4096 16-Jul-2024 08:24 abuild

As soon as /usr/bin/qemu-kvm of osc shell starts, it is reowned...

Note this is run: https://github.com/openSUSE/obs-build/blob/439fcc338b27a443fb3e97a78cbad2e03e2b9a10/build#L1830 But has no effect (it is overridden later):

CHOWN2 399:399 //home/abuild/rpmbuild
    455   40755 (2)      0      0    4096 16-Jul-2024 08:47 rpmbuild