Nixpkgs: Notmuch fails to build on master

Created on 10 Dec 2018  路  5Comments  路  Source: NixOS/nixpkgs

notmuch fails to build on master, after the last staging-next merge. It's a failing test, but one that's reproducible and suggests something is actually wrong (ie. python version mixup):


Failing test

 FAIL   Handle files vanishing between scandir and add_file
        --- T050-new.36.EXPECTED        2018-12-09 10:43:07.572628337 +0000
        +++ T050-new.36.OUTPUT  2018-12-09 10:43:07.574628350 +0000
        @@ -1,4 +1,14 @@
        -Unexpected error with file /build/notmuch-0.28/test/tmp.T050-new/mail/vanish
        -add_file: Something went wrong trying to read or write a file
        -Error opening /build/notmuch-0.28/test/tmp.T050-new/mail/vanish: No such file or directory
        -exit status: 75
        +Fatal Python error: initsite: Failed to import the site module
        +Traceback (most recent call last):
        +  File "/nix/store/wvfm7149wwdmgyhcyfq9zmxiy9wbq7zb-python2.7-setuptools-40.4.3/lib/python2.7/site-packages/site.py", line 73, in <module>
        +    __boot()
        +  File "/nix/store/wvfm7149wwdmgyhcyfq9zmxiy9wbq7zb-python2.7-setuptools-40.4.3/lib/python2.7/site-packages/site.py", line 26, in __boot
        +    import imp  # Avoid import loop in Python 3
        +  File "/nix/store/yxiqcxi4ml1k7v7yxsfcwarji2w551bc-python3-3.7.1/lib/python3.7/imp.py", line 27, in <module>
        +    import tokenize
        +  File "/nix/store/yxiqcxi4ml1k7v7yxsfcwarji2w551bc-python3-3.7.1/lib/python3.7/tokenize.py", line 33, in <module>
        +    import re
        +  File "/nix/store/yxiqcxi4ml1k7v7yxsfcwarji2w551bc-python3-3.7.1/lib/python3.7/re.py", line 143, in <module>
        +    class RegexFlag(enum.IntFlag):
        +AttributeError: module 'enum' has no attribute 'IntFlag'
        +exit status: 1

I highly suspect that it's due to glib now using python3 (after gnome 3.30 upgrade) and (gmime3)[https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/libraries/gmime/3.nix] propagating glib.

Switching notmuch to python3 resolves the issue, though I'm not sure if that's safe, as there might be things depending on notmuch's python2 bindings.

cc most recent maintainer @flokli

regression

Most helpful comment

alot 0.8 now requires python 3. I've updated alot, and used python 3 for notmuch.

I've tried neomutt and alot and they both work.

All 5 comments

I think only afew and alot inside nixpkgs use the python bindings, while we already pass python3Packages as pythonPackages into pkgs/applications/networking/mailreaders/afew/default.nix.

alot seems to support python 3 too, and will discontinue python 2 support for the next release.

@hedning can you pass python3 to notmuch, and to alot too (similar to how it's done with afew), and see if this works for you?

afew is already using python3 5f03d6bf4d19714fec880729b946110799dd39db (Edit: can't read...)

alot doesn't support python3 yet: https://github.com/pazz/alot/releases/tag/0.7

Yeah, I'm getting this when trying to build alot with python3:

Processing ./alot-0.7-py3-none-any.whl
alot requires Python '>=2.7,<3.0' but the running Python is 3.7.1

In case of notmuch tests, it is possible that some of the PYTHON* environment variables
we set confuses gdb which python extension is using python 2.7.

(or then not, the log below ( https://hydra.nixos.org/build/85712357/nixlog/1 ) shows mixup of python 2.7 and 3.7 ...)

    +Fatal Python error: initsite: Failed to import the site module
        +Traceback (most recent call last):
        +  File "/nix/store/wvfm7149wwdmgyhcyfq9zmxiy9wbq7zb-python2.7-setuptools-40.4.3/lib/python2.7/site-packages/site.py", line 73, in <module>
        +    __boot()
        +  File "/nix/store/wvfm7149wwdmgyhcyfq9zmxiy9wbq7zb-python2.7-setuptools-40.4.3/lib/python2.7/site-packages/site.py", line 26, in __boot
        +    import imp  # Avoid import loop in Python 3
        +  File "/nix/store/yxiqcxi4ml1k7v7yxsfcwarji2w551bc-python3-3.7.1/lib/python3.7/imp.py", line 27, in <module>
        +    import tokenize
        +  File "/nix/store/yxiqcxi4ml1k7v7yxsfcwarji2w551bc-python3-3.7.1/lib/python3.7/tokenize.py", line 33, in <module>
        +    import re
        +  File "/nix/store/yxiqcxi4ml1k7v7yxsfcwarji2w551bc-python3-3.7.1/lib/python3.7/re.py", line 143, in <module>
        +    class RegexFlag(enum.IntFlag):
        +AttributeError: module 'enum' has no attribute 'IntFlag'

alot 0.8 now requires python 3. I've updated alot, and used python 3 for notmuch.

I've tried neomutt and alot and they both work.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

chris-martin picture chris-martin  路  3Comments

lverns picture lverns  路  3Comments

sid-kap picture sid-kap  路  3Comments

ob7 picture ob7  路  3Comments

retrry picture retrry  路  3Comments