[SOLVED] Diferent results building python2 modules

This forum is dedicated to packaging and translating :

On those activities rely the making of Mageia Linux Distribution.

Post all questions and information about packaging and translating : feedbacks, discussion about guidelines, packaging practices...

[SOLVED] Diferent results building python2 modules

Postby katnatek » Feb 9th, '18, 22:43

Trying to repeat the build of custom version of miniupnpc i got different results between a mageia 6 system upgraded (mga5 -> mga6sta2 -> mga6) and a clean mageia 6 system

The upgraded system creates:
Code: Select all
%{python_sitearch}/miniupnpc-2.0-py2.7.egg-info/PKG-INFO
%{python_sitearch}/miniupnpc-2.0-py2.7.egg-info/SOURCES.txt
%{python_sitearch}/miniupnpc-2.0-py2.7.egg-info/dependency_links.txt
%{python_sitearch}/miniupnpc-2.0-py2.7.egg-info/top_level.txt
%{python_sitearch}/miniupnpc.so


But the clean install creates:
Code: Select all
%{python_sitearch}/miniupnpc-2.0-py2.7.egg-info
%{python_sitearch}/miniupnpc.so


Seem like the right one is the clean system's way.
I can't found the cause of this issue, i even reinstall rpm and python related packages with urpmi --replacefiles --replacepkgs

I only change the file section in each system to get a successful build in each system.

The main difference between systems (aside desktop/dm installed) is, in the clean install i install task-mageia-packaging and in the upgraded due space limitations i try to install just the essential.
Last edited by katnatek on Feb 11th, '18, 01:03, edited 1 time in total.
BlogDrake Official Community and Forums for Spanish Talkers Users of OpenMandriva and Mageia Linux
katnatek
 
Posts: 56
Joined: Mar 16th, '12, 02:09

Re: Diferent results building python2 modules

Postby doktor5000 » Feb 10th, '18, 18:17

