Bug 1709787 - ImportError: cannot import name '_gi' from 'gi'
Summary: ImportError: cannot import name '_gi' from 'gi'
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: pygobject3
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
urgent
Target Milestone: ---
Assignee: Miro Hrončok
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 1710754 (view as bug list)
Depends On:
Blocks: PYTHON38 1710754
TreeView+ depends on / blocked
 
Reported: 2019-05-14 10:25 UTC by Lumír Balhar
Modified: 2023-09-14 05:28 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-05-22 15:07:23 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Full build log from COPR (8.68 KB, text/plain)
2019-05-14 10:25 UTC, Lumír Balhar
no flags Details

Description Lumír Balhar 2019-05-14 10:25:49 UTC
Created attachment 1568364 [details]
Full build log from COPR

python-simpleline-1.4-2.fc31 fails to build from source in Fedora rawhide with Python 3.8. Test failure is:

BUILDSTDERR: ======================================================================
BUILDSTDERR: ERROR: simpleline_tests.glib_tests (unittest.loader._FailedTest)
BUILDSTDERR: ----------------------------------------------------------------------
BUILDSTDERR: ImportError: Failed to import test module: simpleline_tests.glib_tests
BUILDSTDERR: Traceback (most recent call last):
BUILDSTDERR:   File "/usr/lib64/python3.8/unittest/loader.py", line 470, in _find_test_path
BUILDSTDERR:     package = self._get_module_from_name(name)
BUILDSTDERR:   File "/usr/lib64/python3.8/unittest/loader.py", line 377, in _get_module_from_name
BUILDSTDERR:     __import__(name)
BUILDSTDERR:   File "/builddir/build/BUILD/simpleline-1.4/tests/simpleline_tests/glib_tests/__init__.py", line 21, in <module>
BUILDSTDERR:     from simpleline.event_loop.glib_event_loop import GLibEventLoop
BUILDSTDERR:   File "/builddir/build/BUILD/simpleline-1.4/simpleline/event_loop/glib_event_loop.py", line 29, in <module>
BUILDSTDERR:     import gi
BUILDSTDERR:   File "/usr/lib64/python3.8/site-packages/gi/__init__.py", line 42, in <module>
BUILDSTDERR:     from . import _gi
BUILDSTDERR: ImportError: cannot import name '_gi' from 'gi' (/usr/lib64/python3.8/site-packages/gi/__init__.py)
BUILDSTDERR: ----------------------------------------------------------------------
BUILDSTDERR: Ran 166 tests in 0.154s
BUILDSTDERR: FAILED (errors=1)
BUILDSTDERR: make: *** [Makefile:26: test] Error 1
RPM build errors:
BUILDSTDERR: error: Bad exit status from /var/tmp/rpm-tmp.sv12vt (%check)
BUILDSTDERR:     Bad exit status from /var/tmp/rpm-tmp.sv12vt (%check)
Child return code was: 1

Comment 1 Jiri Konecny 2019-05-15 08:18:16 UTC
This looks like broken gobject introspection. Switching components.

Comment 2 Björn 'besser82' Esser 2019-05-15 10:00:26 UTC
Switching components again, as python3-gobject3 is EPEL7, only.

Comment 3 Miro Hrončok 2019-05-15 12:56:58 UTC
fedmod:

+ /usr/bin/python3 -c 'import sys; sys.argv[0] = '\''fedmod'\''; from _fedmod import cli; cli.run()'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/builddir/build/BUILD/fedmod-0.6.2/_fedmod/__init__.py", line 1, in <module>
    import gi
  File "/usr/lib64/python3.8/site-packages/gi/__init__.py", line 42, in <module>
    from . import _gi
ImportError: cannot import name '_gi' from 'gi' (/usr/lib64/python3.8/site-packages/gi/__init__.py)

Comment 4 Stephen Gallagher 2019-05-16 12:32:16 UTC
Same problem from libmodulemd (linked the FTBFS bug).

Comment 5 Miro Hrončok 2019-05-19 08:14:53 UTC
Same problem with gnofract4d

+ xvfb-run -a -n 23 /usr/bin/python3 createdocs.py
/builddir/build/BUILD/gnofract4d-4.0.1/fract4d/absyn.py:198: SyntaxWarning: invalid escape sequence \s
  m = re.match(".*?(\s*\(\s*(\w+)\s*\))", id)
Problem creating docs. Online help will be incomplete.
cannot import name '_gi' from 'gi' (/usr/lib64/python3.8/site-packages/gi/__init__.py)
error: Bad exit status from /var/tmp/rpm-tmp.WHZFDt (%build)

Comment 6 Miro Hrončok 2019-05-19 08:20:51 UTC
gplugin:

-- checking if pygobject works with python3
CMake Error at python/CMakeLists.txt:76 (message):
    pygobject does not work with python3


-- Configuring incomplete, errors occurred!
See also "/builddir/build/BUILD/gplugin-0.27.0/x86_64-redhat-linux-gnu/CMakeFiles/CMakeOutput.log".
error: Bad exit status from /var/tmp/rpm-tmp.rKoICu (%build)

Comment 7 Miro Hrončok 2019-05-20 10:46:13 UTC
Colin, could you please prioritize this? We plan to move Python 3.8 to a side tag in ~2 weeks. Packages that will fail to rebuild will block merging the side tag back to rawhide (~1 month from now) and may not be installable in Fedora 31.

Comment 8 Miro Hrončok 2019-05-22 10:54:48 UTC
package Zim:

+ ./setup.py build
./setup.py:264: SyntaxWarning: invalid escape sequence \m
  'the following two commands:\m'
/builddir/build/BUILD/zim-0.70/zim/fs.py:164: SyntaxWarning: invalid escape sequence \s
  '''Translates paths for windows shares in the platform specific
/builddir/build/BUILD/zim-0.70/zim/parsing.py:267: SyntaxWarning: invalid escape sequence \w
  '''Wrapper around regex pattern objects which memorizes the
/builddir/build/BUILD/zim-0.70/zim/parsing.py:365: SyntaxWarning: invalid escape sequence \w
  is_uri_re = Re('^(\w[\w\+\-\.]*):')
/builddir/build/BUILD/zim-0.70/zim/parsing.py:367: SyntaxWarning: invalid escape sequence \w
  is_url_re = Re('^(\w[\w\+\-\.]*)://')
/builddir/build/BUILD/zim-0.70/zim/parsing.py:369: SyntaxWarning: invalid escape sequence \S
  is_email_re = Re('^(mailto:\S+|[^\s:]+)\@\S+\.\w+(\?.+)?$', re.U)
/builddir/build/BUILD/zim-0.70/zim/parsing.py:381: SyntaxWarning: invalid escape sequence \w
  is_interwiki_re = Re('^(\w[\w\+\-\.]*)\?(.*)', re.U)
/builddir/build/BUILD/zim-0.70/zim/parsing.py:383: SyntaxWarning: invalid escape sequence \w
  is_interwiki_keyword_re = re.compile('^\w[\w\+\-\.]*$', re.U)
Traceback (most recent call last):
  File "./setup.py", line 25, in <module>
    import makeman # helper script
  File "/builddir/build/BUILD/zim-0.70/makeman.py", line 13, in <module>
    from zim.main import HelpCommand
  File "/builddir/build/BUILD/zim-0.70/zim/main/__init__.py", line 22, in <module>
    import zim.fs
  File "/builddir/build/BUILD/zim-0.70/zim/fs.py", line 27, in <module>
    from zim.signals import SignalEmitter, SIGNAL_AFTER
  File "/builddir/build/BUILD/zim-0.70/zim/signals.py", line 7, in <module>
    from gi.repository import GObject
  File "/usr/lib64/python3.8/site-packages/gi/__init__.py", line 42, in <module>
    from . import _gi
ImportError: cannot import name '_gi' from 'gi' (/usr/lib64/python3.8/site-packages/gi/__init__.py)

Comment 9 Miro Hrončok 2019-05-22 14:17:41 UTC
caribou:

Traceback (most recent call last):
  File "../tools/make_schema.py", line 3, in <module>
    from gi.repository import GLib
  File "/usr/lib64/python3.8/site-packages/gi/__init__.py", line 42, in <module>
    from . import _gi
ImportError: cannot import name '_gi' from 'gi' (/usr/lib64/python3.8/site-packages/gi/__init__.py)
make[2]: *** [Makefile:851: org.gnome.antler.gschema.xml.in] Error 1
make[2]: Leaving directory '/builddir/build/BUILD/caribou-0.4.21/data'
make[1]: *** [Makefile:519: all-recursive] Error 1
make: *** [Makefile:474: all-recursive] Error 1
error: Bad exit status from /var/tmp/rpm-tmp.VK1FEu (%build)
    Bad exit status from /var/tmp/rpm-tmp.VK1FEu (%build)

Comment 10 Miro Hrončok 2019-05-22 14:45:23 UTC
The cause is - /usr/lib64/python3.8/site-packages/gi/_gi.cpython-38m-x86_64-linux-gnu.so has incorrect name:

<mock-chroot> sh-5.0# python3 -c 'from gi.repository import GLib'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib64/python3.8/site-packages/gi/__init__.py", line 42, in <module>
    from . import _gi
ImportError: cannot import name '_gi' from 'gi' (/usr/lib64/python3.8/site-packages/gi/__init__.py)
<mock-chroot> sh-5.0# mv /usr/lib64/python3.8/site-packages/gi/_gi.cpython-38m-x86_64-linux-gnu.so /usr/lib64/python3.8/site-packages/gi/_gi.cpython-38-x86_64-linux-gnu.so
<mock-chroot> sh-5.0# python3 -c 'from gi.repository import GLib'


Note that since 3.8.0a4, the "m" is not supposed to be there. Is it somehow hardcoded?

<mock-chroot> sh-5.0# python3-config --extension-suffix
.cpython-38-x86_64-linux-gnu.so

Comment 11 Miro Hrončok 2019-05-22 14:50:30 UTC
I don't see it hardcoded in spec, must be the build system, will examine.

Note: The Python 3 tests are skipped in %check. If they were not, the package would probably fail to build.

Comment 12 Miro Hrončok 2019-05-22 15:01:08 UTC
Examining the build log, this might simply require a bumped rebuild...

Comment 13 Miro Hrončok 2019-05-22 15:07:23 UTC
Yes, sorry about the noise.

Comment 14 Miro Hrončok 2019-05-22 23:09:59 UTC
*** Bug 1710754 has been marked as a duplicate of this bug. ***

Comment 15 Red Hat Bugzilla 2023-09-14 05:28:34 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 1000 days


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