RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1862714 - LIBSYSTEMD_VERSION value format change crashes systemd-python pip install
Summary: LIBSYSTEMD_VERSION value format change crashes systemd-python pip install
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: systemd
Version: 8.3
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: rc
: 8.0
Assignee: systemd-maint
QA Contact: Frantisek Sumsal
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-08-01 17:59 UTC by Carlos Goncalves
Modified: 2024-10-01 16:44 UTC (History)
7 users (show)

Fixed In Version: systemd-239-42.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-05-18 14:53:56 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github systemd-rhel rhel-8 pull 116 0 None closed (#1862714) build: use simple project version in pkgconfig files 2021-01-12 01:25:38 UTC

Description Carlos Goncalves 2020-08-01 17:59:31 UTC
Command "pip install systemd-python" fails with the error log below.

LIBSYSTEMD_VERSION has change its format to become a string in RHEL 8.3 from just an integer up to RHEL 8.2:  -DLIBSYSTEMD_VERSION=239 (239-37.el8)

========
RHEL 8.2
========

$ cat /etc/redhat-release 
Red Hat Enterprise Linux release 8.2 (Ootpa)

$ pkg-config --modversion libsystemd                                              
239

$ rpm -qa | grep systemd
systemd-pam-239-29.el8.aarch64
systemd-udev-239-29.el8.aarch64
systemd-devel-239-29.el8.aarch64
systemd-container-239-29.el8.aarch64
systemd-libs-239-29.el8.aarch64
systemd-239-29.el8.aarch64
rpm-plugin-systemd-inhibit-4.14.2-37.el8.aarch64

=============
RHEL 8.3 beta
=============

$ cat /etc/redhat-release 
Red Hat Enterprise Linux release 8.3 Beta (Ootpa)

$ pkg-config --modversion libsystemd
239 (239-37.el8)

$ rpm -qa | grep systemd
rpm-plugin-systemd-inhibit-4.14.3-4.el8.aarch64
systemd-239-37.el8.aarch64
systemd-libs-239-37.el8.aarch64
systemd-pam-239-37.el8.aarch64
systemd-udev-239-37.el8.aarch64
systemd-devel-239-37.el8.aarch64


$ sudo pip install systemd-python
  ERROR: Command errored out with exit status 1:                                                                                                                                                                                              
   command: /usr/bin/python3.6 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-cjx43znd/systemd-python/setup.py'"'"'; __file__='"'"'/tmp/pip-install-cjx43znd/systemd-python/setup.py'"'"';f=getattr(tokenize, '"
'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-7ldwlu22
'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-7ldwlu22                                                     [55/398]
       cwd: /tmp/pip-install-cjx43znd/systemd-python/                                                                                                                                                                                         
  Complete output (32 lines):                                                                                                                                                                                                                 
  running bdist_wheel                                                                                                                                                                                                                         
  running build                                                                                                                                                                                                                               
  running build_py                                                                                                                                                                                                                            
  package init file 'systemd/test/__init__.py' not found (or not a regular file)                                                                                                                                                              
  creating build                                                                                                                                                                                                                              
  creating build/lib.linux-aarch64-3.6                                                                                                                                                                                                        
  creating build/lib.linux-aarch64-3.6/systemd                                                                                                                                                                                                
  copying systemd/__init__.py -> build/lib.linux-aarch64-3.6/systemd                                                                                                                                                                          
  copying systemd/journal.py -> build/lib.linux-aarch64-3.6/systemd                                                                                                                                                                           
  copying systemd/daemon.py -> build/lib.linux-aarch64-3.6/systemd                                                                                                                                                                            
  creating build/lib.linux-aarch64-3.6/systemd/test                                                                                                                                                                                           
  copying systemd/test/test_daemon.py -> build/lib.linux-aarch64-3.6/systemd/test                                                                                                                                                             
  copying systemd/test/test_journal.py -> build/lib.linux-aarch64-3.6/systemd/test                                                                                                                                                            
  copying systemd/test/test_login.py -> build/lib.linux-aarch64-3.6/systemd/test                                                                                                                                                              
  running build_ext                                                                                                                                                                                                                           
  building 'systemd/_journal' extension                                                                                                                                                                                                       
  creating build/temp.linux-aarch64-3.6                                                                                                                                                                                                       
  creating build/temp.linux-aarch64-3.6/systemd                                                                                                                                                                                               
  gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-swit
ches -fasynchronous-unwind-tables -fstack-clash-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switche
s -fasynchronous-unwind-tables -fstack-clash-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -
fasynchronous-unwind-tables -fstack-clash-protection -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DPACKAGE_VERSION="234" -DLIBSYSTEMD_VERSION=239 (239-37.el8) -I/usr/include/python3.6m -c systemd/_journal.c -o build/temp.linux-aarch64-3.6/systemd/_
journal.o -Werror=implicit-function-declaration                                                                                                                                                                                               
  gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-swit
ches -fasynchronous-unwind-tables -fstack-clash-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switche
s -fasynchronous-unwind-tables -fstack-clash-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -
fasynchronous-unwind-tables -fstack-clash-protection -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DPACKAGE_VERSION="234" -DLIBSYSTEMD_VERSION=239 (239-37.el8) -I/usr/include/python3.6m -c systemd/pyutil.c -o build/temp.linux-aarch64-3.6/systemd/pyu
til.o -Werror=implicit-function-declaration                                                                                                                                                                                                   
  gcc -pthread -shared -Wl,-z,relro -Wl,-z,now -g -Wl,-z,relro -Wl,-z,now -g build/temp.linux-aarch64-3.6/systemd/_journal.o build/temp.linux-aarch64-3.6/systemd/pyutil.o -L/usr/lib64 -lsystemd -lpython3.6m -o build/lib.linux-aarch64-3.6/
systemd/_journal.cpython-36m-aarch64-linux-gnu.so                                                                                                                                                                                             
  building 'systemd/_reader' extension                                                                                                                                                                                                        
  gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-swit
ches -fasynchronous-unwind-tables -fstack-clash-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switche
s -fasynchronous-unwind-tables -fstack-clash-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -
fasynchronous-unwind-tables -fstack-clash-protection -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DPACKAGE_VERSION="234" -DLIBSYSTEMD_VERSION=239 (239-37.el8) -I/usr/include/python3.6m -c systemd/_reader.c -o build/temp.linux-aarch64-3.6/systemd/_r
eader.o -Werror=implicit-function-declaration                                                                                                                                                                                                 
  <command-line>: error: missing binary operator before token "("                                                                                                                                                                             
  systemd/_reader.c:41:5: note: in expansion of macro ‘LIBSYSTEMD_VERSION’                                                                                                                                                                    
   #if LIBSYSTEMD_VERSION >= 229                                                                                                                                                                                                              
       ^~~~~~~~~~~~~~~~~~                                                                                                                                                                                                                     
  <command-line>: error: missing binary operator before token "("                                                                                                                                                                             
  systemd/_reader.c:47:5: note: in expansion of macro ‘LIBSYSTEMD_VERSION’                                                                                                                                                                    
   #if LIBSYSTEMD_VERSION >= 230                                                                                                                                                                                                              
       ^~~~~~~~~~~~~~~~~~                                                                                                                                                                                                                     
  error: command 'gcc' failed with exit status 1                                                                                                                                                                                              
  ----------------------------------------                                                                                                                                                                                                    
  ERROR: Failed building wheel for systemd-python                                                                                                                                                                                             
DEPRECATION: Could not build wheels for systemd-python which do not use PEP 517. pip will fall back to legacy 'setup.py install' for these. pip 21.0 will remove support for this functionality. A possible replacement is to fix the wheel bu
ild issue reported above. You can find discussion regarding this at https://github.com/pypa/pip/issues/8368.                                                                                                                                  
    ERROR: Command errored out with exit status 1:                                                                                                                                                                                            
     command: /usr/bin/python3.6 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-cjx43znd/systemd-python/setup.py'"'"'; __file__='"'"'/tmp/pip-install-cjx43znd/systemd-python/setup.py'"'"';f=getattr(tokenize, 
'"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-g78xaig4/install-record.txt --single-version-externally-managed 
--compile --install-headers /usr/local/include/python3.6m/systemd-python
         cwd: /tmp/pip-install-cjx43znd/systemd-python/
    Complete output (32 lines):
    running install
    running build
    running build_py
    package init file 'systemd/test/__init__.py' not found (or not a regular file)
    creating build
    creating build/lib.linux-aarch64-3.6
    creating build/lib.linux-aarch64-3.6/systemd
    copying systemd/__init__.py -> build/lib.linux-aarch64-3.6/systemd
    copying systemd/journal.py -> build/lib.linux-aarch64-3.6/systemd
    copying systemd/daemon.py -> build/lib.linux-aarch64-3.6/systemd
    creating build/lib.linux-aarch64-3.6/systemd/test
    copying systemd/test/test_daemon.py -> build/lib.linux-aarch64-3.6/systemd/test
    copying systemd/test/test_journal.py -> build/lib.linux-aarch64-3.6/systemd/test
    copying systemd/test/test_login.py -> build/lib.linux-aarch64-3.6/systemd/test
    running build_ext
    building 'systemd/_journal' extension
    creating build/temp.linux-aarch64-3.6
    creating build/temp.linux-aarch64-3.6/systemd
    gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -fasynchronous-unwind-tables -fstack-clash-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -fasynchronous-unwind-tables -fstack-clash-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -fasynchronous-unwind-tables -fstack-clash-protection -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DPACKAGE_VERSION="234" -DLIBSYSTEMD_VERSION=239 (239-37.el8) -I/usr/include/python3.6m -c systemd/_journal.c -o build/temp.linux-aarch64-3.6/systemd/_journal.o -Werror=implicit-function-declaration
    gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -fasynchronous-unwind-tables -fstack-clash-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -fasynchronous-unwind-tables -fstack-clash-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -fasynchronous-unwind-tables -fstack-clash-protection -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DPACKAGE_VERSION="234" -DLIBSYSTEMD_VERSION=239 (239-37.el8) -I/usr/include/python3.6m -c systemd/pyutil.c -o build/temp.linux-aarch64-3.6/systemd/pyutil.o -Werror=implicit-function-declaration
    gcc -pthread -shared -Wl,-z,relro -Wl,-z,now -g -Wl,-z,relro -Wl,-z,now -g build/temp.linux-aarch64-3.6/systemd/_journal.o build/temp.linux-aarch64-3.6/systemd/pyutil.o -L/usr/lib64 -lsystemd -lpython3.6m -o build/lib.linux-aarch64-3.6/systemd/_journal.cpython-36m-aarch64-linux-gnu.so
    building 'systemd/_reader' extension
    gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -fasynchronous-unwind-tables -fstack-clash-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -fasynchronous-unwind-tables -fstack-clash-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -fasynchronous-unwind-tables -fstack-clash-protection -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DPACKAGE_VERSION="234" -DLIBSYSTEMD_VERSION=239 (239-37.el8) -I/usr/include/python3.6m -c systemd/_reader.c -o build/temp.linux-aarch64-3.6/systemd/_reader.o -Werror=implicit-function-declaration
    <command-line>: error: missing binary operator before token "("
    systemd/_reader.c:41:5: note: in expansion of macro ‘LIBSYSTEMD_VERSION’
     #if LIBSYSTEMD_VERSION >= 229
         ^~~~~~~~~~~~~~~~~~
    <command-line>: error: missing binary operator before token "("
    systemd/_reader.c:47:5: note: in expansion of macro ‘LIBSYSTEMD_VERSION’
     #if LIBSYSTEMD_VERSION >= 230
         ^~~~~~~~~~~~~~~~~~
    error: command 'gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3.6 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-cjx43znd/systemd-python/setup.py'"'"'; __file__='"'"'/tmp/pip-install-cjx43znd/systemd-python/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-g78xaig4/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.6m/systemd-python Check the logs for full command output.

Comment 1 David Tardon 2020-08-03 07:34:57 UTC
This is a regression from bug 1804252. The fix for it is missing https://github.com/systemd/systemd/commit/a67c318df8800ba98d7361308937ed276dc73982 .

Comment 3 Lukáš Nykrýn 2020-11-02 13:44:01 UTC
fix merged to github master branch -> https://github.com/systemd-rhel/rhel-8/pull/116

Comment 9 Federico Ressi 2020-12-16 09:01:32 UTC
To workaround this problem in DevStack I started writing patch [1] to install python3-systemd package instead of using this package from PIP. This solution looks to work also for other Linux distros like Fedora 32, Ubuntu Focal and Suse 15 according to the results of OpenStack CI jobs.

[1] https://review.opendev.org/c/openstack/devstack/+/766740

Comment 13 errata-xmlrpc 2021-05-18 14:53:56 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: systemd security, bug fix, and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2021:1611


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