There are many different things that can influence this. Installed packages, configuration in ~/.rpmmacros or in /etc/rpm which might differ due to upgrades compared to a freshly installed system (maybe you never checked if there's an .rpmnew or .rpmsave file in there) and also the tools that you use to rebuild packages (bm, rpmbuild, iurt, mock) and also the user used to build the packages. This is also one of the reasons that packages are usually rebuilt in clean chroots. See e.g. https://wiki.mageia.org/en/Iurt and https://wiki.mageia.org/en/Packagers_Me ... Howto#iurt and maybe https://wiki.mageia.org/en/How_to_do_your_own_backports

You're missing essential information on what the .spec contains, what command you used to rebuild this, what packages you have installed and the logs from the build. Without that it's only guesswork.
I'd guess that you're missing some buildrequire, or that some of the python rpm macros are different on both systems.

In any case, functionally I don't see a difference there, the shared library gets created.

If you want to know what the files are for, see e.g. https://svn.python.org/projects/sandbox ... ormats.txt
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 14495
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Diferent results building python2 modules

Postby katnatek » Feb 10th, '18, 20:50

doktor5000 wrote:There are many different things that can influence this. Installed packages, configuration in ~/.rpmmacros or in /etc/rpm which might differ due to upgrades compared to a freshly installed system (maybe you never checked if there's an .rpmnew or .rpmsave file in there)


I don't see how ~/.rpmmacros could affect to build , the definition is the same in both systems (and both are i586) and i don't have any that could overwrite a relevant macro.

I don't detect .rpmnew or .rpmsave related with this but i will do a deep search

doktor5000 wrote:and also the tools that you use to rebuild packages (bm, rpmbuild, iurt, mock) and also the user used to build the packages. This is also one of the reasons that packages are usually rebuilt in clean chroots. See e.g. https://wiki.mageia.org/en/Iurt and https://wiki.mageia.org/en/Packagers_Me ... Howto#iurt and maybe https://wiki.mageia.org/en/How_to_do_your_own_backports


I just think that information was not relevant because i use the same tool in both systems.

I use rpmbuild

doktor5000 wrote:You're missing essential information on what the .spec contains, what command you used to rebuild this, what packages you have installed and the logs from the build. Without that it's only guesswork.
I'd guess that you're missing some buildrequire, or that some of the python rpm macros are different on both systems.


I will post the spec but i don't think is a issue of missing build require because the build is successful in both systems (with the file section adjust)

I think after the reinstallation of the packages the macros files must be the same, but i try uninstalling and reinstalling just in case.

doktor5000 wrote:In any case, functionally I don't see a difference there, the shared library gets created.

If you want to know what the files are for, see e.g. https://svn.python.org/projects/sandbox ... ormats.txt


Is important because i also try to build in fedora's copr and with the file section of the upgraded system the build fail, and with the file section of the clean system the build ends successful.

I will make a deep comparative of packages
BlogDrake Official Community and Forums for Spanish Talkers Users of OpenMandriva and Mageia Linux
katnatek
 
Posts: 56
Joined: Mar 16th, '12, 02:09

Re: Diferent results building python2 modules

Postby katnatek » Feb 10th, '18, 20:56

spec file

Code: Select all
%define major 16
%define libname %mklibname %{name} %{major}
%define develname %mklibname -d %{name}
%define basepy3dir   %(echo ../`basename %{py3dir}`)
%filter_provides_in %{python_sitearch}/.*\.so$

Summary: Library and tool to control NAT in UPnP-enabled routers
Name: miniupnpc
Version: 2.0.20170509
Release: %mkrel 3
License: LGPLv2+
Group: System/Libraries
URL: http://miniupnp.free.fr/
Source: http://miniupnp.free.fr/files/%{name}-%{version}.tar.gz
# taken from Fedora
# Do not create libminiupnpc.so.%%{version} and libminiupnpc.so.%%{major} linking to it
Patch0:      %{name}-version.patch
Source1: USAGE

BuildRequires: cmake
BuildRequires:  pkgconfig(python2)

%description
miniupnpc is an implementation of a UPnP client library, enabling
applications to access the services provided by an UPnP "Internet
Gateway Device" present on the network. In UPnP terminology, it is
a UPnP Control Point.

%package -n %{libname}
Summary: Library and tool to control NAT in UPnP-enabled routers
Group: System/Libraries

%description -n %{libname}
miniupnpc is an implementation of a UPnP client library, enabling
applications to access the services provided by an UPnP "Internet
Gateway Device" present on the network. In UPnP terminology, it is
a UPnP Control Point.

%package -n %{develname}
Summary: Header files, libraries and development documentation for miniupnpc
Group: Development/C
Requires: %{libname} = %{version}-%{release}
Provides: %{name}-devel = %{version}-%{release}

%description -n %{develname}
This package contains the header files and development documentation for
miniupnpc. If you like to develop programs using miniupnpc, you will need
to install miniupnpc-devel.

%package   -n python-%{name}
Summary:   Python interface to %{name}
Group:      System Environment/Libraries
Requires:   %{name}%{?_isa} = %{version}

%description   -n python-%{name}
This package contains python interfaces to %{name}.

%package   -n python3-%{name}
Summary:   Python3 interface to %{name}
Group:      System Environment/Libraries
Requires:   %{name}%{?_isa} = %{version}
BuildRequires:   python3-devel

%description   -n python3-%{name}
This package contains python3 interfaces to %{name}.

%prep
%setup -q
%patch0 -p1

cp %{SOURCE1} .
sed -i "s|\(\tpython setup.py install\)$|\1 --root=\$(DESTDIR)/|" Makefile

sed -i "s|\(\tpython3 setup.py install\)$|\1 --root=\$(DESTDIR)/|" Makefile

# version not updated in setup.py
sed -i 's/"1\.7"/"%{version}"/' setup.py

# Changelog says added -ansi without reason, but that
# breaks C files (python module) using C++ comments
sed -i 's/\(CFLAGS += -ansi\)/#\1/' Makefile

%build
%cmake -DUPNPC_BUILD_STATIC=OFF -DUPNPC_BUILD_TESTS=ON

# build example client
cd ..
%make upnpc-shared all

make pythonmodule

make pythonmodule3

make upnpc-shared

%install
%make_install -C build

make DESTDIR=$RPM_BUILD_ROOT installpythonmodule

make DESTDIR=$RPM_BUILD_ROOT installpythonmodule3

# install manpage and binary for example client using libminiupnpc
install -D -m 644 man3/miniupnpc.3 %buildroot/%{_mandir}/man3/miniupnpc.3
install -D -m 0755 upnpc-shared %buildroot%{_bindir}/upnpc

%check
make CFLAGS="-DMINIUPNPC_SET_SOCKET_TIMEOUT" check

%files
%doc Changelog.txt LICENSE README USAGE
%{_bindir}/upnpc
%{_mandir}/man3/miniupnpc.3.*

%files -n %{libname}
%{_libdir}/*.so.%{major}

%files -n %{develname}
%{_includedir}/miniupnpc
%{_libdir}/*.so

%files      -n python-%{name}
#Upgraded System
#%{python_sitearch}/miniupnpc-2.0-py2.7.egg-info/PKG-INFO
#%{python_sitearch}/miniupnpc-2.0-py2.7.egg-info/SOURCES.txt
#%{python_sitearch}/miniupnpc-2.0-py2.7.egg-info/dependency_links.txt
#%{python_sitearch}/miniupnpc-2.0-py2.7.egg-info/top_level.txt
#%{python_sitearch}/miniupnpc.so
#
#Clean System
%{python_sitearch}/miniupnpc-2.0-py2.7.egg-info
%{python_sitearch}/miniupnpc.so

%files      -n python3-%{name}
%{python3_sitearch}/miniupnpc-2.0-py3.5.egg-info/*
%{python3_sitearch}/miniupnpc*.so
BlogDrake Official Community and Forums for Spanish Talkers Users of OpenMandriva and Mageia Linux
katnatek
 
Posts: 56
Joined: Mar 16th, '12, 02:09

Re: Diferent results building python2 modules

Postby katnatek » Feb 11th, '18, 01:02

OK, i reinstall all the python stack in my system and now the build works as in the clean system

Code: Select all
urpmi $(rpm -qa|grep python) --replacefiles --replacepkgs


Before i just reinstall the packaging related
BlogDrake Official Community and Forums for Spanish Talkers Users of OpenMandriva and Mageia Linux
katnatek
 
Posts: 56
Joined: Mar 16th, '12, 02:09


Return to Packaging and translating for Mageia

Who is online

Users browsing this forum: No registered users and 1 guest