How to eliminate the warnings: mockbuild does not exist

6,347

Solution 1

You don't, and they don't do anything anyways. They are an artifact of the package having been built in the Fedora buildsystem.

Solution 2

Installing mock is the way to go, if you are interested in making the same package as Fedora's (as opposed to just creating an rpm). When installing that, the package creates a mock user which happens to partially fix the problem. According to the Fedora wiki page Using Mock to test package builds, you should add yourself to the mock group:

Add your user name to the mock group

sudo usermod -a -G mock myusername

Doing that fixed the warnings which I got in a rebuild of Fedora's ncurses source-packages. Depending on the version of mock (and the packages built using it), there may be a mockbuild account referenced in the source-rpms:

commit c33ccca2d36250e9d9fb7dec85fa72c311d43adb
Author: Miroslav Suchý
Date: Thu Nov 13 14:59:00 2014 +0100
run --shell as root with --new-chroot

Until now --new-chroot run --shell as 'mockbuild' user. This is
regression from --old-chroot, where it was run as root user.

Further reading:

On 11/13/2010 18:15, Christopher Stolzenberg wrote:

yum install mock
useradd mockbuild
usermod -G mock mockbuild

Unless you want to ``su'' to a dedicated mockbuild account every time you want to build you should add your usual account to the mock group instead.

mock rebuild -r epel-6-x86_64 /home/mockbuild/kernel 2.6.32-71.7.1.el6.src.rpm

Mock typically grabs packages from CentOS, so until CentOS 6 is out you're going to have to build using RHEL 6.

The Fedora project's page says to add your user to mock. You can skip this, but to avoid errors later (when installing srpms), add a mockbuild user. The mockbuild user doesn't need a password.

sudo useradd mockbuild

Share:
6,347

Related videos on Youtube

Cyker
Author by

Cyker

Updated on September 18, 2022

Comments

  • Cyker
    Cyker over 1 year

    I was building a package from SRPM on Fedora:

    $ rpmbuild --rebuild *.src.rpm
    
    ...
    warning: user mockbuild does not exist - using root
    warning: group mockbuild does not exist - using root
    warning: user mockbuild does not exist - using root
    warning: group mockbuild does not exist - using root
    ...
    

    The package was built but there were many such mockbuild does not exist warnings. There doesn't seem to be such an account on my system, even though I have package mock installed. Are there any other packages I'm missing? Is this a fault on the package or my system? How to eliminate these warnings?

  • Cyker
    Cyker over 5 years
    So where can I find the details about where these artifacts come from and why they must exist? The koji page doesn't mention user/group mockbuild, and I'm building on my machine not on koji. I'm not really good at remembering which warnings are harmful and which are false alarms so I prefer they get fixed somehow.
  • Ignacio Vazquez-Abrams
    Ignacio Vazquez-Abrams over 5 years
    Even SRPMs must be built. And they are being built as mockbuild.
  • Cyker
    Cyker over 5 years
    My understanding is that you can build with any user/group so I don't think it should warn me with a specific one. If rpmbuild must use user/group mockbuild to build SRPM, then I can add this user/group. But it's better to understand what's happening before modifying the system.
  • Ignacio Vazquez-Abrams
    Ignacio Vazquez-Abrams over 5 years
    Files in a RPM are owned by a specific user and group. In a SRPM from Fedora's buildsystem they are owned by mockbuild. Adding a local user called mockbuild won't help, since normal users can't chown files regardless.
  • Cyker
    Cyker over 5 years
    I'd like to clarify this a bit. SRPM contains source code, whose owner doesn't matter, as long as the builder can read the files. RPM contains binary files, but those files are built on MY machine, where there isn't a mockbuild user. Why would I expect the built binary files to be owned by a non-existent user?
  • Ignacio Vazquez-Abrams
    Ignacio Vazquez-Abrams over 5 years
    I don't understand why you would, and I don't understand what that question is doing here. If you're asking "Why do files in a SRPM have an owner?", the answer is that SRPMs are still RPMs, they just happen to contain source instead of built binaries.
  • Cyker
    Cyker over 5 years
    No, I don't care about SRPM file owners. My question is actually very simple: I don't have user/group mockbuild on my machine and I don't want packages built on my machine to be bothered with those warnings. So I'd like to understand why rpmbuild would spit out those warnings. Well, the comments have grown very long so I probably wait for a while.
  • Ignacio Vazquez-Abrams
    Ignacio Vazquez-Abrams over 5 years
    It spits out those warnings because those are the SRPM file owners.
  • Cyker
    Cyker over 5 years
    All right I got your point. My research shows that downloaded RPMs have file owners root but SRPMs have mockbuild. How difficult is it to fix the owner that won't be available on most users system before shipping out those SRPMs...
  • Ignacio Vazquez-Abrams
    Ignacio Vazquez-Abrams over 5 years
    Just unpack them and then repack them with the username that will eventually unpack them.
  • Grant Rostig
    Grant Rostig almost 3 years
    Doing that fixed the warning on the group mock, but still get> warning: user mockbuild does not exist - using root< I'm working on gcc.src.
  • Admin
    Admin almost 2 years
    one might consider sudo usermod -a -G mock $( whoami )