Bug 1302040

Summary: rpm BUILDHOST set to container name
Product: [Fedora] Fedora Reporter: Matthew Gyurgyik <matthew>
Component: mockAssignee: Miroslav Suchý <msuchy>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: low    
Version: 24CC: jdisnard, mebrown, msimacek, msuchy, praiskup, williams
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: mock-1.3.2-1.fc25 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1309367 (view as bug list) Environment:
Last Closed: 2016-10-22 04:01:28 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1309367    
Bug Blocks:    

Description Matthew Gyurgyik 2016-01-26 15:47:26 UTC
Description of problem:

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

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

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


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 15:47:52 UTC
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 15:53:04 UTC
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:
https://fedoraproject.org/wiki/Fedora_Program_Management/HouseKeeping/Fedora24#Rawhide_Rebase

Comment 3 Miroslav Suchý 2016-10-12 12:40:51 UTC
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 08:30:03 UTC
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 04:01:28 UTC
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.