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

electrum: fix check without qt #303916

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

arcnmx
Copy link
Member

@arcnmx arcnmx commented Apr 13, 2024

Description of changes

Resolves the following build error:

nix-build --expr '(import <nixpkgs> {}).electrum.override { enableQt = false; }'

electrum> ============================= test session starts ==============================
electrum> platform linux -- Python 3.11.8, pytest-8.0.2, pluggy-1.4.0
electrum> rootdir: /build/Electrum-4.5.4
electrum> collected 679 items / 1 error
electrum> ==================================== ERRORS ====================================
electrum> ___________________ ERROR collecting tests/test_qml_types.py ___________________
electrum> ImportError while importing test module '/build/Electrum-4.5.4/tests/test_qml_types.py'.
electrum> Hint: make sure your test modules/packages have valid Python names.
electrum> Traceback:
electrum> electrum/gui/qml/__init__.py:8: in <module>
electrum>     import PyQt6
electrum> E   ModuleNotFoundError: No module named 'PyQt6'
electrum> The above exception was the direct cause of the following exception:
electrum> /nix/store/gd3shnza1i50zn8zs04fa729ribr88m9-python3-3.11.8/lib/python3.11/importlib/__init__.py:126: in import_module
electrum>     return _bootstrap._gcd_import(name[level:], package, level)
electrum> tests/test_qml_types.py:5: in <module>
electrum>     from electrum.gui.qml.qetypes import QEAmount
electrum> electrum/gui/qml/__init__.py:11: in <module>
electrum>     raise GuiImportError(
electrum> E   electrum.GuiImportError: Error: Could not import PyQt6. On Linux systems, you may try 'sudo apt-get install python3-pyqt6'
electrum> =========================== short test summary info ============================
electrum> ERROR tests/test_qml_types.py
electrum> !!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
electrum> =============================== 1 error in 1.06s ===============================

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/)
  • 24.05 Release Notes (or backporting 23.05 and 23.11 Release 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.

Add a 👍 reaction to pull requests you find important.

@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux labels Apr 13, 2024
@doronbehar
Copy link
Contributor

Resolves the following build error:

Could it be because of this:

checkInputs = with python.pkgs; lib.optionals enableQt [
    pyqt6
];

This should be nativeCheckInputs.

@arcnmx
Copy link
Member Author

arcnmx commented Jun 16, 2024

Could it be because of this:
This should be nativeCheckInputs.

Well not really, afaik the build does work normally and the package isn't broken when enableQt = true. It's only when building without qt in any build inputs that the test needs to be removed/disabled (you could unconditionally add it to the check inputs but that would kind of defeat most of the purpose of disabling qt and building without it).

As an aside, sure, perhaps it should be moved and the derivation could use strictDeps = true; to enforce it, but that's not what I'm trying to address in this PR.

@doronbehar
Copy link
Contributor

@arcnmx checkInputs were renamed to nativeCheckInputs a long time ago.

Well not really, afaik the build does work normally and the package isn't broken when enableQt = true. It's only when building without qt in any build inputs that the test needs to be removed/disabled (you could unconditionally add it to the check inputs but that would kind of defeat most of the purpose of disabling qt and building without it).

Right I misunderstood the purpose of this PR. In anycase, for sure checkInputs was renamed to nativeCheckInputs a long time ago and the checkInputs attribute should be removed from this expression which could benefit from nixfmt as well...

Why would you object adding it unconditionally to the nativeBuildInputs? Makes more sense to me.

@wegank wegank added the 2.status: merge conflict This PR has merge conflicts with the target branch label Dec 10, 2024
@wegank wegank added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.status: merge conflict This PR has merge conflicts with the target branch 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants