Skip to content

python3Packages.shiboken2: reverse dependencies have to use python312#417345

Merged
dotlambda merged 8 commits intoNixOS:staging-nextfrom
dotlambda:python3Packages.shiboken2
Jun 16, 2025
Merged

python3Packages.shiboken2: reverse dependencies have to use python312#417345
dotlambda merged 8 commits intoNixOS:staging-nextfrom
dotlambda:python3Packages.shiboken2

Conversation

@dotlambda
Copy link
Member

@dotlambda dotlambda commented Jun 16, 2025

python313.pkgs.shiboken2 fails to build with

In file included from /build/pyside-setup-opensource-src-5.15.16/sources/shiboken2/libshiboken/sbkpython.h:104,
                 from /build/pyside-setup-opensource-src-5.15.16/sources/shiboken2/libshiboken/sbkarrayconverter.h:43,
                 from /build/pyside-setup-opensource-src-5.15.16/sources/shiboken2/libshiboken/sbkarrayconverter.cpp:40:
/build/pyside-setup-opensource-src-5.15.16/sources/shiboken2/libshiboken/sbkarrayconverter.cpp: In function 'void Shiboken::Conversions::sequenceToCppIntArray(PyObject*, void*)':
/build/pyside-setup-opensource-src-5.15.16/sources/shiboken2/libshiboken/pep384impl.h:187:24: error: '_PyLong_AsInt' was not declared in this scope; did you mean 'PyLong_AsInt'?
  187 | #define _PepLong_AsInt _PyLong_AsInt
      |                        ^~~~~~~~~~~~~
/build/pyside-setup-opensource-src-5.15.16/sources/shiboken2/libshiboken/sbkarrayconverter.cpp:164:29: note: in expansion of macro '_PepLong_AsInt'
  164 |     convertPySequence(pyIn, _PepLong_AsInt, handle->data());
      |                             ^~~~~~~~~~~~~~
make[2]: *** [libshiboken/CMakeFiles/libshiboken.dir/build.make:155: libshiboken/CMakeFiles/libshiboken.dir/sbkarrayconverter.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:354: libshiboken/CMakeFiles/libshiboken.dir/all] Error 2

It was marked broken in #407932.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • Nixpkgs 25.11 Release Notes (or backporting 24.11 and 25.05 Nixpkgs Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
  • NixOS 25.11 Release Notes (or backporting 24.11 and 25.05 NixOS Release notes)
    • (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, pkgs/README.md, maintainers/README.md and other contributing documentation in corresponding paths.

Add a 👍 reaction to pull requests you find important.

Shiboken2, and thus pyside2, is broken on Python 3.13.
Shiboken2, and thus pyside2, is broken on Python 3.13.
Shiboken2 is broken on Python 3.13.
Shiboken2, and thus pyside2, is broken on Python 3.13.
@dotlambda dotlambda requested a review from LordGrimmauld June 16, 2025 20:24
@LordGrimmauld
Copy link
Contributor

cc @pbsds who recently wanted to unpin python 3.11 and also (unknowingly) ran into this exact thing for some packages

@LordGrimmauld LordGrimmauld requested a review from pbsds June 16, 2025 20:26
Shiboken2 is broken on Python 3.13.
@LordGrimmauld
Copy link
Contributor

I'll go through the full list soon.
The alternative is to "soft-pin":

pythonPackages' =
    # lib.meta.availableOn does not respect meta.broken?
    if python3Packages.shiboken2.meta.available then python3Packages else python312Packages;

See #416726 for source

A hard-pin on 3.12 seems fine, shiboken2 getting 3.13 support is very unlikely. A soft-pin like this is an option, as that will then silently update python once shiboken updates.

@LordGrimmauld
Copy link
Contributor


napari/napari-npe2 also depend on shiboken2 via shiboken2 -> pyside2 -> magicgui
Those probably need similar treatment. However, napari is buildPythonPackage for whatever reason...

@nix-owners nix-owners bot requested review from cab404 and dtomvan June 16, 2025 20:38
@github-actions github-actions bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Jun 16, 2025
@dotlambda
Copy link
Member Author

However, napari is buildPythonPackage for whatever reason...

It seems to have a Python API: https://github.com/napari/napari?tab=readme-ov-file#simple-example

Shiboken2, and thus magicgui, is broken on Python 3.13.
@LordGrimmauld
Copy link
Contributor

SuperQT depends on pyside2 -> shiboken:


However it is marked optional - can we just disable pyside2 for python 3.13+ on superqt?

Otherwise, these might go wonky:


@LordGrimmauld
Copy link
Contributor

Other than magicgui and superqt, i don't see any obvious problematic libraries pulling in shiboken2

@LordGrimmauld
Copy link
Contributor

LordGrimmauld commented Jun 16, 2025

A simple-ish check is to remove the broken on shiboken2 and make the hash change for python3.13-only, then run nixpkgs-review against this PR. Actually i might try to do just that...
(obviously don't commit that XD)

@dotlambda
Copy link
Member Author

Typstwriter works fine.
Linien-gui is already broken in other ways, so I'm not touching that.

Other than magicgui and superqt, i don't see any obvious problematic libraries pulling in shiboken2

Shiboken2 is only an optional dependency of superqt.
Magicgui is only used by napari, which I already fixed.

@LordGrimmauld
Copy link
Contributor

Damn you work fast :)
Alright, time to give this an actual review now that there is a chance of it being complete

@LordGrimmauld
Copy link
Contributor

At a glance this looks fine, but i'll wait for the build to finish.

@LordGrimmauld
Copy link
Contributor

Building the 3.13 rev deps of shiboken2 (which of course all fail):

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review


x86_64-linux

❌ 7 packages failed to build:
  • python313Packages.magicgui
  • python313Packages.magicgui.dist
  • python313Packages.napari-npe2
  • python313Packages.napari-npe2.dist
  • python313Packages.pyside2
  • python313Packages.pyside2-tools
  • python313Packages.shiboken2

@dotlambda
Copy link
Member Author

Great, so this PR is complete.

Copy link
Contributor

@LordGrimmauld LordGrimmauld left a comment

Choose a reason for hiding this comment

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

Considering nothing that attempts to use shiboken2 on python 3.13 is an application, only unused libraries, this looks fine to me.

@dotlambda
Copy link
Member Author

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 417345
Commit: 899493a396b127326cceb33db93345ebb932c7f1


x86_64-linux

✅ 7 packages built:
  • kohighlights
  • napari
  • napari.dist
  • patray
  • patray.dist
  • sl1-to-photon
  • sl1-to-photon.dist

@dotlambda dotlambda merged commit fe3bde7 into NixOS:staging-next Jun 16, 2025
12 of 16 checks passed
@dotlambda dotlambda deleted the python3Packages.shiboken2 branch June 16, 2025 21:27
@pbsds
Copy link
Member

pbsds commented Jun 16, 2025

I'll go through the full list soon. The alternative is to "soft-pin":

pythonPackages' =
    # lib.meta.availableOn does not respect meta.broken?
    if python3Packages.shiboken2.meta.available then python3Packages else python312Packages;

See #416726 for source

A hard-pin on 3.12 seems fine, shiboken2 getting 3.13 support is very unlikely. A soft-pin like this is an option, as that will then silently update python once shiboken updates.

The reason i went for a soft-pin was not because i assumed it would be fixed, but because i wanted to adhere to

Considering it's not merged yet means i don't consider it a blocker, but documenting these python312 pins would help when the time to drop python312 comes.

@dotlambda
Copy link
Member Author

documenting these python312 pins would help when the time to drop python312 comes.

That makes sense and I guess git blame is not documentation enough.
I'll make sure to add comments going forward.

@ShyAssassin ShyAssassin mentioned this pull request Jun 25, 2025
13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants