Mailinglist Archive: opensuse-buildservice (89 mails)

< Previous Next >
[opensuse-buildservice] Re: [opensuse-packaging] 'osc build' fails @ RPM error: "file not found". spec file's BuildRoot:/%{buildroot} ignored, files instead installed under 'build-root' from ~/.oscrc.
Per advice, moving from opensuse-packaging to opensuse-buildservice, as it's an
OBS/OSC-specific question

On Sun, Apr 26, 2015, at 09:50 AM, PGNd wrote:

On Sun, Apr 26, 2015, at 05:28 AM, Jan Engelhardt wrote:

Subject : Re: [opensuse-packaging] 'osc build' fails @ RPM error: "file not
found". spec file's BuildRoot:/%{buildroot} ignored, files
instead installed under 'build-root' from ~/.oscrc.

Yes, the spec file BuildRoot is ignored in modern RPM - rpm will
use a sane default so you don't have to.

Secondly, buildroot inside ~/.oscrc specifies the chroot osc will use,
not the rpm-level "BuildRoot". That will be in addition.

Thanks for the hints. It clarified chroot. The 'file not found' issue, for
me, remains.


@.spec "BuildRoot" -> unused
@.oscrc "build-root" != rpm-level "BuildRoot"
@.oscrc "build-root" == OSC chroot dir

Parameter naming used could certainly be less confusing ...

The default in ~/.oscrc

#build-root = /var/tmp/build-root/%(repo)s-%(arch)s

is easily modified, and, as mentioned, correctly defines the chroot
location.; nothing in the ./<package>.spec affects the chroot.

Thanks, that clears that up.

As for the actual BuildRoot ...

The docs at
Metadata Tags
The BuildRoot tag should always be used, even if newer
rpms override it anyway. The preferred path is

hint at the possibility of rpm override. Also raises the question of why it
"always" needs to be added if it's completely overridden & ignored.


BuildRoot: ...

from the <package>.spec results in NO error or warning on exec of 'osc build

I've now setup my local osc env as

obs workspace: /usr/local/src/obs_workspace
@ ~/.oscrc
build-root = /usr/local/src/obs_workspace/build-chroot/%(package)s
packagecachedir = /usr/local/src/obs_workspace/build-packagecache

With that, the package I'm working on is found @


Exec of 'osc build ...' now reports

[ 0s] Using

It appears %(package)s expands as


(1) "<package>/<package>" seems wrong
(2) The prepended '/path/to/obs/workspace' seems completely unncessary

I'd hope %(package)s would expand simply as


so that, as provided as example in ~/.oscrc, the form


would NOT expand to

[ 0s] Using BUILD_ROOT=


but to a more sane


Simply avoiding that confusion for the moment, ~/.oscrc

- build-root = /usr/local/src/obs_workspace/build-chroot/%(package)s
+ build-root = /usr/local/src/obs_workspace/build-chroot/%(project)s


[ 0s] Using BUILD_ROOT=

which is more manageable. That's sorted, for now.

With the setup above, and a .spec, unchanged from above, of

%setup -q -n %{name}-%{version}
make clean

gcc -v
export CXXFLAGS+=" -std=c++11"
make V=1 %{?_smp_mflags}

make DESTDIR=%{buildroot} install

rm -rf %{buildroot}

%defattr(-, root, root)

exec of 'osc build ...' fails

[ 47s] Processing files: cryptodev-linux-1428749261.da73010-0.x86_64
[ 47s] error: File not found:
[ 47s]
[ 47s]
[ 47s] RPM build errors:
[ 47s] File not found:

The buildroot was:

This error appears INsensitive to 'make DESTDIR=...' above. If

- make DESTDIR=%{buildroot} install
+ make install

exec still fails with the identical

[ 42s] Processing files: cryptodev-linux-1428749261.da73010-0.x86_64
[ 42s] error: File not found:
[ 42s]
[ 42s]
[ 42s] RPM build errors:
[ 42s] File not found:

The buildroot was:

The OP'd question remains,

(1) What in the spec file needs to change so that the build process finds the
built file in the correct buildroot?
To unsubscribe, e-mail: opensuse-packaging+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse-packaging+owner@xxxxxxxxxxxx

To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse-buildservice+owner@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages