NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.2k stars 14.2k forks source link

Build failure: python3Packages.qiskit #306328

Open kilianar opened 6 months ago

kilianar commented 6 months ago

Steps To Reproduce

nix build github:NixOS/nixpkgs#python3Packages.qiskit 

Build log

error: Package ‘python3.11-qiskit-aer-0.13.3’ in /nix/store/93gkbbwymjn8ib4lrij4vc74mry01dm0-source/pkgs/development/python-modules/qiskit-aer/default.nix:151 is marked as broken, refusing to evaluate.

Additional context

Regrettably, python3Packages.qiskit has been broken for some time now. Presently, attempts to build it result in failure due to its dependency qiskit-aer being marked as broken. Conversely, when qiskit-aer is marked as not broken, the build fails due to incompatibility of qiskit-terra with the current Python version, as indicated by the error message:

qiskit-terra-0.25.1 not supported for interpreter python3.11

Significant changes have occurred within the internal structure of the Qiskit project, as outlined in the release notes for version 0.46.0 and 1.0.0, along with the corresponding migration guide:

As announced in previous releases (for more details see the 0.44.0, 0.45.3, and 0.46.0 release notes, along with this blog post) with the 1.0 release we’re completing a transition to have a single qiskit package exposing only the core SDK (what was previously qiskit-terra). This means that for releases >= 1.0.0, we have stopped using the qiskit-terra package and will only be publishing qiskit.

However, the updates in nixpkgs that reflect these releases merely incremented the version and hash values without adjusting the packaging itself, as evidenced by the commits 0.41.1 -> 0.45.1 and 0.45.1 -> 1.0.1.

It appears that we need to make some substantial changes to the packaging in order to align with the new structure from the upstream project.

Notify maintainers

@drewrisinger @pandaman64 @mweinelt (did the last view updates)


Add a :+1: reaction to issues you find important.

b-m-f commented 4 months ago

Under the hood the qiskit module now also runs rust during build. https://github.com/Qiskit/qiskit/tree/main/crates

Any ideas on how to best package this in Nix?

I could not find a way to disable cargo, which will fail due to missing network connectivity.

b-m-f commented 4 months ago

Found it https://github.com/NixOS/nixpkgs/blob/master/doc/languages-frameworks/rust.section.md#python-package-using-setuptools-rust-python-package-using-setuptools-rust

b-m-f commented 4 months ago

I created https://github.com/NixOS/nixpkgs/pull/322715 with my current WIP

comavius commented 3 weeks ago

@b-m-f I'd like to contribute to this issue. If there's anything I can assist with, please let me know, or feel free to hand over your PR to me. Regards

b-m-f commented 3 weeks ago

@comavius feel free to open another MR. I can then close mine.

comavius commented 3 weeks ago

I've opened another PR #350943