openSUSE / obs-build

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

Non-root user failed to osc build when specify build root #888

Closed system-thoughts closed 1 year ago

system-thoughts commented 1 year ago

Describe the bug Non-root user failed to osc build when specify build root

Versions

To Reproduce Steps to reproduce the behavior:

  1. Run command mkdir tmp && osc build -j16 --root=$PWD/tmp standard_x86_64
  2. for example, see error
    
    osc build  -j16 --root=$PWD/tmp standard_x86_64
    WARNING: SSL certificate checks disabled. Connection is insecure!

Building python3.spec for standard_x86_64/x86_64 Getting buildconfig from server and store to /home/Rui/obs/home:system-thoughts:branches:openEuler:22.03:LTS/python3/.osc/_buildconfig-standard_x86_64-x86_64 Getting buildinfo from server and store to /home/Rui/obs/home:system-thoughts:branches:openEuler:22.03:LTS/python3/.osc/_buildinfo-standard_x86_64-x86_64.xml Updating cache of required packages 0.0% cache miss. 437/437 dependencies cached.

Skipping verification of package signatures Writing build configuration Running build BUILD_ROOT=/home/Rui/obs/home:system-thoughts:branches:openEuler:22.03:LTS/python3/tmp must be owned by root. Exit...

failed "build " at Wed Sep 21 13:47:56 UTC 2022.

The buildroot was: /home/Rui/obs/home:system-thoughts:branches:openEuler:22.03:LTS/python3/tmp



If we do not specofy build root dir, it can start building: `osc build --clean  -j16  standard_x86_64`
**Expected behavior**
Non-root user can osc build when specify build root:
mlschroe commented 1 year ago

The buildroot must be owned by root. It should work if you do a 'chown root tmp'.