nokia / git-changelog-generator

Git Changelog Generator
https://pypi.python.org/pypi/gcg
BSD 3-Clause "New" or "Revised" License
14 stars 5 forks source link

CI: build RPMs on CentOS, not Ubuntu #30

Open weakcamel opened 6 years ago

weakcamel commented 6 years ago

This is an extension of issue #29

%(%{__python} -c "from distutils.sysconfig import get_python_lib; import sys; sys.stdout.write(get_python_lib())")

Watch out for virtualenv though; we need the global path in there, not pointing to Virtualenv environment

Note:


# this is output on Ubuntu, on CentOS it would be site-packages

$ /usr/bin/python2  -c "from distutils.sysconfig import get_python_lib; import sys; sys.stdout.write(get_python_lib())"
/usr/lib/python2.7/dist-packages

$ . venv/bin/activate

$ python -c "from distutils.sysconfig import get_python_lib; import sys; sys.stdout.write(get_python_lib())"
/home/wmaleska/git/git-changelog-generator/venv/lib/python2.7/site-packages
felfert commented 5 years ago

Actually, I did build tests on several distros. See https://build.opensuse.org/package/show/home:felfert/gcg The existing packages (as of 0.2.0) did not build on any of the tested systems for various reasons:

The above problems are fixed in my PR for python3 support

Regarding CentOS: It is impossible to provide an rpm for that, because all dependencies are missing. The only way to install on CentOS is with pip. On Mageia and OpenSuSE LEAP 15.1, I needed to provide my own dependencies of pythonX-semver and pythonX-jinja2

OBS (The OpenSuSE build service) is very nice for performing this kind of tests. It offers native builds on ~60 Linux distributions including other architectures like mips powerpc arm etc for free. There is also an interesting Feature: The actual build in a VM does not have network access. Instead, they parse the .spec/.dsc for dependencies and install those before they fire up the build process. This way, they make shure, that an RPM or DEB does properly define it's build dependencies and does not pull in something via pip or git or whatever means. The only issue: I have yet to find a way to automate copying of the travis build artifacts to them.