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

ckb: currently broken due to recent Qt5 changes #30519

Closed
kierdavis opened this issue Oct 17, 2017 · 12 comments
Closed

ckb: currently broken due to recent Qt5 changes #30519

kierdavis opened this issue Oct 17, 2017 · 12 comments

Comments

@kierdavis
Copy link
Contributor

kierdavis commented Oct 17, 2017

Issue description

ckb currently fails on startup with the following message:

This application failed to start because it could not find or load the Qt platform plugin "xcb" in "".

Reinstalling the application may fix this problem.

I believe it's looking for libqxcb.so, which is currently located at /nix/store/kgvmhibzszc84p2ddzbhhsw54pdb8awh-qtbase-5.9.2-bin/lib/qt-5.9/plugins/platforms/libqxcb.so.

git bisect revealed that this problem has been present since commit 6fa4178.

I've not been keeping up with the recent changes to Qt5 - what's the most canonical way to fix this and allow ckb to find the xcb plugin again?

Steps to reproduce

cd <nixpkgs>
nix-build -A ckb
result/bin/ckb

Technical details

  • System: 17.03.1862.ea06690f1f (Gorilla)
  • Nix version: 1.11.14
  • Nixpkgs version: master as of the time of writing (b304695)
  • Sandboxing enabled: no
@NickHu
Copy link
Contributor

NickHu commented Oct 23, 2017

This seems to be the same issue as #30713

@kierdavis
Copy link
Contributor Author

cc Qt5.9 maintainers: @qknight @ttuegel @periklis

@lukateras
Copy link
Member

Can't reproduce:

  • System: 18.03pre118631.66b63d2f5a (Impala)
  • Nix version: 1.11.15
  • Nixpkgs version: e2edcca
  • Sandboxing enabled: yes

@GallagherCommaJack
Copy link

GallagherCommaJack commented Nov 16, 2017

Reproduced with slightly different error:

This application failed to start because it could not find or load the Qt platform plugin "xcb" in "".

Available platform plugins are: minimal, offscreen, vnc, xcb, wayland-org.kde.kwin.qpa.

Reinstalling the application may fix this problem.
  • System: 17.09.2075.ac35504065 (Hummingbird)
  • Nix version: 1.11.15
  • Sandboxing enabled: no

(I would include nixpkgs version, but I don't actually know how to find that out)

@lukateras
Copy link
Member

lukateras commented Nov 16, 2017

@GallagherCommaJack Nixpkgs version is important in this case. Could you please run:

nix-shell -p nix-info --run 'nix-info -m'

@GallagherCommaJack
Copy link

GallagherCommaJack commented Nov 16, 2017

Uh, this is the output from that command, both with and without sudo:

 - system: `"x86_64-linux"`
 - host os: `Linux 4.9.61, NixOS, 17.09.2075.ac35504065 (Hummingbird)`
 - multi-user?: `yes`
 - sandbox: `no`
 - version: `nix-env (Nix) 1.11.15`
 - channels(jack): `"unstable-18.03pre120398.aeff3080d0"`
 - channels(root): `"nixos-17.09.2075.ac35504065"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs`

EDIT:
In the nixpkgs directory there's a file called svn-revision. Contents:

.2075.ac35504065

@GallagherCommaJack
Copy link

GallagherCommaJack commented Nov 16, 2017

Distressingly enough, this wasn't fixed by rolling back to a previous configuration built on Nov 1 when I wasn't having this problem.

@kierdavis
Copy link
Contributor Author

After finally getting round to upgrading to 17.09, I can't reproduce anymore.

NixOS version: 17.09.2075.ac35504065 (Hummingbird)
Nix version: 1.11.15
nixpkgs version: ac35504

Output of nix-info -m:

- system: `"x86_64-linux"`
- host os: `Linux 4.9.61, NixOS, 17.09.2075.ac35504065 (Hummingbird)`
- multi-user?: `yes`
- sandbox: `no`
- version: `nix-env (Nix) 1.11.15`
- channels(root): `"nixos-17.09.2075.ac35504065"`
- channels(kier): `""`
- nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs`

@kierdavis
Copy link
Contributor Author

I think I may have a lead.

I currently have (at least) two instances of ckb in my store: one built from nixpkgs ac35504 as part of my NixOS build, and one built from nixpkgs master (963204e) just now. The former works fine, while the latter exhibits this issue. Comparing the contents of the store paths shows that the working one contains a file named /nix/store/.../nix-support/propagated-native-build-inputs, which contains a reference to /nix/store/i1mgik5x2f8akjwhjcd0r62259s89592-qtbase-5.9.1-bin. This is the package that contains libqxcb.so. The version of ckb that exhibits the missing plugin problem lacks this file, so I think it's very likely that this issue is caused by qtbase-bin not being recorded in the nix-support/propagated-native-build-inputs file.

The contents of <nixpkgs>/pkgs/tools/misc/ckb/default.nix are unchanged between these two versions of nixpkgs, so it seems this issue is due to a change elsewhere in nixpkgs. Now running a git bisect...

@orivej
Copy link
Contributor

orivej commented Nov 17, 2017

nix-build -A ckb
result/bin/ckb

This may work, but currently it is not supported for Qt applications. Also the unfortunate best practice on NixOS is not to install Qt into the user profile at all, so do not try nix-env -iA ckb, or use this workaround: #30551 (comment)

@GallagherCommaJack
Copy link

GallagherCommaJack commented Nov 17, 2017

Weirdly enough, I've got it working if I try to launch it from sudo su.
If I run sudo su, then nvim-qt (another command having the same issue), it opens.
If I run the same binary from my user account, it can't find xcb.

Removing user environment from the path also worked. So I guess that's the issue.

Is there a way to figure out what package is causing the issue?
EDIT: by trial and error, turns out I had installed Calibre as a user, which had pulled in QT and messed everything up.
Is there any reasonable way to install a QT application as a user and have it use root's QT? I guess I can just sudo nix-env -iA, but that feels dirty.

@orivej
Copy link
Contributor

orivej commented Nov 17, 2017

Likely there is a way to make ~/.nix-profile/lib/qt-5.9 disappear even when Qt is installed into the user env, but this may and likely will break Qt applications installed into the user env (unless system and user versions of Qt are exactly the same). Let's continue in #30551.

@orivej orivej closed this as completed Nov 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants