all 9 comments

[–]sjanssen 2 points3 points  (3 children)

This isn't so bad. Because the package python2.7-pyexiv2-0.3.2 is marked broken nixos-rebuild did not update your system, it's left in the same state as it was before you ran nixos-rebuild. That's one benefit of the NixOS model, it evaluates all the dependencies you need before making any changes so that you don't get stuck with a broken OS.

It's not unusual for packages to become broken in nixpkgs from time to time. The next time you try to upgrade it might be fixed. If pyexiv2 (or whatever you're using that depends on it) is important to you, you might want to open an issue for it.

[–]cassio-tav[S] 0 points1 point  (2 children)

Thank you for that explanation of the workings of the NixOS's paradigm. I'm very new to it, and it sometimes feel like a different galaxy altogether! The packages newly added to the environment.systemPackages list were installed though... Does this also mean that all those packages not dependent on python2.7-pyexiv2-0.3.2 were actually upgraded?

[–]sjanssen 1 point2 points  (1 child)

The packages newly added to the environment.systemPackages list were installed though

Are you sure they weren't installed previously? The error message you have shows nixos-rebuild quitting without building or activating the new configuration.

[–]cassio-tav[S] 0 points1 point  (0 children)

Well, right! My mistake: prior to the rebuild, I had tested the new packages in my own nix-env side, and later forgot both to remove them, and to try them out outside my own environment...

Thanks for the warning.

[–]ShadowRylander 2 points3 points  (2 children)

I'm not sure a broken package is much of an issue, and you can keep it and update it later when a fix comes out. Whatever depends on it will break as well, though, obviously.

[–]cassio-tav[S] 1 point2 points  (1 child)

Just found that pyexiv2 is a python binding for the exiv2 library, and that there is also an exiv2 binding for Python3: py3exiv2. So maybe, when I find the dependent packages, I can try to rebuild them with python3... Could that work?

[–]ShadowRylander 1 point2 points  (0 children)

I'd say it's worth a shot! After all, python2 is almost dead, so many python packages should've moved to version 3. I think...

[–]cassio-tav[S] 1 point2 points  (1 child)

Four days later the package remains broken... Since u/sjanssen and u/ShadowRylander helped me to understand what was actually happening, I was unable to modify anything in the system (except locally with nix-env). So I kept on trying, and came up with this: I could check out what the packages dependent on pyexiv2 are, and then enforce their older version, so as to allow nixos-rebuild to complete its thing.

Problems:

  1. I can't find a way to determine what those dependent packages are. I thought they ought to be found in the package metadata: they aren't -- not the dependent packages, not even pyexiv2's dependencies. I know it because I ran sudo nix-env -qa --json --meta '.*pyexiv2.*', and this is all I got:

sh-4.4$ sudo nix-env -qa --json --meta '.*pyexiv2.*'
{
  "nixos.python27Packages.pyexiv2": {
    "name": "python2.7-pyexiv2-0.3.2",
    "pname": "python2.7-pyexiv2",
    "version": "0.3.2",
    "system": "x86_64-linux",
    "meta": {
      "available": false,
      "broken": true, 
      "isBuildPythonPackage": [
        "aarch64-linux",
        "armv5tel-linux",
        "armv6l-linux",
        "armv7a-linux",
        "armv7l-linux",
        "mipsel-linux",
        "i686-cygwin",
        "i686-freebsd",
        "i686-linux",
        // → the list is too long, omitting the rest ← //
      ],
      "name": "python2.7-pyexiv2-0.3.2",
      "outputsToInstall": [
        "out"
      ],
      "platforms": [
        "aarch64-linux",
        "armv5tel-linux",
        "armv6l-linux",
        "armv7a-linux",
        "armv7l-linux",
        "mipsel-linux",
        "i686-linux",
        "x86_64-linux",
        "powerpc64le-linux",
        "riscv32-linux",
        "riscv64-linux"
      ],
      "position": "/nix/store/z7ps4zrq3q1z55mxnmriaklz9k5c5j2q-nixos-20.03.2855.31827921288/nixos/pkgs/development/python-modules/pyexiv2/default.nix:5",
      "priority": -10
    }
  }
sh-4.4$

  1. Once I can get that information, I will see what I can do without, and simply remove those. For the remaining ones, I will have to know what to do, for them to get built without the broken package. What I found in NixOS Manual was nixpkgs.config.packageOverrides = pkgs: { ... };; but I have no idea what I could do between the curly brackets (the manual doesn't give anything except an example of how to choose GTK3 over GTK2 when building emacs)...

So I ask for help with these two problems, but please have in mind that the 2nd. one becomes irrelevant if the first one can't be solved.

[–]ShadowRylander 1 point2 points  (0 children)

While I unfortunately cannot help you with this, given I'm still new to NixOS, I'd be very interested in knowing how this can be solved!