[CMake] rpmbuild breaks if HOME is wrong

Eric Noulard eric.noulard at gmail.com
Mon Oct 4 14:45:21 EDT 2010


2010/10/4  <fatman at crackmonkey.us>:
>
> On Mon, 4 Oct 2010 18:19:20 +0200
> Eric Noulard <eric.noulard at gmail.com> wrote:
>
>> If you are speaking about CPackRPM generator then NO it shouldn't use
>> HOME dir. If it is the case then may be you have a some custom .rpmrc
>> somewhere?
>
> Oh. I guessed it was the rpmbuild default. Maybe I do have a .rpmrc
> somewhere. (Can't think why I would but I'll check anyway.)

May be it's the rpmbuild default (I didn't checked) but CPackRPM
is telling rpmbuild explicitely the BUILDROOT it should use
in 2 ways (some version of rpmbuild did not honor one of them):

using the --buildroot argument of rpmbuild command,

and
we re-specify this inside the generated spec file using:
BuildRoot:

field.

May be you can check in the generated spec file whether
if this field has an appropriate value.

>> If not could you gives us more informations:
>>   - Which version of CMake
>>   - Which Linux system (Mandriva, RedHat, OpenSuSE, Fedora...) with
>> version
>
> fatman at nikko:/var/lib/buildbot$ cmake --version
> cmake version 2.8.1
> fatman at nikko:/var/lib/buildbot$ lsb_release -a
> No LSB modules are available.
> Distributor ID: Ubuntu
> Description:    Ubuntu 10.04.1 LTS
> Release:        10.04
> Codename:       lucid
> fatman at nikko:/var/lib/buildbot$ uname -a
> Linux nikko 2.6.32-24-generic-pae #43-Ubuntu SMP Thu Sep 16 15:30:27 UTC
> 2010 i686 GNU/Linux
> fatman at nikko:/var/lib/buildbot$
> I discovered the "wrong HOME" problem in rpmbuild.err and tested with
> a corrected HOME variable. It worked, so the problem at least involves
> the HOME variable, somehow.

OK currently I cannot reproduce the problem.

Could you explain me why the buildbot would have an invalid HOME
do you use

a) "su "
b) or "su - "
c)  or "sudo"
d)  crontab  -u buildbot cron.file
e) other way?

to buildbot from another user?

If yes from which user to su from using which method (a,b,c,d,e)?

If I do

1) login with user 1
2) su to user2
3) go to whatever build dir belonging to user2
4) calling cpack -G RPM

from your point of view should I see the problem or do you have some
other steps I miss ?

> error: failed to create directory %{_topdir}: /home/fatman/rpmbuild:
> Permission denied

May be you can send me the whole rpmbuild.err and rpmbuild.out files?

>> Could you try to run the following command in your build directory:
>>
>> cpack -D CPACK_RPM_PACKAGE_DEBUG=1 -G RPM
>>
>> and send me the output.
>
> Note the different user. This is why the HOME variable is wrong.

Why would it be wrong?
su - <user>
or
su <user>

should setup HOME properly (at least it is the case on my systems
Debian Squeeze and Ubuntu 10.04)

> buildbot at nikko:/var/lib/buildbot/Reu2/slave/bin/nikko/build/cmake$
> cpack -D CPACK_RPM_PACKAGE_DEBUG=1 -G RPM CPack: Create package using
> RPM CPack: Install projects CPack: - Run preinstall target for: Reu2
> CPack: - Install project: Reu2
> CPack: Compress package
> CPackRPM:Debug: rpmbuild version is <4.7.2>
> CPackRPM:Debug: CPACK_TOPLEVEL_DIRECTORY
> =
> /var/lib/buildbot/Reu2/slave/bin/nikko/build/cmake/_CPack_Packages/Linux/RPM

is the previous directory belonging to user buildbot ?

[SNIP]

> /var/lib/buildbot/Reu2/slave/bin/nikko/build/cmake/_CPack_Packages/Linux/RPM/Reu2-0.1.1-Linux.rpm
> to /var/lib/buildbot/Reu2/slave/bin/nikko/build/cmake/Reu2-0.1.1-Linux.rpm
> CPack Error: Error when generating package: Reu2
> buildbot at nikko:/var/lib/buildbot$
>
> By the way, I am also building a DEB and TGZ package. They both
> complete successfully.

Yes but even if rpm building is enabled on Debian based host it's possible
that rpmbuild is not "working as expected" on such host.

By any chance do you have any other buildbot machine which would be RPM based
which exhibits the same trouble?

-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org


More information about the CMake mailing list