Skip to content

Another batch of Python 2 clean-ups - #76488

Merged
FRidh merged 16 commits into
NixOS:stagingfrom
jtojnar:more-python-cleanups
Jan 6, 2020
Merged

FRidh merged 16 commits into
NixOS:stagingfrom
jtojnar:more-python-cleanups

Conversation

@jtojnar

@jtojnar jtojnar commented Dec 25, 2019 •

Copy link
Copy Markdown
Member

Continued from #75668

I was digging through my system’s build-time closure using nix-store -q --graph $(nix-instantiate -I nixos-config=/etc/nixos/configuration.nix -I nixpkgs=$PWD '<nixpkgs/nixos>' -A system) | dijkstra -da $(nix-instantiate '<nixpkgs>' -A python2) | gvpr -c 'N[dist>1000.0]{delete(NULL, $)}' | xdot - and eliminating Python 2 from derivations referencing it by replacing it with Python 3 whenever possible.

Testing

Some packages were not handled in #75668:

New findings not covered here or in the previous PR:

  • crda now patched

    error
      GEN  keys-gcrypt.c
      Trusted pubkeys: pubkeys/sforshee.key.pub.pem pubkeys/linville.key.pub.pem
      File "./utils/key2pub.py", line 6
        except ImportError, e:
                          ^
    SyntaxError: invalid syntax
    make: *** [Makefile:115: keys-gcrypt.c] Error 1
    
  • lilypond: ERROR: Please install required programs: python3 < 3.0 (installed: 3.7.5) python3 < 3.0 (installed: 3.7.5) python3 < 3.0 (installed: 3.7.5) Python.h (python-devel, python-dev or libpython-dev package)

  • dblatex:

      File "./setup.py", line 86
        print self._package_base
                 ^
    SyntaxError: Missing parentheses in call to 'print'. Did you mean print(self._package_base)?
    ``` https://sourceforge.net/p/dblatex/mailman/dblatex-devel/thread/CAA19uiQVNJezugn6t9BsL3rY481DOG65B2buw2hs2KmK6Z9wBg%40mail.gmail.com/#msg36759114
    
  • zziplib (handled in zziplib: 0.13.69 → 0.13.71 #85147) docs/makedocs.py is not compatible with python3 gdraheim/zziplib#47:

    make[3]: Entering directory '/build/zziplib-0.13.69/x86_64-pc-linux-gnu/docs'
    PYTHONDONTWRITEBYTECODE=1  /nix/store/5dbidajmgrvskv7kj6bwrkza8szxkgar-python3-3.7.5/bin/python  ../../docs/makedocs.py ../../zzip/*.c  \
                       "--package=zziplib" "--version=0.13.69" \
                       "--onlymainheader=zzip/lib.h" "--output=zziplib"
      File "../../docs/makedocs.py", line 40
        print t_fileheader.get_filename(), t_fileheader.src_mainheader()
                         ^
    SyntaxError: invalid syntax
    make[3]: *** [Makefile:584: zziplib.xml] Error 1
    
  • mercurial (handled in mercurial: 4.9.1 -> 5.2.1 + python3 🚀 #76126)

  • duplicity (does no support Python 3 in stable version)
  • backblaze-b2 (should be supported but cannot test it)
  • scons (handled in scons: Switch to Python 3 #75877)
  • subversion (via checkInputs, even when tests are disabled)
  • inkscape (fixed in upcoming release lib2geom: init at 1.0 #50286)
  • gimp (fixed in upcoming release gimp3: init at 3.0.2 #67576)
  • mypaint (fixed in upcoming release mypaint: 1.2.1 → 2.0.0-beta.0 #54677)
  • wafHook (???)
  • gitAndTools.git-bz (???)
  • nodejs (too big, ??? firefox depends on this)
  • firefox (too big)
  • chromium (too big)
  • v8
    ERROR at //build/config/linux/pkg_config.gni:103:17: Script returned non-zero exit code.
        pkgresult = exec_script(pkg_config_script, args, "value")
                    ^----------
    Current dir: /build/source/out/Release/
    Command: python /build/source/build/config/linux/pkg-config.py glib-2.0 gmodule-2.0 gobject-2.0 gthread-2.0
    Returned 1.
    stderr:
    
      File "/build/source/build/config/linux/pkg-config.py", line 57
        print "You must specify an architecture via -a if using a sysroot."
                                                                          ^
    SyntaxError: Missing parentheses in call to 'print'. Did you mean print("You must specify an architecture via -a if using a sysroot.")?
    
    See //build/config/linux/BUILD.gn:89:3: whence it was called.
      pkg_config("glib") {
      ^-------------------
    See //build/config/compiler/BUILD.gn:228:18: which caused the file to be included.
        configs += [ "//build/config/linux:compiler" ]
                     ^------------------------------
    
  • tdesktop (error: gyp-2015-06-11 not supported for interpreter python3.7)
  • neard (GUI tools depend on PyGTK)
  • gitAndTools.git-hub (:disappointed: Port to Python3 sociomantic-tsunami/git-hub#224)

Introduced in 6449435, only Python 2 is supported and it does not seem to be used by anything.
@ofborg ofborg Bot added 6.topic: python Python is a high-level, general-purpose programming language. 8.has: clean-up This PR removes packages or removes other cruft labels Dec 25, 2019
@ofborg
ofborg Bot requested review from fpletz and infinisil December 25, 2019 07:34
@ofborg ofborg Bot added 10.rebuild-darwin: 11-100 This PR causes between 11 and 100 packages to rebuild on Darwin. 10.rebuild-linux: 101-500 This PR causes between 101 and 500 packages to rebuild on Linux. labels Dec 25, 2019
@jtojnar
jtojnar requested a review from ttuegel as a code owner December 25, 2019 08:48
@ofborg ofborg Bot added 6.topic: qt/kde Object-oriented framework for GUI creation 10.rebuild-darwin: 101-500 This PR causes between 101 and 500 packages to rebuild on Darwin. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 1001-2500 This PR causes many rebuilds on Linux and should target the staging branches. and removed 10.rebuild-darwin: 11-100 This PR causes between 11 and 100 packages to rebuild on Darwin. 10.rebuild-linux: 101-500 This PR causes between 101 and 500 packages to rebuild on Linux. labels Dec 25, 2019
@FRidh

FRidh commented Dec 29, 2019

Copy link
Copy Markdown
Member

Please restore the libplist bindings. Not building them by default is fine.

Also remove no longer needed perl.
Nothing much seems to be using it and we do not want Python 2 in our closure.
It does not seem to be used by anything and we want to get rid of Python 2 from closure.
For some reason we depended on both.
It does not appear to be actually necessary – wafHook will add it.
@jtojnar
jtojnar force-pushed the more-python-cleanups branch from 8bfffb0 to 4a583c8 Compare December 29, 2019 10:22
@FRidh
FRidh merged commit 8fff915 into NixOS:staging Jan 6, 2020
@jtojnar
jtojnar deleted the more-python-cleanups branch January 6, 2020 12:17
@jtojnar jtojnar mentioned this pull request Apr 13, 2020
10 tasks
@Mic92

Mic92 commented Jun 18, 2020

Copy link
Copy Markdown
Member

Nodejs is fixed if using _latest instead of _lts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: python Python is a high-level, general-purpose programming language. 6.topic: qt/kde Object-oriented framework for GUI creation 8.has: clean-up This PR removes packages or removes other cruft 10.rebuild-darwin: 101-500 This PR causes between 101 and 500 packages to rebuild on Darwin. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 1001-2500 This PR causes many rebuilds on Linux and should target the staging branches.

Projects

No open projects
Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants