[Starlingx-discuss] [Build][MultiOS] Use of current centOS spec files in Mock build system with repos

Bailey, Henry Albert (Al) Al.Bailey at windriver.com
Thu May 9 15:38:34 UTC 2019


Hi Victor,
 The CENGN repos are where the build results go.  I believe these are built nightly.  So, they are not updated on a per-commit basis but they are "eventually" up to date.

 If you encounter spec files with bad or missing  BuildRequires   (or Requires) then yes it is very valuable to raise a Launchpad.

An audit tool would be helpful.

Below are some notes I took for steps that used to work for me,  but I have not tried them in a "very" long time, and the build tools may have changed.   (the build tools make use of mock)
Note that these steps remove the mock folders.
I suspect the technique you are using could also help track down missing Requires.

================
How to verify a spec has correct  BuildRequires:

cd $MY_WORKSPACE
rm -Rf mock*

build-srpms --clean <pkg>
build-srpms  <pkg>

build-rpms --clean <pkg>
build-rpms <pkg>

(If this builds, you are good)
Usually  "devel" or "staticdev"  packages are missing

================
How to verify a spec has correct  Requires:

cd $MY_WORKSPACE

rm -Rf mock*

mock -r $MY_BUILD_CFG --install <full path to RPM>
ie:  mock -r $MY_BUILD_CFG --install rpmbuild/RPMS/python-keystoneclient-1.3.1-r3.noarch.rpm

======================

Al

-----Original Message-----
From: Victor Rodriguez [mailto:vm.rod25 at gmail.com] 
Sent: Wednesday, May 08, 2019 3:45 PM
To: Little, Scott; starlingx-discuss at lists.starlingx.io; Cordoba Malibran, Erich
Subject: [Starlingx-discuss] [Build][MultiOS] Use of current centOS spec files in Mock build system with repos

Hi team

A few weeks ago I had the curiosity to investigate if there was an rpm
repo in CENGN for starling X.  Scott was very kind to point me about,
thanks a lot Scott. Why this is related to multi-os? RPM repositories
are warehouses of RPM package files that are easy to consume to build
with upstream tools like mock. mock is a tool for building RPM
packages. we can use mock to build packages for many different
versions of CentOS/Red Hat and Fedora.

After some experiments I was able to build basic packages from fault
management using the following methodology:

1) set up mock in my Linux distro ( in my case centos 7.6 )
2) use the following mock repositories config file to build:
https://github.com/starlingx-staging/stx-packaging/blob/master/configs/docker-centos-img/local-centos-7-x86_64.cfg
3) build as:
srpm :
mock -r $(MOCK_CONFIG) --buildsrpm --spec=$(SPEC) --sources=$(SOURCES)
--resultdir $(RES_DIR) --define="tis_patch_ver $(TIS_PATCH_VER)"
rpm :
 mock -r $(MOCK_CONFIG) --rebuild  $(SRPM) --resultdir $(RES_DIR)
--define="tis_patch_ver $(TIS_PATCH_VER)"

( the variables point to the location of my spec file and source
tar.gz files, the MOCK_CONFIG points to the path of my
local-centos-7-x86_64.cfg file )

In the end, it works pretty straight forward, proving the following
points from this experiment ( hopefully useful for someone else ) :

a) If we use the CENGN repos  ( plus the centos repo ) is possible to
build an RPM w/o the need to download the mirror. Great job Scott and
build team!
b) Is possible to use alternative upstream tools to build a single RPM
w/o the need to rebuild the build dependencies.

Now a few questions came to me :

a ) Are these CENGN repos in active use, I mean, are they updated with
a new ISO or every time a developer merge a commit in master?
b) After trying to build all the packages in fault management I found that:
* the source files directories are not standard ( I know Erich is
working on this )
* there are missing BuildRequires in the current centos spec files (
they build due to the specific architecture that builds system has to
handle/install the build req in a parallel build )

In the aim of improving the project to some other members of the
community use different tools to build different layers of the OS. I
was wonder how valuable the community see the task of adding the
proper BuildRequires in all the flock spec files that have missing
ones. I create a launchpad  and a patch for the missing build req I
found in fm-rest-api:

https://review.opendev.org/#/c/657869/

Any feedback from the community more than welcome

Regards

Victor Rodriguez

_______________________________________________
Starlingx-discuss mailing list
Starlingx-discuss at lists.starlingx.io
http://lists.starlingx.io/cgi-bin/mailman/listinfo/starlingx-discuss


More information about the Starlingx-discuss mailing list