Skip to content

Doesn't start on nixos (for me) #443

@0x53A

Description

@0x53A

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions