From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id +JuzIZUIb2C73gAAgWs5BA (envelope-from ) for ; Thu, 08 Apr 2021 15:43:49 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id 0P2sG5UIb2AZUAAAB5/wlQ (envelope-from ) for ; Thu, 08 Apr 2021 13:43:49 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 97496A2D3 for ; Thu, 8 Apr 2021 15:43:48 +0200 (CEST) Received: from localhost ([::1]:34602 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lUUwj-0007xc-Pi for larch@yhetil.org; Thu, 08 Apr 2021 09:43:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33140) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lUUw3-0007U3-1Y for bug-guix@gnu.org; Thu, 08 Apr 2021 09:43:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:34647) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lUUw2-0005Yg-Oe for bug-guix@gnu.org; Thu, 08 Apr 2021 09:43:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lUUw2-0007S8-MK for bug-guix@gnu.org; Thu, 08 Apr 2021 09:43:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#47655: QML2_IMPORT_PATH does not work in a profile Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Thu, 08 Apr 2021 13:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 47655 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 47655@debbugs.gnu.org X-Debbugs-Original-To: bug-guix Received: via spool by submit@debbugs.gnu.org id=B.161788935628613 (code B ref -1); Thu, 08 Apr 2021 13:43:02 +0000 Received: (at submit) by debbugs.gnu.org; 8 Apr 2021 13:42:36 +0000 Received: from localhost ([127.0.0.1]:46193 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lUUvb-0007RQ-Da for submit@debbugs.gnu.org; Thu, 08 Apr 2021 09:42:36 -0400 Received: from lists.gnu.org ([209.51.188.17]:34492) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lUUva-0007RJ-B1 for submit@debbugs.gnu.org; Thu, 08 Apr 2021 09:42:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33004) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lUUvZ-0007DD-O3 for bug-guix@gnu.org; Thu, 08 Apr 2021 09:42:34 -0400 Received: from mail-qv1-xf2b.google.com ([2607:f8b0:4864:20::f2b]:35387) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lUUvU-0005IE-JL for bug-guix@gnu.org; Thu, 08 Apr 2021 09:42:33 -0400 Received: by mail-qv1-xf2b.google.com with SMTP id x27so867473qvd.2 for ; Thu, 08 Apr 2021 06:42:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version; bh=TP+T7syveaVQN7L6W1tFWEmROAedhzRWoKJCWtHp3Ok=; b=X0S2x7IKXk2+ywqznJq1eLIiZw8tjAfSYvG8tZuXfEsZG8kJUpNZJeJO/P5uVzdjSI PFxnXk+u33WRiJAsYY+dbLNfpM1zyegj8GiGUN9LX35nciKIv/tbfEvuMqgaX5o8n5MR qa+7QNXdNPN73QGDbEuvJ2dwdrqW6NEXCf6CxnngCGcdUMxg0nQ8BuOupQNmZRdhFGeZ 204x7M9bvqiUFXIoKfI1eNmfCd+u4n/CK0JtuAZBcxV7D9ELLw7BvpwD7SsA7Wmsu0fK Iv2LtjQSPyAOoVhsBomZZ9uNBxHeElcAKky9BDNlwz/az4Iy5RvwoTQW09xmiKQhifcX ApRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=TP+T7syveaVQN7L6W1tFWEmROAedhzRWoKJCWtHp3Ok=; b=r+0L9I/tyygNwvbKxhexOWiTuANnZjMaAijczDxDTv9IYY+4IrttNUKR3eNHupZg3E y1fAuEWMgG4ONXiHioNVM6iJzLkEE8YUFBOTm7RI5YVlRbgMAU464LBQyaxjYnfJY12d 4RcamTuDaSFCGS3HgAP35DsJhxN9S4LGiai0nR4WHt2nRnwveWbUCdCkBnR/LpjJEds6 KuCzdrAPtVanymh1ZyjyNqzrmw2phzrpWFK9oiJILR+t6aj95u4YxBgTGAbPlzfrc9zJ ZdGt2DoO75hNuvkjvkE9PdrUlaIe2ygP5bL3VIWeGngHhS9kmWz93UTQKz6OFCb2ChVL Ujpw== X-Gm-Message-State: AOAM531qDIbb70TA8hvhQ+FWRqUZTchhs7QBKwHwZufC2RhctI7LP79p W8pbf0mTxOAUQwCpj81no9mrBV8sO9s= X-Google-Smtp-Source: ABdhPJw2o+5VtOayVR9gxvvIUgzFkyVprRC5gWP/E/I5a0jqMjeg1UTkFpxdjOgsF8q5NHhZQkz7QQ== X-Received: by 2002:a05:6214:a6c:: with SMTP id ef12mr9069545qvb.12.1617889346546; Thu, 08 Apr 2021 06:42:26 -0700 (PDT) Received: from hurd (mtl.savoirfairelinux.net. [208.88.110.46]) by smtp.gmail.com with ESMTPSA id 18sm21117551qkr.77.2021.04.08.06.42.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Apr 2021 06:42:26 -0700 (PDT) From: Maxim Cournoyer Date: Thu, 08 Apr 2021 09:42:24 -0400 Message-ID: <877dlcnb9b.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::f2b; envelope-from=maxim.cournoyer@gmail.com; helo=mail-qv1-xf2b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1617889428; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:list-id:list-help:list-unsubscribe:list-subscribe: list-post:dkim-signature; bh=TP+T7syveaVQN7L6W1tFWEmROAedhzRWoKJCWtHp3Ok=; b=CCRTvaGhzm9Y48JP9Yo+A6X1s9H4t8AB0eaPyNeGKRkCt/YOlhPdKlwcEK2tCmgdVUZpnn gfCVituKapCFTlWqYgl8S3IqsVuRvqjEQ3PzC5Ug2xicHxqIupkccltdztbDHDJscNqnLN pBJB/vxK+touO7pSqSGdVMzNal6y67DM2rCccnnIFwXAlHKFuIJ7qfRC8zIP9E3QC4eyNI HTI7qAeHyohl0TIYAP3J4Hp5J4dFuM8QyXaFihIXiUzWO3ct9aTjAS5eomgk0B2aqlexy2 I5BdhWhmJ0a87t2JqeiTY+lzryR261tHpt5S7UxOIL8qI5qyLGJa/I2GbKd/wg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1617889428; a=rsa-sha256; cv=none; b=YiYCNVSjXBtCfMBB8yBOTZubWiFkewLCd0W55PqNl5Mit7Q6D0E+VHJ1kNP5QPLXxcbcpD XErkxL9dho1TWuhiPOSxYUpKueP3ssem/WQTFA2MWgMS0HGH2Fg8sA9hYqd5qC1bDV9Wu4 XNTbYRKI6h346crgzMTeFqUsXO8APYrY2TWveM2+qqkB/Cns37q4fjAz1VHG91Oe8HnEnJ w3Pf21kUwCL2tpClwYyazksx4uQDM07TaMMhY0HcPbbQr56xAdnn4+uXSEFfhfM/p9oy8J LPczYqdAET6a5m1UaZ33PiywAeXj5W3UK0TNszSZ8SarXwFolKbUNNJnurXgKw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20161025 header.b=X0S2x7IK; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Spam-Score: -1.34 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20161025 header.b=X0S2x7IK; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Queue-Id: 97496A2D3 X-Spam-Score: -1.34 X-Migadu-Scanner: scn0.migadu.com X-TUID: 5baaqVRhRZXw Hello Guix, When setting up a profile (via 'guix environment', for example) to develop a Qt application, the search paths set by qtbase point to the environment profile, which is a forest of symbolic links. Apparently this doesn't play well with at least QML2_IMPORT_PATH: the Qt application built in the profile will not run, and Qt crashes in an inscrutable way. The following details a reproducer, which attempts to build jami-qt in its 'guix environment' profile. Reproduction steps: 1. Prepare the sources $ cp -r $(guix build -S jami-qt) /tmp/jami-qt-checkout $ cd /tmp/jami-qt-checkout $ chmod +rw -R . 2. Enter the development environment $ guix environment jami-qt 3. Create the build directory and bootstrap the build system $ mkdir build && cd build $ cmake .. -DCMAKE_INSTALL_PREFIX=$PWD/install 4. Build/install it locally. $ make -j8 install 5. Try to run it (if on a foreign distro rather than Guix System, you'll want to start the daemon, 'dring' from the libring package manually -- but that's another issue) --8<---------------cut here---------------start------------->8--- $ install/bin/jami-qt --debug No migration required Can't open file: "/home/maxim/.local/share/jami/d1c0b261a081d4ce/profile.vcf" Terminated --8<---------------cut here---------------end--------------->8--- The "Can't open file" warning is harmless and not at cause. >From a preliminary investigation, it appears to be caused by the fact that the QML2_IMPORT_PATH environment variable points to a profile entry, which is a forest of symbolic links: --8<---------------cut here---------------start------------->8--- $ echo $QML2_IMPORT_PATH /gnu/store/6i6d2zyxbkgmw20dk1ccsnwsdlnc8431-profile/lib/qt5/qml --8<---------------cut here---------------end--------------->8--- Compared to what's in the wrapper of the jami-qt packaged binary (which does run!): --8<---------------cut here---------------start------------->8--- $ cat $(guix build jami-qt)/bin/jami-qt | grep QML2 export QML2_IMPORT_PATH="/gnu/store/7lh6gpnv3aszlaa24az247xnnh2j8yaj-qtwebengine-5.15.2/lib/qt5/qml:/gnu/store/z9z83c3b3y655sjv3iv42pq70dwifv99-qtwebchannel-5.15.2/lib/qt5/qml:/gnu/store/xzyjqlycxwys0fq6pgs5v5n24n7zgddl-qtmultimedia-5.15.2/lib/qt5/qml:/gnu/store/ry4k8i6j3y9h4ws48jc8wsc5gky7phaj-qtdeclarative-5.15.2/lib/qt5/qml:/gnu/store/9p2xxq0cwmycf9k6rcljk8bn0d3sl2n7-qtgraphicaleffects-5.15.2/lib/qt5/qml:/gnu/store/32c7xbjmx6ijb6fl5kkbvpq2p2pxs54c-qtquickcontrols-5.15.2/lib/qt5/qml:/gnu/store/52x80xcnh912v76i09f1gaqpll5v2n73-qtquickcontrols2-5.15.2/lib/qt5/qml" --8<---------------cut here---------------end--------------->8--- Due to having been captured at build time, where there was no profile involved, the individual components have been added and no symbolic links is involved. If we try to run our custom built jami-qt with this variable set, it proceeds a bit further: --8<---------------cut here---------------start------------->8--- $ export QML2_IMPORT_PATH="/gnu/store/7lh6gpnv3aszlaa24az247xnnh2j8yaj-qtwebengine-5.15.2/lib/qt5/qml:/gnu/store/z9z83c3b3y655sjv3iv42pq70dwifv99-qtwebchannel-5.15.2/lib/qt5/qml:/gnu/store/xzyjqlycxwys0fq6pgs5v5n24n7zgddl-qtmultimedia-5.15.2/lib/qt5/qml:/gnu/store/ry4k8i6j3y9h4ws48jc8wsc5gky7phaj-qtdeclarative-5.15.2/lib/qt5/qml:/gnu/store/9p2xxq0cwmycf9k6rcljk8bn0d3sl2n7-qtgraphicaleffects-5.15.2/lib/qt5/qml:/gnu/store/32c7xbjmx6ijb6fl5kkbvpq2p2pxs54c-qtquickcontrols-5.15.2/lib/qt5/qml:/gnu/store/52x80xcnh912v76i09f1gaqpll5v2n73-qtquickcontrols2-5.15.2/lib/qt5/qml" $ install/bin/jami-qt --debug No migration required Can't open file: "/home/maxim/.local/share/jami/d1c0b261a081d4ce/profile.vcf" QQmlApplicationEngine failed to load component qrc:/src/MainApplicationWindow.qml:39:1: Type ApplicationWindow unavailable file:///gnu/store/66w3pq3zq6dqc6khg3i0fly31i8drws7-qtquickcontrols2-5.15.2/lib/qt5/qml/QtQuick/Controls.2/qmldir: plugin cannot be loaded for module ".gnu.store.66w3pq3zq6dqc6khg3i0fly31i8drws7-qtquickcontrols2-5.15.2.lib.qt5.qml.QtQuick.Controls": Module namespace 'QtQuick.Controls' does not match import URI '.gnu.store.66w3pq3zq6dqc6khg3i0fly31i8drws7-qtquickcontrols2-5.15.2.lib.qt5.qml.QtQuick.Controls' lookup name NOT FOUND: "" "5534e909984953c9" lookup name NOT FOUND: "" "5534e909984953c9" lookup name NOT FOUND: "" "5534e909984953c9" lookup name NOT FOUND: "" "5534e909984953c9" lookup name NOT FOUND: "" "5534e909984953c9" lookup name NOT FOUND: "" "dc553d8268bba4bd" lookup name NOT FOUND: "" "dc553d8268bba4bd" NetworkManager client initialized, version: 1.24.0 , daemon running: yes , networking enabled: yes primary network connection: faee05bd-57e1-46d1-824a-4f90a067d472 default: yes --8<---------------cut here---------------end--------------->8--- It still fails to draw the window, probably due to the load error above, which appears to be caused by a file name mismatch between what was registered in the application at compile time and what is being loaded (my guess). The QML_IMPORT_TRACE variable can also be set to get a more verbose output from the QML import machinery: --8<---------------cut here---------------start------------->8--- $ unset QML2_IMPORT_PATH $ source $GUIX_ENVIRONMENT/etc/profile $ export QML_IMPORT_TRACE=1 $ install/bin/jami-qt --debug QQmlImportDatabase::addImportPath: "/gnu/store/6i6d2zyxbkgmw20dk1ccsnwsdlnc8431-profile/lib/qt5/qml" QQmlImportDatabase::addImportPath: "/gnu/store/6i6d2zyxbkgmw20dk1ccsnwsdlnc8431-profile/lib/qt5/qml" QQmlImportDatabase::addImportPath: "qrc:/qt-project.org/imports" QQmlImportDatabase::addImportPath: "/tmp/jami-qt-checkout/build/install/bin" No migration required Can't open file: "/home/maxim/.local/share/jami/d1c0b261a081d4ce/profile.vcf" QQmlImports(qrc:/src/MainApplicationWindow.qml)::addLibraryImport: "QtQuick" 2.14 as "" QQmlImports(qrc:/src/MainApplicationWindow.qml)::importExtension: loaded "/gnu/store/6i6d2zyxbkgmw20dk1ccsnwsdlnc8431-profile/lib/qt5/qml/QtQuick.2/qmldir" QQmlImportDatabase::registerPluginTypes: "QtQuick" from "/gnu/store/6i6d2zyxbkgmw20dk1ccsnwsdlnc8431-profile/lib/qt5/qml/QtQuick.2" QQmlImports(qrc:/src/MainApplicationWindow.qml)::addLibraryImport: "QtQuick.Window" 2.14 as "" QQmlImports(qrc:/src/MainApplicationWindow.qml)::importExtension: loaded "/gnu/store/6i6d2zyxbkgmw20dk1ccsnwsdlnc8431-profile/lib/qt5/qml/QtQuick/Window.2/qmldir" QQmlImportDatabase::registerPluginTypes: "QtQuick.Window" from "/gnu/store/6i6d2zyxbkgmw20dk1ccsnwsdlnc8431-profile/lib/qt5/qml/QtQuick/Window.2" QQmlImports(qrc:/src/MainApplicationWindow.qml)::addLibraryImport: "QtQuick.Controls" 2.14 as "" QQmlImports(qrc:/src/MainApplicationWindow.qml)::importExtension: loaded "/gnu/store/6i6d2zyxbkgmw20dk1ccsnwsdlnc8431-profile/lib/qt5/qml/QtQuick/Controls.2/qmldir" QQmlImportDatabase::registerPluginTypes: "QtQuick.Controls" from "/gnu/store/6i6d2zyxbkgmw20dk1ccsnwsdlnc8431-profile/lib/qt5/qml/QtQuick/Controls.2" Terminated --8<---------------cut here---------------end--------------->8--- An idea of something to investigate would be to review the code dealing with importing the QML modules in the qtdeclarative sources, and ensuring that it applies QDir::canonicalPath everytime it's handling an import file name (to deal with the actual file rather than a symlink pointing to it). Thoughts? Thanks, Maxim