NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.03k stars 14.03k forks source link

Ovito is broken [no Qt] #53421

Closed HaoZeke closed 5 years ago

HaoZeke commented 5 years ago

Issue description

The Ovito package nixpkgs.python37Packages.ovito is broken. This is likely not meant to be built in the pythonPackages portion of nix in any case, and I notice it is also not meant to run on hydra.

The Error

# No GUI
ovitos script/test.py
qt.qpa.plugin: Could not find the Qt platform plugin "xcb" in ""
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
# Or
ovito

Steps to reproduce

nix-env -i ovito
# Check commands above

An alternate way to reproduce this is with the following shell.nix file:

# shell.nix
{ pkgs ? import <nixpkgs> {} }:
with pkgs; # Don't keep writing pkgs.
  mkShell rec {
    buildInputs = [
    python37Packages.ovito
    ];
    shellHook = ''
        stty sane
        export TERM="xterm-256color"
                '';
}

Then simply run:

nix-shell shell.nix --run 'bash'

Technical details

:
  /nix/store/dqjjvs2zaj7h454k7zr1lyd7mh95k1vm-nix-info
copying path '/nix/store/dqjjvs2zaj7h454k7zr1lyd7mh95k1vm-nix-info' from 'https://cache.nixos.org'...
 - system: `"x86_64-linux"`
 - host os: `Linux 4.20.0-1-ck-haswell, Arch Linux, noversion`
 - multi-user?: `no`
 - sandbox: `no`
 - version: `nix-env (Nix) 2.1.3`
 - channels(haozeke): `"nixpkgs-19.03pre164964.b0f40b78513"`
 - nixpkgs: `/home/haozeke/.nix-defexpr/channels/nixpkgs`
veprbl commented 5 years ago

qt.qpa.plugin: Could not find the Qt platform plugin "xcb" in "" This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

This one is a common problem (#24256). A workaround, that I usually use, is to do nix-env -iA qt5.qtcore.

costrouc commented 5 years ago

@HaoZeke thank you for raising this issue. I was the one that packaged ovito for nixpkgs https://github.com/NixOS/nixpkgs/pull/46846.

I wish that ovito was built on hydra but it was stated that it takes too long to builld. Hopefully this changes with enough people voicing that they need the package.

I could not reproduce the issue that you had meaning that it most likely is the issue stated above with qt.

nix-shell -p ovito

I ran on commit eebd1a9263716a04689a37b6537e50801d376b5e from 1 day ago

HaoZeke commented 5 years ago

Thanks for packaging it! @costrouc. However I made a bit of a mistake in my bug report. The bug is when the package is run in a pure environment. Namely, the error is when you do:

nix-shell -p ovito --pure

The fix is also correspondingly trivial, I will add a pull request to get the exact dependencies listed.

HaoZeke commented 5 years ago

@verprbl I can't seem to run that command.

nix-env -iA qt5.qtcore
error: attribute 'qt5' in selection path 'qt5.qtcore' not found
veprbl commented 5 years ago

@HaoZeke Sorry, I meant qt5.qtbase.

HaoZeke commented 5 years ago

In that case, the issue needs further investigation. I cannot seem to get ovito to work in a pure environment, though it does build when I install qt systemwide.

veprbl commented 5 years ago

We should be able to fix this using #54525

matthewbauer commented 5 years ago

Closing as a duplicate of https://github.com/NixOS/nixpkgs/issues/42893.