Doesn't start on nixos (for me)

Open
#443 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
cpp, nixos
Domain
desktop, devops

Research direction

Start with pkgs/vesc-tool/default.nix and compare the reported Nix diff with the package’s existing build and wrapper setup. Check what the added Qt, OpenGL, Mesa, and GBM dependencies and qtWrapperArgs configure for NixOS, then try launching with the proposed changes. Done means the main app opens on NixOS and the wrapper settings are understood well enough to explain and review.

Written by the indexing model from the issue text.

Description

When I clone the repo and start it, I get the "introduction", but the main app doesn't open. This seems to be related to QT and OpenGL contexts.

Here is the console output of a non-working run:

  lukas@nixos ~/s/vesc_tool (master)> nix run
  qt.qpa.wayland: EGL not available
  Warning: fallback to QtQuick software backend.
  kf.i18n: KLocalizedString: Using an empty domain, fix the code. msgid: "&Yes" msgid_plural: "" msgctxt: "@action:button"
  kf.i18n: KLocalizedString: Using an empty domain, fix the code. msgid: "&No" msgid_plural: "" msgctxt: "@action:button"
  failed to acquire GL context to resolve capabilities, using defaults..
  kf.i18n: KLocalizedString: Using an empty domain, fix the code. msgid: "&Yes" msgid_plural: "" msgctxt: "@action:button"
  kf.i18n: KLocalizedString: Using an empty domain, fix the code. msgid: "&Yes" msgid_plural: "" msgctxt: "@action:button"
  kf.i18n: KLocalizedString: Using an empty domain, fix the code. msgid: "&No" msgid_plural: "" msgctxt: "@action:button"
  qrc:/mobile/SetupWizardIMU.qml:89:5: QML Connections: Implicitly defined onFoo properties in Connections are deprecated. Use this syntax instead: function onFoo(<arguments>) { ... }
  qrc:/mobile/SetupWizardFoc.qml:656:21: QML TabButton: Binding loop detected for property "width"
  qrc:/mobile/SetupWizardFoc.qml:656:21: QML TabButton: Binding loop detected for property "width"
  qrc:/mobile/SetupWizardFoc.qml:656:21: QML TabButton: Binding loop detected for property "width"
  qrc:/mobile/SetupWizardFoc.qml:656:21: QML TabButton: Binding loop detected for property "width"
  qrc:/mobile/SetupWizardFoc.qml:640:13: QML TabBar: Binding loop detected for property "implicitWidth"
  qrc:/mobile/SetupWizardFoc.qml:640:13: QML TabBar: Binding loop detected for property "implicitWidth"
  qrc:/mobile/SetupWizardFoc.qml:640:13: QML TabBar: Binding loop detected for property "implicitWidth"
  qrc:/mobile/SetupWizardFoc.qml:640:13: QML TabBar: Binding loop detected for property "implicitWidth"
  qrc:/mobile/SetupWizardFoc.qml:656:21: QML TabButton: Binding loop detected for property "width"
  Could not load package archive resource. Please update the archive in order to use VESC packages.
  QFSFileEngine::open: No file name specified
  QFSFileEngine::open: No file name specified
  Param group "gpd" not found.
  WARNING (qrc:/mobile/Profiles.qml:91 ): qrc:/mobile/Profiles.qml:91:5: QML Dialog: Binding loop detected for property "implicitHeight"
  WARNING (qrc:/res/qml/WelcomeQmlPanel.qml:118 ): qrc:/res/qml/WelcomeQmlPanel.qml:118:5: QML Dialog: Binding loop detected for property "implicitHeight"
  WARNING (qrc:/mobile/SetupWizardFoc.qml:826 ): qrc:/mobile/SetupWizardFoc.qml:826:5: QML Dialog: Binding loop detected for property "implicitHeight"
  WARNING (qrc:/mobile/SetupWizardFoc.qml:767 ): qrc:/mobile/SetupWizardFoc.qml:767:5: QML Dialog: Binding loop detected for property "implicitHeight"
  WARNING (qrc:/mobile/SetupWizardFoc.qml:725 ): qrc:/mobile/SetupWizardFoc.qml:725:5: QML Dialog: Binding loop detected for property "implicitHeight"
  WARNING (qrc:/res/qml/WelcomeQmlPanel.qml:449 ): qrc:/res/qml/WelcomeQmlPanel.qml:449:5: QML Dialog: Binding loop detected for property "implicitHeight"
  WARNING (qrc:/mobile/SetupWizardFoc.qml:826 ): qrc:/mobile/SetupWizardFoc.qml:826:5: QML Dialog: Binding loop detected for property "implicitHeight"
  WARNING (qrc:/mobile/SetupWizardFoc.qml:767 ): qrc:/mobile/SetupWizardFoc.qml:767:5: QML Dialog: Binding loop detected for property "implicitHeight"
  WARNING (:0 ): composeAndFlush: QOpenGLContext creation failed
  WARNING (:0 ): composeAndFlush: makeCurrent() failed
  WARNING (:0 ): composeAndFlush: makeCurrent() failed
  WARNING (:0 ): composeAndFlush: makeCurrent() failed

With the help of AI I've got it working, this is the diff:

lukas@nixos ~/s/vesc_tool (master)> git diff --staged
diff --git a/pkgs/vesc-tool/default.nix b/pkgs/vesc-tool/default.nix
index 8e97296..a35960e 100644
--- a/pkgs/vesc-tool/default.nix
+++ b/pkgs/vesc-tool/default.nix
@@ -13,7 +13,10 @@
   cmake,
   copyDesktopItems,
   gcc-arm-embedded-7,
+  libgbm,
+  libGL,
   libsForQt5,
+  mesa,
   makeDesktopItem,
   stdenv,
   tree,
@@ -90,7 +93,16 @@ stdenv.mkDerivation {
     runHook postInstall
   '';

-  buildInputs = [ libsForQt5.qtbase ];
+  buildInputs = [
+    libGL
+    libsForQt5.qtbase
+    libsForQt5.qtwayland
+  ];
+
+  qtWrapperArgs = [
+    "--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ mesa libgbm ]}"
+    "--set __EGL_VENDOR_LIBRARY_DIRS ${mesa}/share/glvnd/egl_vendor.d"
+  ];

   nativeBuildInputs = [
     cmake

I could send a PR with that change, but I'm not sure what the qtWrapperArgs exactly do (without them it doesn't work)

Dominant language
C++
Stars
1.1k
Forks
703
Avg merge
1d 4h
Merged PRs (30d)
11

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from vedderb/vesc_tool

All issues in vedderb/vesc_tool

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.