Bug 1302040 - rpm BUILDHOST set to container name
rpm BUILDHOST set to container name
Product: Fedora
Classification: Fedora
Component: mock (Show other bugs)
Unspecified Unspecified
low Severity unspecified
: ---
: ---
Assigned To: Miroslav Suchý
Fedora Extras Quality Assurance
Depends On: 1309367
  Show dependency treegraph
Reported: 2016-01-26 10:47 EST by Matthew Gyurgyik
Modified: 2016-10-22 00:01 EDT (History)
6 users (show)

See Also:
Fixed In Version: mock-1.3.2-1.fc25
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1309367 (view as bug list)
Last Closed: 2016-10-22 00:01:28 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Matthew Gyurgyik 2016-01-26 10:47:26 EST
Description of problem:

RPMs built inside an spawn container have BUILDHOST set to the container name. 

Version-Release number of selected component (if applicable):

Actual results:
[mirror3 x86_64]$ rpm -qp pl-gcc-4.9.3-1.el7.centos.x86_64.rpm --queryformat '%{BUILDHOST}'; echo

Expected results:
BUILDHOST should be the name of the host operating system.

Additional info:
Inside a container, I ran

$ hostname foo.example.com
$ rpmbuild --rebuild foo.src.rpm

And the resulting RPM had BUILDHOST=foo.example.com (which is different than the machine name).

This would require the hostname utility be installed. But theoretically hostname could be run before issuing the rpmbuild command.

No idea if this is the best approach. I'd be glad to take a stab at patch if you want try this method.
Comment 1 Miroslav Suchý 2016-02-17 10:47:52 EST
hostname is not available in base container

It would be nice if rpmbuild has option to define hostname. Currently it is not possible because rpmbuild call directly gethostbyname().
I will prefer this over installing other dependency inside of container.
Comment 2 Jan Kurik 2016-02-24 10:53:04 EST
This bug appears to have been reported against 'rawhide' during the Fedora 24 development cycle.
Changing version to '24'.

More information and reason for this action is here:
Comment 3 Miroslav Suchý 2016-10-12 08:40:51 EDT
Resolved by commits:
* 9a12844 change hostname in container [RHBZ#1302040]
* e8c3b32 example how to change hostname in container [RHBZ#1302040]

Note that it works only for F25+ chroots (does not matter what OS is used as host).
Comment 4 Fedora Update System 2016-10-19 04:30:03 EDT
mock-1.3.2-1.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-07f2f5e2c9
Comment 5 Fedora Update System 2016-10-22 00:01:28 EDT
mock-1.3.2-1.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.