Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python: further migrate packages from 2 to 3 #131719

Merged
merged 47 commits into from
Jul 29, 2021
Merged

Conversation

FRidh
Copy link
Member

@FRidh FRidh commented Jul 27, 2021

Motivation for this change

Goal is to get rid of the python attribute.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • 21.11 Release Notes (or backporting 21.05 Relase notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

@r-rmcgibbo
Copy link

r-rmcgibbo commented Jul 28, 2021

Result of nixpkgs-review pr 131719 at 238fa78 run on aarch64-linux 1

14 packages marked as broken and skipped:
  • python38Packages.ignite
  • python38Packages.pytorchWithCuda
  • python38Packages.spacy
  • python38Packages.spacy-transformers
  • python38Packages.tensorflowWithCuda
  • python38Packages.textacy
  • python39Packages.ignite
  • python39Packages.pytorchWithCuda
  • python39Packages.spacy
  • python39Packages.spacy-transformers
  • python39Packages.tensorflowWithCuda
  • python39Packages.textacy
  • rocm-opencl-icd
  • rocm-opencl-runtime
2 packages failed to build:
532 packages skipped due to time constraints:
  • ansible (ansible_2_11 ,python39Packages.ansible-core)
  • ansible-lint (python39Packages.ansible-lint)
  • ansible_2_10 (python39Packages.ansible-base)
  • apacheHttpdPackages.mod_tile (apacheHttpdPackages_2_4.mod_tile)
  • appdaemon
  • apprise (python39Packages.apprise)
  • azure-cli
  • beancount (python39Packages.beancount)
  • beets
  • beetsExternalPlugins.alternatives
  • ...
30 packages built successfully:
  • coccinelle
  • flowblade
  • hammer
  • libsigrok
  • libsigrok_0_3
  • lkl
  • lyx
  • matrix-appservice-discord
  • maxima
  • maxima-ecl
  • mergerfs-tools
  • mlt
  • moosefs
  • neard
  • python38Packages.aprslib
  • python38Packages.mlt
  • python38Packages.mox3
  • python38Packages.requests-mock
  • python38Packages.subunit
  • python38Packages.testrepository
  • python39Packages.aprslib
  • python39Packages.mlt
  • python39Packages.mox3
  • python39Packages.requests-mock
  • python39Packages.sqlalchemy_migrate
  • python39Packages.subunit
  • python39Packages.testrepository
  • sigrok-cli
  • subunit
  • yder
3 suggestions:
  • warning: name-and-version

    Did you mean to pass pname instead of name to mkDerivation?

    Near pkgs/applications/science/math/maxima/default.nix:17:3:

       |
    17 |   name = "${name}-${version}";
       |   ^
    

    Near pkgs/applications/science/math/maxima/default.nix:16:10:

       |
    16 |   inherit version;
       |          ^
    
  • warning: maintainers-missing

    Package does not have a maintainer. Consider adding yourself?

    Near pkgs/development/python-modules/subunit/default.nix:17:20:

       |
    17 |   inherit (subunit) name src meta;
       |                    ^
    
  • warning: unclear-gpl

    gpl2 is a deprecated license, please check if project uses gpl2Plus or gpl2Only and change meta.license accordingly.

    Near pkgs/applications/science/math/maxima/default.nix:106:5:

        |
    106 |     license = lib.licenses.gpl2;
        |     ^
    

Note that build failures may predate this PR, and could be nondeterministic or hardware dependent.
Please exercise your independent judgement. Does something look off? Please file an issue or reach out on IRC.


Result of nixpkgs-review pr 131719 at 238fa78 run on x86_64-linux 1

2 packages failed to build:
554 packages skipped due to time constraints:
  • ansible (ansible_2_11 ,python39Packages.ansible-core)
  • ansible-lint (python39Packages.ansible-lint)
  • ansible_2_10 (python39Packages.ansible-base)
  • apacheHttpdPackages.mod_tile (apacheHttpdPackages_2_4.mod_tile)
  • appdaemon
  • apprise (python39Packages.apprise)
  • azure-cli
  • beancount (python39Packages.beancount)
  • beets
  • beetsExternalPlugins.alternatives
  • ...
32 packages built successfully:
  • coccinelle
  • flowblade
  • hammer
  • ja2-stracciatella
  • libsigrok
  • libsigrok_0_3
  • lkl
  • matrix-appservice-discord
  • maxima
  • maxima-ecl
  • mergerfs-tools
  • mlt
  • moosefs
  • neard
  • orcania
  • python38Packages.aprslib
  • python38Packages.mlt
  • python38Packages.mox3
  • python38Packages.requests-mock
  • python38Packages.sqlalchemy_migrate
  • python38Packages.subunit
  • python38Packages.testrepository
  • python39Packages.aprslib
  • python39Packages.mlt
  • python39Packages.mox3
  • python39Packages.requests-mock
  • python39Packages.sqlalchemy_migrate
  • python39Packages.subunit
  • python39Packages.testrepository
  • sigrok-cli
  • subunit
  • yder
27 suggestions:
  • warning: build-tools-in-build-inputs

    doxygen is a build tool so it likely goes to nativeBuildInputs, not buildInputs.

    Near pkgs/development/tools/libsigrok/default.nix:21:3:

       |
    21 |   buildInputs = [ libzip glib libusb1 libftdi1 check libserialport
       |   ^
    
  • warning: unclear-gpl

    gpl2 is a deprecated license, please check if project uses gpl2Plus or gpl2Only and change meta.license accordingly.

    Near pkgs/servers/neard/default.nix:34:5:

       |
    34 |     license     = licenses.gpl2;
       |     ^
    
  • warning: build-tools-in-build-inputs

    pkg-config is a build tool so it likely goes to nativeBuildInputs, not buildInputs.

    Near pkgs/development/tools/misc/coccinelle/default.nix:12:3:

       |
    12 |   buildInputs = with ocamlPackages; [
       |   ^
    
  • warning: maintainers-missing

    Package does not have a maintainer. Consider adding yourself?

    Near pkgs/development/tools/parsing/hammer/default.nix:18:3:

       |
    18 |   meta = with lib; {
       |   ^
    
  • warning: maintainers-missing

    Package does not have a maintainer. Consider adding yourself?

    Near pkgs/development/compilers/llvm/rocm/clang.nix:68:5:

       |
    68 |     maintainers = with maintainers; [ ];
       |     ^
    
  • warning: unclear-gpl

    gpl2 is a deprecated license, please check if project uses gpl2Plus or gpl2Only and change meta.license accordingly.

    Near pkgs/applications/science/math/maxima/default.nix:106:5:

        |
    106 |     license = lib.licenses.gpl2;
        |     ^
    
  • warning: unclear-gpl

    gpl2 is a deprecated license, please check if project uses gpl2Plus or gpl2Only and change meta.license accordingly.

    Near pkgs/development/tools/parsing/hammer/default.nix:29:5:

       |
    29 |     license = licenses.gpl2;
       |     ^
    
  • warning: unclear-gpl

    gpl2 is a deprecated license, please check if project uses gpl2Plus or gpl2Only and change meta.license accordingly.

    Near pkgs/applications/virtualization/lkl/default.nix:65:5:

       |
    65 |     license     = licenses.gpl2;
       |     ^
    
  • warning: build-tools-in-build-inputs

    yarn is a build tool so it likely goes to nativeBuildInputs, not buildInputs.

    Near pkgs/development/tools/yarn2nix-moretea/yarn2nix/default.nix:294:7:

        |
    294 |       buildInputs = [ yarn nodejs rsync ] ++ extraBuildInputs;
        |       ^
    
  • warning: missing-phase-hooks

    checkPhase should probably contain runHook preCheck and runHook postCheck.

    Near pkgs/development/libraries/science/biology/mirtk/default.nix:23:3:

       |
    23 |   checkPhase = ''
       |   ^
    
  • warning: unclear-gpl

    gpl2 is a deprecated license, please check if project uses gpl2Plus or gpl2Only and change meta.license accordingly.

    Near pkgs/tools/filesystems/moosefs/default.nix:54:5:

       |
    54 |     license = licenses.gpl2;
       |     ^
    
  • warning: maintainers-missing

    Package does not have a maintainer. Consider adding yourself?

    Near pkgs/development/libraries/subunit/default.nix:21:3:

       |
    21 |   meta = with lib; {
       |   ^
    
  • warning: build-tools-in-build-inputs

    bc is a build tool so it likely goes to nativeBuildInputs, not buildInputs.

    Near pkgs/applications/misc/lyx/default.nix:16:3:

       |
    16 |   buildInputs = [
       |   ^
    
  • warning: build-tools-in-build-inputs

    python3.pkgs.wrapPython is a build tool so it likely goes to nativeBuildInputs, not buildInputs.

    Near pkgs/development/libraries/subunit/default.nix:15:3:

       |
    15 |   buildInputs = [ check cppunit perl python3Packages.wrapPython ];
       |   ^
    
  • warning: missing-phase-hooks

    buildPhase should probably contain runHook preBuild and runHook postBuild.

    Near pkgs/servers/matrix-appservice-discord/default.nix:39:3:

       |
    39 |   buildPhase = ''
       |   ^
    
  • warning: unclear-gpl

    gpl2 is a deprecated license, please check if project uses gpl2Plus or gpl2Only and change meta.license accordingly.

    Near pkgs/development/tools/misc/coccinelle/default.nix:37:5:

       |
    37 |     license = lib.licenses.gpl2;
       |     ^
    
  • warning: name-and-version

    Did you mean to pass pname instead of name to mkDerivation?

    Near pkgs/applications/science/math/maxima/default.nix:17:3:

       |
    17 |   name = "${name}-${version}";
       |   ^
    

    Near pkgs/applications/science/math/maxima/default.nix:16:10:

       |
    16 |   inherit version;
       |          ^
    
  • warning: build-tools-in-build-inputs

    makeWrapper is a build tool so it likely goes to nativeBuildInputs, not buildInputs.

    Near pkgs/applications/misc/lyx/default.nix:16:3:

       |
    16 |   buildInputs = [
       |   ^
    
  • warning: build-tools-in-build-inputs

    rsync is a build tool so it likely goes to nativeBuildInputs, not buildInputs.

    Near pkgs/development/tools/yarn2nix-moretea/yarn2nix/default.nix:294:7:

        |
    294 |       buildInputs = [ yarn nodejs rsync ] ++ extraBuildInputs;
        |       ^
    
  • warning: missing-phase-hooks

    checkPhase should probably contain runHook preCheck and runHook postCheck.

    Near pkgs/servers/matrix-appservice-discord/default.nix:45:3:

       |
    45 |   checkPhase = ''
       |   ^
    
  • warning: maintainers-missing

    Package does not have a maintainer. Consider adding yourself?

    Near pkgs/development/python-modules/subunit/default.nix:17:20:

       |
    17 |   inherit (subunit) name src meta;
       |                    ^
    
  • warning: missing-patch-comment

    Consider adding a comment explaining the purpose of this patch on the line preceeding.
    Near pkgs/games/ja2-stracciatella/default.nix:35:5:

       |
    35 |     ./remove-rust-buildstep.patch
       |     ^
    
  • warning: unclear-gpl

    lgpl21 is a deprecated license, please check if project uses lgpl21Plus or lgpl21Only and change meta.license accordingly.

    Near pkgs/development/libraries/mapnik/default.nix:97:5:

       |
    97 |     license = licenses.lgpl21;
       |     ^
    
  • warning: unused-argument

    Unused argument: fetchFromGitHub.
    Near pkgs/development/compilers/llvm/rocm/clang.nix:2:3:

      |
    2 | , fetchFromGitHub
      |   ^
    
  • warning: missing-phase-hooks

    installPhase should probably contain runHook preInstall and runHook postInstall.

    Near pkgs/applications/virtualization/lkl/default.nix:27:3:

       |
    27 |   installPhase = ''
       |   ^
    
  • warning: maintainers-missing

    Package does not have a maintainer. Consider adding yourself?

    Near pkgs/games/ja2-stracciatella/default.nix:57:3:

       |
    57 |   meta = {
       |   ^
    
  • error: no-flags-spaces

    makeFlags cannot contain spaces, please use makeFlagsArray in Bash.

    Near pkgs/applications/virtualization/lkl/default.nix:47:3:

       |
    47 |   makeFlags = [
       |   ^
    

Note that build failures may predate this PR, and could be nondeterministic or hardware dependent.
Please exercise your independent judgement. Does something look off? Please file an issue or reach out on IRC.

@@ -1,6 +1,6 @@
{ lib, stdenv, fetchzip
, boost, cairo, freetype, gdal, harfbuzz, icu, libjpeg, libpng, libtiff
, libwebp, libxml2, proj, python, sqlite, zlib
, libwebp, libxml2, proj, python3, python ? python3, sqlite, zlib
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
, libwebp, libxml2, proj, python3, python ? python3, sqlite, zlib
, libwebp, libxml2, proj, python3, sqlite, zlib

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is to separate the python used as build tool from that for which the binding is created.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, maybe we should add a comment for this. I am probably not the last one who stumbles upon this.

Copy link
Contributor

@jonringer jonringer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@FRidh FRidh merged commit 8dcfe52 into NixOS:master Jul 29, 2021
@collares
Copy link
Member

collares commented Jul 31, 2021

In pkgs/applications/science/math/sage/default.nix, we do

  maxima-ecl = pkgs.maxima-ecl.override {
    ecl = pkgs.ecl.override {
      useBoehmgc = true;
    };
  };

ecl adds boehmgc to its propagatedBuildInputs when useBoehmgc == true. Unfortunately, this overridden version of maxima-ecl does not work anymore. Vanilla maxima-ecl, as expected, uses ecl to compile Lisp files. When ecl was compiled with useBoehmgc == true, this is done by generating C files that use boehmgc's headers and compiling those files with gcc. Since this PR landed, this last step (in the context of building maxima-ecl) fails to find the right headers:

;;;
;;; Compiling /build/maxima-5.44.0/src/maxima-package.lisp.
;;; OPTIMIZE levels: Safety=2, Space=0, Speed=3, Debug=2
;;;
;;; End of Pass 1.
;;; Internal error:
;;;   ** Error code 1 when executing
;;; (EXT:RUN-PROGRAM "gcc" ("-I." "-I/nix/store/v8k8wdlgcx6dl4a5v1rplsy89dyhlndj-ecl-21.2.1/include/" "-I/nix/store/sipixdr4j94crffvl069mi94v7kyvqzv-gmp-6.2.1-dev/include" "-I/nix/store/w0v6cyzyhws18dahnv94bb0l0h6yf7zv-libffi-3.4.2-dev/include" "-D_GNU_SOURCE" "-D_FILE_OFFSET_BITS=64" "-g" "-O2" "-fPIC" "-Dlinux" "-O2" "-c" "binary-ecl/maxima-package.c" "-o" "binary-ecl/maxima-package.o")):
;;; In file included from /nix/store/v8k8wdlgcx6dl4a5v1rplsy89dyhlndj-ecl-21.2.1/include/ecl/ecl.h:37,
;;;                  from /nix/store/v8k8wdlgcx6dl4a5v1rplsy89dyhlndj-ecl-21.2.1/include/ecl/ecl-cmp.h:36,
;;;                  from binary-ecl/maxima-package.c:5:
;;; /nix/store/v8k8wdlgcx6dl4a5v1rplsy89dyhlndj-ecl-21.2.1/include/ecl/config.h:79:11: fatal error: gc/gc.h: No such file or directory
;;;    79 | # include "gc/gc.h"
;;;       |           ^~~~~~~~~
;;; compilation terminated.

Adding lisp-compiler to maxima's buildInputs as well as nativeBuildInputs makes things succeed but does not feel like a correct solution. What is a good way to make maxima-ecl with useBoehmgc == true automatically propagate the boehmgc dependency to ecl's users? If anyone wants to reproduce this problem, just run:

nix-build -E 'with (import <nixpkgs> {}); maxima-ecl.override { ecl = ecl.override { useBoehmgc = true; }; }'

@collares
Copy link
Member

collares commented Aug 1, 2021

Okay, I think #132269 fixes the above problem :)

@arkivm
Copy link
Contributor

arkivm commented Nov 26, 2021

appleseed.studio still depends on python2 and there is an open issue for python3 support.
However, freebsd ports successfully migrated to python3 with these set of patches. It's a bit non-trivial though. Tagging appleseed maintainer @hodapp

@arkivm arkivm mentioned this pull request Nov 26, 2021
13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants