From unknown Wed Jun 18 23:11:34 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#36376 <36376@debbugs.gnu.org> To: bug#36376 <36376@debbugs.gnu.org> Subject: Status: Application menu of desktop environment not automatically updated Reply-To: bug#36376 <36376@debbugs.gnu.org> Date: Thu, 19 Jun 2025 06:11:34 +0000 retitle 36376 Application menu of desktop environment not automatically upd= ated reassign 36376 guix submitter 36376 Ludovic Court=C3=A8s severity 36376 important thanks From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 25 10:12:53 2019 Received: (at submit) by debbugs.gnu.org; 25 Jun 2019 14:12:53 +0000 Received: from localhost ([127.0.0.1]:33129 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hfmBm-000091-Rw for submit@debbugs.gnu.org; Tue, 25 Jun 2019 10:12:53 -0400 Received: from lists.gnu.org ([209.51.188.17]:34797) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hfmBl-00008t-6C for submit@debbugs.gnu.org; Tue, 25 Jun 2019 10:12:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41412) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfmBk-0005Uj-62 for bug-Guix@gnu.org; Tue, 25 Jun 2019 10:12:49 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:470:142:3::e]:58229) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hfmBk-0007me-2s for bug-Guix@gnu.org; Tue, 25 Jun 2019 10:12:48 -0400 Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=53130 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hfmBh-0003Fx-CU for bug-Guix@gnu.org; Tue, 25 Jun 2019 10:12:46 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: bug-Guix@gnu.org Subject: Application menu of desktop environment not automatically updated X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 7 Messidor an 227 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Tue, 25 Jun 2019 16:12:44 +0200 Message-ID: <871rzhn483.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) This is not news to us, but as notes, the application menu of desktop environments is not automatically updated when a package is installed or removed. It=E2=80=99d be great if we could somehow notify the desktop environment. Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 27 11:20:54 2019 Received: (at control) by debbugs.gnu.org; 27 Jun 2019 15:20:54 +0000 Received: from localhost ([127.0.0.1]:39257 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hgWCk-0008Kf-6z for submit@debbugs.gnu.org; Thu, 27 Jun 2019 11:20:54 -0400 Received: from eggs.gnu.org ([209.51.188.92]:54027) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hgWCi-0008KR-Nl for control@debbugs.gnu.org; Thu, 27 Jun 2019 11:20:52 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:52182) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hgWCc-0002AA-5z for control@debbugs.gnu.org; Thu, 27 Jun 2019 11:20:47 -0400 Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=45796 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hgWCa-0007L8-DY for control@debbugs.gnu.org; Thu, 27 Jun 2019 11:20:45 -0400 Date: Thu, 27 Jun 2019 17:20:43 +0200 Message-Id: <87woh7xdf8.fsf@gnu.org> To: control@debbugs.gnu.org From: =?utf-8?Q?Ludovic_Court=C3=A8s?= Subject: control message for bug #36376 MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) severity 36376 important quit From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 03 17:46:25 2020 Received: (at 36376) by debbugs.gnu.org; 3 Nov 2020 22:46:25 +0000 Received: from localhost ([127.0.0.1]:46739 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ka54L-00026S-6n for submit@debbugs.gnu.org; Tue, 03 Nov 2020 17:46:25 -0500 Received: from eggs.gnu.org ([209.51.188.92]:45196) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ka54J-00026F-CG for 36376@debbugs.gnu.org; Tue, 03 Nov 2020 17:46:23 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:54087) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ka54C-0008FC-Iv; Tue, 03 Nov 2020 17:46:16 -0500 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=33372 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ka54C-0003FV-5a; Tue, 03 Nov 2020 17:46:16 -0500 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: 36376@debbugs.gnu.org Subject: Re: bug#36376: Application menu of desktop environment not automatically updated References: <871rzhn483.fsf@gnu.org> Date: Tue, 03 Nov 2020 23:46:13 +0100 In-Reply-To: <871rzhn483.fsf@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s=22'?= =?utf-8?Q?s?= message of "Tue, 25 Jun 2019 16:12:44 +0200") Message-ID: <87o8keawju.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 36376 Cc: Leo Prikler , Maxim Cournoyer X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Ludovic Court=C3=A8s skribis: > This is not news to us, but as > notes, the > application menu of desktop environments is not automatically updated > when a package is installed or removed. It=E2=80=99d be great if we could > somehow notify the desktop environment. We=E2=80=99ve investigated today on IRC with Maxim and Leo P. and here=E2= =80=99s the summary of our findings: =E2=80=A2 GNOME Shell, in =E2=80=98appDisplay.js=E2=80=99, =E2=80=9Cliste= ns=E2=80=9D to the =E2=80=98installed-changed=E2=80=99 GLib signals and uses that to rebui= ld its application menu. =E2=80=A2 In =E2=80=98shell-app-system.c=E2=80=99, =E2=80=98installed-cha= nged=E2=80=99 is emitted when the GAppInfoMonitor emits =E2=80=98changed=E2=80=99: monitor =3D g_app_info_monitor_get (); g_signal_connect (monitor, "changed", G_CALLBACK (installed_changed),= self); installed_changed (monitor, self); =E2=80=A2 GLib emits the =E2=80=98changed=E2=80=99 signal when =E2=80=98g= _app_info_monitor_fire=E2=80=99 is called from =E2=80=98desktop_file_dir_changed=E2=80=99, itself called w= hen one of the directories in $XDG_DATA_DIRS (among others) changes. It uses =E2=80=98GFileMonitor=E2=80=99 under the hood, which is essentially ino= tify. The GLib patch below is an attempt to monitor ~/.guix-profile and to treat changes to that symlink as if they were changes to ~/.guix-profile/share/applications (which contains =E2=80=98.desktop=E2=80= =99 files.) It actually builds but I haven=E2=80=99t tested it yet. :-) WDYT? If we take that route, we could add a =E2=80=98replacement=E2=80=99 for GLi= b. Thanks, Ludo=E2=80=99. --=-=-= Content-Type: text/x-patch Content-Disposition: inline diff --git a/gio/gdesktopappinfo.c b/gio/gdesktopappinfo.c index f1e2fdd..96dcc32 100644 --- a/gio/gdesktopappinfo.c +++ b/gio/gdesktopappinfo.c @@ -161,6 +161,7 @@ static DesktopFileDir *desktop_file_dir_user_config = NULL; /* (owned) */ static DesktopFileDir *desktop_file_dir_user_data = NULL; /* (owned) */ static GMutex desktop_file_dir_lock; static const gchar *gio_launch_desktop_path = NULL; +static GFileMonitor *guix_profile_monitor = NULL; /* Monitor 'changed' signal handler {{{2 */ static void desktop_file_dir_reset (DesktopFileDir *dir); @@ -230,6 +231,22 @@ desktop_file_dir_get_alternative_dir (DesktopFileDir *dir) return parent; } +static void +guix_profile_changed (GFileMonitor *monitor, + GFile *file, + GFile *other_file, + GFileMonitorEvent event_type, + gpointer user_data) +{ + DesktopFileDir *dir = user_data; + + desktop_file_dir_reset (dir); + + /* When ~/.guix-profile changes, emit the 'changed' signal so everyone + knows. */ + g_app_info_monitor_fire (); +} + static void desktop_file_dir_changed (GFileMonitor *monitor, GFile *file, @@ -1531,6 +1548,7 @@ desktop_file_dirs_lock (void) if (desktop_file_dirs == NULL || desktop_file_dirs->len == 0) { + const gchar *home; const char * const *dirs; gint i; @@ -1555,6 +1573,27 @@ desktop_file_dirs_lock (void) for (i = 0; dirs[i]; i++) g_ptr_array_add (desktop_file_dirs, desktop_file_dir_new (dirs[i])); + home = g_get_home_dir (); + if (guix_profile_monitor == NULL && home != NULL) + { + DesktopFileDir *dir; + const gchar *profile, *data_dir; + profile = g_build_filename (home, ".guix-profile", NULL); + data_dir = g_build_filename (profile, "share", NULL); + dir = desktop_file_dir_new (data_dir); + + /* Monitor ~/.guix-profile and treat modifications to + ~/.guix-profile as if they were modifications to + ~/.guix-profile/share. */ + guix_profile_monitor = + g_local_file_monitor_new_in_worker (profile, FALSE, G_FILE_MONITOR_NONE, + guix_profile_changed, + desktop_file_dir_ref (dir), + closure_notify_cb, NULL); + + g_ptr_array_add (desktop_file_dirs, desktop_file_dir_ref (dir)); + } + /* The list of directories will never change after this, unless * g_get_user_config_dir() changes due to %G_TEST_OPTION_ISOLATE_DIRS. */ desktop_file_dirs_config_dir = user_config_dir; --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 03 18:29:11 2020 Received: (at 36376) by debbugs.gnu.org; 3 Nov 2020 23:29:11 +0000 Received: from localhost ([127.0.0.1]:46785 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ka5jj-0005HJ-5Q for submit@debbugs.gnu.org; Tue, 03 Nov 2020 18:29:11 -0500 Received: from mailrelay.tugraz.at ([129.27.2.202]:57366) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ka5jT-0005GX-AZ for 36376@debbugs.gnu.org; Tue, 03 Nov 2020 18:29:10 -0500 Received: from nijino.local (217-149-162-161.nat.highway.telekom.at [217.149.162.161]) by mailrelay.tugraz.at (Postfix) with ESMTPSA id 4CQmFH67jhz3wL9; Wed, 4 Nov 2020 00:28:51 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tugraz.at; s=mailrelay; t=1604446132; bh=DXBC852UUZuriZvSGdnCQA3qSyV0l2N7Mxik5N3f2dY=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=j2tgtT1o+ViOa564M0c8hW/jnmNu257R54hgO4A1a41d9gnzS7G7orZMuL1vsXBls GZ/LxCQvi7bJc0ycmf+2h37dfAd27EL7T/7daLV6w3905Ps8quLMKMnx3+1mmnPaIB opIa16RaETi5F6I2ARfOQn1CHybgoRNkAKP1rPqg= Message-ID: <63d4101b796673602872997b7680d6b04a189de3.camel@student.tugraz.at> Subject: Re: bug#36376: Application menu of desktop environment not automatically updated From: Leo Prikler To: Ludovic =?ISO-8859-1?Q?Court=E8s?= , 36376@debbugs.gnu.org Date: Wed, 04 Nov 2020 00:28:51 +0100 In-Reply-To: <87o8keawju.fsf@gnu.org> References: <871rzhn483.fsf@gnu.org> <87o8keawju.fsf@gnu.org> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.34.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TUG-Backscatter-control: bt4lQm5Tva3SBgCuw0EnZw X-Spam-Scanner: SpamAssassin 3.003001 X-Spam-Score-relay: -1.9 X-Scanned-By: MIMEDefang 2.74 on 129.27.10.116 X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 36376 Cc: Maxim Cournoyer X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi Ludo, Am Dienstag, den 03.11.2020, 23:46 +0100 schrieb Ludovic Courtès: > Ludovic Courtès skribis: > > > This is not news to us, but as > > notes, > > the > > application menu of desktop environments is not automatically > > updated > > when a package is installed or removed. It’d be great if we could > > somehow notify the desktop environment. > > We’ve investigated today on IRC with Maxim and Leo P. and here’s the > summary of our findings: Seeing my name thrown around more and more lately makes me blush a little. > [...] > > The GLib patch below is an attempt to monitor ~/.guix-profile and to > treat changes to that symlink as if they were changes to > ~/.guix-profile/share/applications (which contains ‘.desktop’ files.) > It actually builds but I haven’t tested it yet. :-) > > WDYT? Not having tested it either, I think that we should also listen on /run/current-system/ (if it exists), so that changes to the system as done by `reconfigure` are picked up. This includes most importantly changes to the GNOME ecosystem itself. Regards, Leo From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 04 15:55:31 2020 Received: (at control) by debbugs.gnu.org; 4 Nov 2020 20:55:31 +0000 Received: from localhost ([127.0.0.1]:50745 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kaPoY-0007DG-Uz for submit@debbugs.gnu.org; Wed, 04 Nov 2020 15:55:31 -0500 Received: from eggs.gnu.org ([209.51.188.92]:49392) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kaPoX-0007D3-Vr for control@debbugs.gnu.org; Wed, 04 Nov 2020 15:55:30 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:47131) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kaPoS-0001jl-MC for control@debbugs.gnu.org; Wed, 04 Nov 2020 15:55:24 -0500 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=57530 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kaPoS-000065-51 for control@debbugs.gnu.org; Wed, 04 Nov 2020 15:55:24 -0500 Date: Wed, 04 Nov 2020 21:55:22 +0100 Message-Id: <87lffg7sg5.fsf@gnu.org> To: control@debbugs.gnu.org From: =?utf-8?Q?Ludovic_Court=C3=A8s?= Subject: control message for bug #36376 MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) merge 36376 35594 quit From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 04 16:42:07 2020 Received: (at 36376) by debbugs.gnu.org; 4 Nov 2020 21:42:08 +0000 Received: from localhost ([127.0.0.1]:50819 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kaQXf-0004CC-HI for submit@debbugs.gnu.org; Wed, 04 Nov 2020 16:42:07 -0500 Received: from mail-qv1-f48.google.com ([209.85.219.48]:45716) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kaQXd-0004Bc-ME; Wed, 04 Nov 2020 16:42:06 -0500 Received: by mail-qv1-f48.google.com with SMTP id w5so10651799qvn.12; Wed, 04 Nov 2020 13:42:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=IUVs2FcsLpDo0mRLUJPPqOH8SkCfGj6g8fu6WRpeUN4=; b=TMjW7Z6v2bUO2UgEVJVBQci6y0erKRZilp+o96jeVF7pZ1vt4+DrYrOHJoYM1QRpfP 54HLDQVdLMCF3KtUbE47AxZW2psW95i+g0Nw3xh0hkVPK97KDP2CLCdXi3scR1XjrInI Y3OhOZTvXA4rJrsdRq++2ffwcRA+RdvbY9gCIFBYrzrwWVk3ASCXEyupqoFbLp2CDVEo RwqnNO1oLOeQegIOMHy1Hcx4vuQxTbEdtz8ib+JqkBR/QUvVNosXk7Pc2wXwm0OSW4ng 04YuvEXW1zYVT4RVLnEHuZFs4M1AY5a9re/bKyt3hg1UaRlhviUVMzqovUo96GD0KjEg /zGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=IUVs2FcsLpDo0mRLUJPPqOH8SkCfGj6g8fu6WRpeUN4=; b=i9dUbgl5B9x/WL8uiK/7UVDdHMDdp4W4na8f4u3jQdCpxQfGn6Lh8eHNk2jDwF/llf dKtf85XQ5rYIroYhZNNFjltPMTKCNYsbVk4jR9baJlPCMvAWjsCWJfrafcA9PL3ouvtT KyfblGMPM8GDPk7JfjrFFEyxpRbdYdI1Si4gAdU2Vl8vGQtYdyyTWC10M3xs3wO888PP jrQIvkaEfyevG85yxOroKUj4sVF0qKYj1/J8B5Oh4NZd+yNEkX+05GY5EJPDmfnbRKik CITLKx3WHXjiH/zWMGfcgRkNEZjAI4aQZbhvBTPNqegZKArFpxcQP2TzB+NroHXWRx+D e++A== X-Gm-Message-State: AOAM533rPpLMXR+ATU/3F06wk0sa9bZdVMzmGSKUcZyyVxI5UiiGxIds CJ7VVCt2IuQS6CXrdZDZ/XXVFyUYTd8= X-Google-Smtp-Source: ABdhPJxYwOTfpXfagHsnYqVEw6248ZNzmQ3Sfr1mr4QYPnKx4SonL1vuN377YvqDY5JbFalgQrMPCQ== X-Received: by 2002:a0c:edb1:: with SMTP id h17mr32651997qvr.7.1604526119830; Wed, 04 Nov 2020 13:41:59 -0800 (PST) Received: from hurd (dsl-154-213.b2b2c.ca. [66.158.154.213]) by smtp.gmail.com with ESMTPSA id z2sm652021qkg.76.2020.11.04.13.41.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Nov 2020 13:41:59 -0800 (PST) From: Maxim Cournoyer To: Leo Prikler Subject: Re: bug#36376: Application menu of desktop environment not automatically updated References: <871rzhn483.fsf@gnu.org> <87o8keawju.fsf@gnu.org> <63d4101b796673602872997b7680d6b04a189de3.camel@student.tugraz.at> Date: Wed, 04 Nov 2020 16:41:58 -0500 In-Reply-To: <63d4101b796673602872997b7680d6b04a189de3.camel@student.tugraz.at> (Leo Prikler's message of "Wed, 04 Nov 2020 00:28:51 +0100") Message-ID: <87v9ekyf2x.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 36376 Cc: Ludovic =?utf-8?Q?Court=C3=A8s?= , 35594@debbugs.gnu.org, 36376@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello Ludovic and Leo, Leo Prikler writes: > Hi Ludo, > > Am Dienstag, den 03.11.2020, 23:46 +0100 schrieb Ludovic Court=C3=A8s: >> Ludovic Court=C3=A8s skribis: >>=20 >> > This is not news to us, but as >> > notes, >> > the >> > application menu of desktop environments is not automatically >> > updated >> > when a package is installed or removed. It=E2=80=99d be great if we c= ould >> > somehow notify the desktop environment. >>=20 >> We=E2=80=99ve investigated today on IRC with Maxim and Leo P. and here= =E2=80=99s the >> summary of our findings: > Seeing my name thrown around more and more lately makes me blush a > little. >> [...] >>=20 >> The GLib patch below is an attempt to monitor ~/.guix-profile and to >> treat changes to that symlink as if they were changes to >> ~/.guix-profile/share/applications (which contains =E2=80=98.desktop=E2= =80=99 files.) >> It actually builds but I haven=E2=80=99t tested it yet. :-) >>=20 >> WDYT? Pretty cool! It'd keep on working even if we even clean up /etc/profile from the hardcoded defauts environment variables (say, if we merge one of the proposed solution of https://issues.guix.gnu.org/22138). > Not having tested it either, I think that we should also listen on > /run/current-system/ (if it exists), so that changes to the system as > done by `reconfigure` are picked up. This includes most importantly > changes to the GNOME ecosystem itself. I agree that it seems useful and important to add a monitor on the /run/current-system as well. Thank you! Maxim From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 04 17:15:35 2020 Received: (at 36376) by debbugs.gnu.org; 4 Nov 2020 22:15:35 +0000 Received: from localhost ([127.0.0.1]:50845 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kaR42-00077S-Q1 for submit@debbugs.gnu.org; Wed, 04 Nov 2020 17:15:35 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35860) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kaR3z-00077D-Mm for 36376@debbugs.gnu.org; Wed, 04 Nov 2020 17:15:33 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:48201) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kaR3p-0003Qe-Ly; Wed, 04 Nov 2020 17:15:22 -0500 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=60192 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kaR3p-0006Ej-1s; Wed, 04 Nov 2020 17:15:21 -0500 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Leo Prikler Subject: Re: bug#36376: Application menu of desktop environment not automatically updated References: <871rzhn483.fsf@gnu.org> <87o8keawju.fsf@gnu.org> <63d4101b796673602872997b7680d6b04a189de3.camel@student.tugraz.at> Date: Wed, 04 Nov 2020 23:15:19 +0100 In-Reply-To: <63d4101b796673602872997b7680d6b04a189de3.camel@student.tugraz.at> (Leo Prikler's message of "Wed, 04 Nov 2020 00:28:51 +0100") Message-ID: <878sbg7oqw.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 36376 Cc: Maxim Cournoyer , 36376@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi! Leo Prikler skribis: > Am Dienstag, den 03.11.2020, 23:46 +0100 schrieb Ludovic Court=C3=A8s: >> Ludovic Court=C3=A8s skribis: >>=20 >> > This is not news to us, but as >> > notes, >> > the >> > application menu of desktop environments is not automatically >> > updated >> > when a package is installed or removed. It=E2=80=99d be great if we c= ould >> > somehow notify the desktop environment. >>=20 >> We=E2=80=99ve investigated today on IRC with Maxim and Leo P. and here= =E2=80=99s the >> summary of our findings: > Seeing my name thrown around more and more lately makes me blush a > little. Heheh, you provided useful hints! >> The GLib patch below is an attempt to monitor ~/.guix-profile and to >> treat changes to that symlink as if they were changes to >> ~/.guix-profile/share/applications (which contains =E2=80=98.desktop=E2= =80=99 files.) >> It actually builds but I haven=E2=80=99t tested it yet. :-) >>=20 >> WDYT? > Not having tested it either, I think that we should also listen on > /run/current-system/ (if it exists), so that changes to the system as > done by `reconfigure` are picked up. This includes most importantly > changes to the GNOME ecosystem itself. Like I wrote in the related bug, I think /run/current-system is less important because it typically doesn=E2=80=99t change much: https://issues.guix.gnu.org/35594#6 But I guess I=E2=80=99m also being a bit lazy=E2=80=A6 Anyhow, I=E2=80=99ve tested the patch in =E2=80=98guix system vm gnu/system/examples/desktop.tmpl=E2=80=99, with a =E2=80=98glib=E2=80=99 re= placement as shown below. I strace=E2=80=99d the user=E2=80=99s gnome-shell and ran: ln -s /run/current-system/profile ~/.guix-profile The trace showed that this led gnome-shell to traverse files in ~/.guix-profile/share (not just the applications/ sub-directory.) I wanted to test =E2=80=98guix install=E2=80=99 for real, which meant doing= it on =E2=80=98guix system vm-image=E2=80=99, but that took too long; so I tried =E2=80=98disk-= image -t qcow2=E2=80=99 instead but partition.img.drv fails. So I haven=E2=80=99t b= een able to actually test with =E2=80=98guix install=E2=80=99. Anyway, here=E2=80=99s the Guix patch. You need to drop the GLib patch in = the right place. Thanks, Ludo=E2=80=99. --=-=-= Content-Type: text/x-patch Content-Disposition: inline diff --git a/gnu/packages/glib.scm b/gnu/packages/glib.scm index bba9461d44..1c0de6eaed 100644 --- a/gnu/packages/glib.scm +++ b/gnu/packages/glib.scm @@ -181,6 +181,7 @@ shared NFS home directories.") (package (name "glib") (version "2.62.6") + (replacement glib-with-gio-patch) (source (origin (method url-fetch) (uri (string-append "mirror://gnome/sources/" @@ -387,6 +388,14 @@ dynamic loading, and an object system.") (home-page "https://developer.gnome.org/glib/") (license license:lgpl2.1+))) +(define glib-with-gio-patch + (package + (inherit glib) + (source (origin + (inherit (package-source glib)) + (patches (append (search-patches "glib-appinfo-watch.patch") + (origin-patches (package-source glib)))))))) + (define-public glib-with-documentation ;; glib's doc must be built in a separate package since it requires gtk-doc, ;; which in turn depends on glib. diff --git a/gnu/system/examples/desktop.tmpl b/gnu/system/examples/desktop.tmpl index 716b9feb8d..4797111c67 100644 --- a/gnu/system/examples/desktop.tmpl +++ b/gnu/system/examples/desktop.tmpl @@ -4,7 +4,7 @@ (use-modules (gnu) (gnu system nss)) (use-service-modules desktop xorg) -(use-package-modules certs gnome) +(use-package-modules certs gnome linux) (operating-system (host-name "antelope") @@ -57,7 +57,8 @@ ;; for HTTPS access nss-certs ;; for user mounts - gvfs) + gvfs + strace) %base-packages)) ;; Add GNOME and Xfce---we can choose at the log-in screen @@ -65,7 +66,6 @@ ;; include the X11 log-in service, networking with ;; NetworkManager, and more. (services (append (list (service gnome-desktop-service-type) - (service xfce-desktop-service-type) (set-xorg-configuration (xorg-configuration (keyboard-layout keyboard-layout)))) --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 04 17:28:34 2020 Received: (at control) by debbugs.gnu.org; 4 Nov 2020 22:28:34 +0000 Received: from localhost ([127.0.0.1]:50878 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kaRGc-0007SA-Em for submit@debbugs.gnu.org; Wed, 04 Nov 2020 17:28:34 -0500 Received: from mail-qt1-f176.google.com ([209.85.160.176]:37513) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kaRGa-0007Rt-Mf for control@debbugs.gnu.org; Wed, 04 Nov 2020 17:28:32 -0500 Received: by mail-qt1-f176.google.com with SMTP id n63so195877qte.4 for ; Wed, 04 Nov 2020 14:28:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:message-id:to:from:subject; bh=1en13TYDxZ467ZDvrVMo+LVOPmY8oyApK3N0k8uCEzM=; b=vRVlPB9DX1AUy/EExMx0cPNzslnEOSmpJJSJemDFwgC65GMlXE6fHRZ+7DY96/4coN 9tno4sG/bKyABt8lQmCaGQmwFoVRBfrrK9hJ7Xf5ekOXFpcCo3MO6zF7AeJGoKw2zDl6 v5XGeKaz+6OEnj5xyggOCd8myeGKzzuaPXH9Yj8dpcRPFmULEhVwiHkja1LW3Hgg52zE 8T67WxwGi9DYG5PvvTPH7w0fK0CpoC/rfr+wwa0fyhtRdBQgbOkLXso7IGtnbto5fgXp yv1jA7majw6aYmrI7vPJx1PJPKqFvqHGosEMjxU3NSLHHq0W8jTwn+zK7xoLnpVhLm2m kZ3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:to:from:subject; bh=1en13TYDxZ467ZDvrVMo+LVOPmY8oyApK3N0k8uCEzM=; b=BsKet/MuVY1T1WdACTBXCkud7KmavihKMvVIAA9BFdR5cSp8zejVvLwVkd0r12gQl6 r6txvGm5/uWKEhiJk/yeK6lPwGxsfgFvSi0ae8oVBgm0om53cESUeibAPXjb9v4CHu+E AbhZbqdxw5dnHFsmeIc+NWUOGnV4TltOJIDDjghTLOlV7sO8gN/iywGrwHMP/eOGg/dL eDVfKqdEIJ1fzGkhbDCcZhtSeTN4d7xSkBPr9jKfTClSbhjE1Z3oToC3vrK/c63JS5qb dhvxYjJJHLgdGEZiNwBSBNxxysntLjsxcZngKOESXNUJQmQITJw8iYJn/LvP7SCxo5eW pd6w== X-Gm-Message-State: AOAM531KieVzLBftcHme+vHAFxdAMD47bsxeLGlxKuYpV1tmvBEQ4Mdr mbG4coVDaMy3ix60pXRD8+ULiS6yU3s= X-Google-Smtp-Source: ABdhPJzF10imXcmR7Q2/ovnJ8wVirZNlcCpG1iaxOCcVEjfG3PGL1/fKFexQs+qlduDfsvBSd/3QPA== X-Received: by 2002:aed:3809:: with SMTP id j9mr246050qte.197.1604528907225; Wed, 04 Nov 2020 14:28:27 -0800 (PST) Received: from hurd (dsl-154-213.b2b2c.ca. [66.158.154.213]) by smtp.gmail.com with ESMTPSA id k145sm3422323qke.79.2020.11.04.14.28.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Nov 2020 14:28:26 -0800 (PST) Date: Wed, 04 Nov 2020 17:28:26 -0500 Message-Id: <87r1p8ycxh.fsf@gmail.com> To: control@debbugs.gnu.org From: Maxim Cournoyer Subject: control message for bug #41298 X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) merge 41298 35594 quit From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 05 01:38:44 2020 Received: (at 36376) by debbugs.gnu.org; 5 Nov 2020 06:38:44 +0000 Received: from localhost ([127.0.0.1]:51435 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kaYuy-00058b-15 for submit@debbugs.gnu.org; Thu, 05 Nov 2020 01:38:44 -0500 Received: from mail-qk1-f182.google.com ([209.85.222.182]:43375) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kaYut-00058H-5K for 36376@debbugs.gnu.org; Thu, 05 Nov 2020 01:38:42 -0500 Received: by mail-qk1-f182.google.com with SMTP id c27so308288qko.10 for <36376@debbugs.gnu.org>; Wed, 04 Nov 2020 22:38:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=n5fHk39gePngqUMz7uj/aMa3LUtQUcmq+UKYxHAk3PE=; b=RaiGf/ggAqoFgmBYfuUYkAsuyXkQjryxJjiFS+RQXdfoXpGK4e7myo7/Shl5QeRK4+ btpOsBVgMgtiDdYE3/EfXFi6TKptJD+s7Awte9OBc2Krd5iKntbgXAlYds7HK/F0n9/5 /TsMZ09clLqykpR/INivD4xpDURg1bBx9YG7oKkLg9F4YhXAgltodmc1vUNyVWczSaGZ CBYx1/FmBJAX1nXihcxhdS8EzK0xygqQS7HhGrsvnG8UXZtICeOFvvDfHhQj36QfI3jv oY6gRPF9FQ2huJK792PsZPTCJFI8+w2EBkmpdMIg8MG2mobtjsOwvOQBtej1aj6PUzMQ WK1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=n5fHk39gePngqUMz7uj/aMa3LUtQUcmq+UKYxHAk3PE=; b=Y6AkoMeP9TFgmMDfllzuEUxj+igTb+J+8d2vthpyk1txg8/U+ermznWN9QsF7MVRm4 OEwp6QjMCOOOb05Pf4p5rHxvtQAGJqRykOydV5+080fUzm46NndNTYxn/GajdBq4ej2v F0H1yIgYFhteKLnDVpySYQLpIYq0+IrexC/TIMOIcSrUzvq2aWRG8/NXI7crqkQkbxgP Wosx84SAPeBnsvWa0QHFOjU5QFypBTLZBB0JLIJWKkQ1hY9eqK5NTcFoYAWDBLwc7GZY 0iMq34ddNOzfu4gH7YnOJB9Pt6n3sCaf83D2u/XtAuQJijCdlu13xk50XwABjbOGz5AR rPSg== X-Gm-Message-State: AOAM5311RwG269gx9UYsF/JUWXYKmHOETAJ+M/g0d/CHDs7nXX9GeV/C xA1xlp3gwzvVFX7utyuVX3g= X-Google-Smtp-Source: ABdhPJyE4x9XL8cShYDxFm7Niswmi3loiBrBSf6b8ebQATG1kQjPhvOEjtesSN7O5WSgxJuuXJcOGw== X-Received: by 2002:ae9:f444:: with SMTP id z4mr778696qkl.338.1604558313643; Wed, 04 Nov 2020 22:38:33 -0800 (PST) Received: from hurd (dsl-154-213.b2b2c.ca. [66.158.154.213]) by smtp.gmail.com with ESMTPSA id q1sm331069qti.95.2020.11.04.22.38.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Nov 2020 22:38:32 -0800 (PST) From: Maxim Cournoyer To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: bug#36376: Application menu of desktop environment not automatically updated References: <871rzhn483.fsf@gnu.org> <87o8keawju.fsf@gnu.org> Date: Thu, 05 Nov 2020 01:38:25 -0500 In-Reply-To: <87o8keawju.fsf@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s=22'?= =?utf-8?Q?s?= message of "Tue, 03 Nov 2020 23:46:13 +0100") Message-ID: <87d00swboe.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 36376 Cc: Leo Prikler , 36376@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Hi Ludovic! > +static void > +guix_profile_changed (GFileMonitor *monitor, > + GFile *file, > + GFile *other_file, > + GFileMonitorEvent event_type, > + gpointer user_data) > +{ > + DesktopFileDir *dir = user_data; > + > + desktop_file_dir_reset (dir); > + > + /* When ~/.guix-profile changes, emit the 'changed' signal so everyone > + knows. */ > + g_app_info_monitor_fire (); > +} > + > static void > desktop_file_dir_changed (GFileMonitor *monitor, > GFile *file, > @@ -1531,6 +1548,7 @@ desktop_file_dirs_lock (void) > > if (desktop_file_dirs == NULL || desktop_file_dirs->len == 0) > { > + const gchar *home; > const char * const *dirs; > gint i; > > @@ -1555,6 +1573,27 @@ desktop_file_dirs_lock (void) > for (i = 0; dirs[i]; i++) > g_ptr_array_add (desktop_file_dirs, desktop_file_dir_new (dirs[i])); > > + home = g_get_home_dir (); > + if (guix_profile_monitor == NULL && home != NULL) > + { > + DesktopFileDir *dir; > + const gchar *profile, *data_dir; > + profile = g_build_filename (home, ".guix-profile", NULL); > + data_dir = g_build_filename (profile, "share", NULL); > + dir = desktop_file_dir_new (data_dir); > + > + /* Monitor ~/.guix-profile and treat modifications to > + ~/.guix-profile as if they were modifications to > + ~/.guix-profile/share. */ > + guix_profile_monitor = > + g_local_file_monitor_new_in_worker (profile, FALSE, G_FILE_MONITOR_NONE, > + guix_profile_changed, > + desktop_file_dir_ref (dir), > + closure_notify_cb, NULL); > + > + g_ptr_array_add (desktop_file_dirs, desktop_file_dir_ref (dir)); > + } > + > /* The list of directories will never change after this, unless > * g_get_user_config_dir() changes due to %G_TEST_OPTION_ISOLATE_DIRS. */ > desktop_file_dirs_config_dir = user_config_dir; I think the attached patch is an improvement over the above, by also supporting /run/current-system/share, being a bit simpler, and not adding extra monitors. I've reused the cool trick of passing FALSE to g_local_file_monitor_new_in_worker to force it to use its polling mode fallback. --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: attachment; filename=glib-appinfo-watch.patch Content-Transfer-Encoding: quoted-printable >From a79645c565e56ac201e66936d9f9883ad9387b06 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Thu, 5 Nov 2020 00:24:29 -0500 Subject: [PATCH] gdesktopappinfo: Fix monitoring of a Guix profile XDG_DATA_DIR. MIME-Version: 1.0 Content-Type: text/plain; charset=3DUTF-8 Content-Transfer-Encoding: 8bit Fixes . Treat the $HOME/.guix-profile/share and /run/current-system/share XDG_DATA_DIRS file names specially so that the inotify-based monitors placed by GLib monitor their parent link rather than an immutable directory. Co-authored by Ludovic Court=C3=A8s <=C4=BCudo@gnu.org>. --- gio/gdesktopappinfo.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/gio/gdesktopappinfo.c b/gio/gdesktopappinfo.c index f1e2fdd65..e659034d5 100644 --- a/gio/gdesktopappinfo.c +++ b/gio/gdesktopappinfo.c @@ -1380,7 +1380,8 @@ closure_notify_cb (gpointer data, static void desktop_file_dir_init (DesktopFileDir *dir) { - const gchar *watch_dir; + const gchar *watch_dir, *guix_profile_data, *system_profile_data; + gboolean is_directory =3D TRUE; =20 g_assert (!dir->is_setup); =20 @@ -1390,13 +1391,25 @@ desktop_file_dir_init (DesktopFileDir *dir) dir->alternatively_watching =3D desktop_file_dir_get_alternative_dir (di= r); watch_dir =3D dir->alternatively_watching ? dir->alternatively_watching = : dir->path; =20 + /* Workaround for Guix: watch the link of a profile, not its + * immutable 'share' sub-directory. */ + guix_profile_data =3D g_build_filename (g_get_home_dir (), ".guix-profil= e", "share", NULL); + system_profile_data =3D "/run/current-system/share"; + + if (g_str_equal (watch_dir, guix_profile_data) + || g_str_equal (watch_dir, system_profile_data)) + { + is_directory =3D FALSE; + watch_dir =3D g_path_get_dirname (watch_dir); + } + /* There is a very thin race here if the watch_dir has been _removed_ * between when we checked for it and when we establish the watch. * Removes probably don't happen in usual operation, and even if it * does (and we catch the unlikely race), the only degradation is that * we will fall back to polling. */ - dir->monitor =3D g_local_file_monitor_new_in_worker (watch_dir, TRUE, G_= FILE_MONITOR_NONE, + dir->monitor =3D g_local_file_monitor_new_in_worker (watch_dir, is_direc= tory, G_FILE_MONITOR_NONE, desktop_file_dir_chan= ged, desktop_file_dir_ref = (dir), closure_notify_cb, NU= LL); --=20 2.28.0 --=-=-= Content-Type: text/plain It's untested because 'guix vm' is taking more time to complete than I'm willing to wait for in the middle of the night :-). I'll try it tomorrow. Thanks, Maxim --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 06 11:02:37 2020 Received: (at 36376) by debbugs.gnu.org; 6 Nov 2020 16:02:37 +0000 Received: from localhost ([127.0.0.1]:57067 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kb4CD-0001YM-I4 for submit@debbugs.gnu.org; Fri, 06 Nov 2020 11:02:37 -0500 Received: from eggs.gnu.org ([209.51.188.92]:45530) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kb4CB-0001Y8-8J for 36376@debbugs.gnu.org; Fri, 06 Nov 2020 11:02:35 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:39914) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kb4C4-00059M-Q6; Fri, 06 Nov 2020 11:02:28 -0500 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=35918 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kb4C3-0006xt-U2; Fri, 06 Nov 2020 11:02:28 -0500 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Maxim Cournoyer Subject: Re: bug#36376: Application menu of desktop environment not automatically updated References: <871rzhn483.fsf@gnu.org> <87o8keawju.fsf@gnu.org> <87d00swboe.fsf@gmail.com> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 16 Brumaire an 229 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Fri, 06 Nov 2020 17:02:26 +0100 In-Reply-To: <87d00swboe.fsf@gmail.com> (Maxim Cournoyer's message of "Thu, 05 Nov 2020 01:38:25 -0500") Message-ID: <878sbexylp.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 36376 Cc: Leo Prikler , 36376@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi Maxim, Maxim Cournoyer skribis: > From a79645c565e56ac201e66936d9f9883ad9387b06 Mon Sep 17 00:00:00 2001 > From: Maxim Cournoyer > Date: Thu, 5 Nov 2020 00:24:29 -0500 > Subject: [PATCH] gdesktopappinfo: Fix monitoring of a Guix profile > XDG_DATA_DIR. > MIME-Version: 1.0 > Content-Type: text/plain; charset=3DUTF-8 > Content-Transfer-Encoding: 8bit > > Fixes . > > Treat the $HOME/.guix-profile/share and /run/current-system/share > XDG_DATA_DIRS file names specially so that the inotify-based monitors > placed by GLib monitor their parent link rather than an immutable > directory. > > Co-authored by Ludovic Court=C3=A8s <=C4=BCudo@gnu.org>. ^ This is LATIN SMALL LETTER L WITH CEDILLA. :-) > --- > gio/gdesktopappinfo.c | 17 +++++++++++++++-- > 1 file changed, 15 insertions(+), 2 deletions(-) I like that it=E2=80=99s short and sweet, nice! Thanks, Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 06 13:56:19 2020 Received: (at 36376) by debbugs.gnu.org; 6 Nov 2020 18:56:19 +0000 Received: from localhost ([127.0.0.1]:57299 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kb6uJ-0005hD-BS for submit@debbugs.gnu.org; Fri, 06 Nov 2020 13:56:19 -0500 Received: from mail-qk1-f176.google.com ([209.85.222.176]:42179) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kb6uH-0005h0-Nn for 36376@debbugs.gnu.org; Fri, 06 Nov 2020 13:56:18 -0500 Received: by mail-qk1-f176.google.com with SMTP id b18so2029426qkc.9 for <36376@debbugs.gnu.org>; Fri, 06 Nov 2020 10:56:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=LFRk7dNyQYJwEdgX/62ZFeKvWze1g1Rim7W+8mlKBeA=; b=UVAc20L8t0qlKfzh4m0KpyNaV62TgHTL1RYzYQwlJEFzaP9bOT1/La47rJ36Oqi/qp rW3JycgIzP0/uRU7242zr6XfIF/xFpRz5h7LKihyDoGDjZbCK+JuXAUvD04N+7HeHmE+ c1ueBzsmjZM+zG90GZh3cb9fP+p+vchsWepgcBH6dfIzyPcSxvYKa5qv0r32668+T43d G9YQG4ByF00s19MDKBLwJ/C2pGQbBTgHiK5zuLCJRqLKjAzw9G43PskO/ZkUgLxYFrgP ab7rhduVbI3pr1P5SrRhetkavDbJvszyIeOaJte6irglMmMgMaS4fGJCG+6x9EfZwegt pBDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=LFRk7dNyQYJwEdgX/62ZFeKvWze1g1Rim7W+8mlKBeA=; b=ucia9L9KsM3S0Cmiywb5WYnAT681bAUPrM39z5mc2WXjr5/n4R5e0bTrZc+CvRxH2n CX/gFpDnxmSIQzWO808HvJN6yRSyIQXbS+Y+0ptYzqNjafU1Qlox+uOWz+2E1LZBg8V/ zLsXoO47veiTGEUqPEG8pteDlmA2KjjQYODC3IEswXhloxJ1Z27bProzZZcklmdreWd1 c5EMz491PgDrMuNjmWC77HsUHJL1j81R4PvDQ9DcHpfd52RBdUPmYQBsvBVqq+ywKVkZ 5PUmOeQlwwgBaUx24GYOPDvhcGi+yVISKlnLKbya0Uml4E6s/EksncrB5VlqyIJIL6YF OgnQ== X-Gm-Message-State: AOAM53261pAaF7nNWasMVuEBTp6ErS1239M/Y4pDTc1zW9/a04O9uS3P TN65rtFGWZphtyFFuQx0tyU= X-Google-Smtp-Source: ABdhPJzXoC3w3pFvkqEiB7TgkyU/0BZDcaUtHfUsDjzKH46cf4Z4ak581nQJu2IRnISDehaZpzcs2g== X-Received: by 2002:a37:6187:: with SMTP id v129mr2984298qkb.31.1604688972087; Fri, 06 Nov 2020 10:56:12 -0800 (PST) Received: from hurd (dsl-236-123-209.b2b2c.ca. [207.236.123.209]) by smtp.gmail.com with ESMTPSA id a7sm1093431qth.41.2020.11.06.10.56.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Nov 2020 10:56:11 -0800 (PST) From: Maxim Cournoyer To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: bug#36376: Application menu of desktop environment not automatically updated References: <871rzhn483.fsf@gnu.org> <87o8keawju.fsf@gnu.org> <87d00swboe.fsf@gmail.com> <878sbexylp.fsf@gnu.org> Date: Fri, 06 Nov 2020 13:56:10 -0500 In-Reply-To: <878sbexylp.fsf@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s=22'?= =?utf-8?Q?s?= message of "Fri, 06 Nov 2020 17:02:26 +0100") Message-ID: <87r1p6tiut.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 36376 Cc: Leo Prikler , 36376@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hey Ludovic, Ludovic Court=C3=A8s writes: > Hi Maxim, > > Maxim Cournoyer skribis: > >> From a79645c565e56ac201e66936d9f9883ad9387b06 Mon Sep 17 00:00:00 2001 >> From: Maxim Cournoyer >> Date: Thu, 5 Nov 2020 00:24:29 -0500 >> Subject: [PATCH] gdesktopappinfo: Fix monitoring of a Guix profile >> XDG_DATA_DIR. >> MIME-Version: 1.0 >> Content-Type: text/plain; charset=3DUTF-8 >> Content-Transfer-Encoding: 8bit >> >> Fixes . >> >> Treat the $HOME/.guix-profile/share and /run/current-system/share >> XDG_DATA_DIRS file names specially so that the inotify-based monitors >> placed by GLib monitor their parent link rather than an immutable >> directory. >> >> Co-authored by Ludovic Court=C3=A8s <=C4=BCudo@gnu.org>. > ^ > This is LATIN SMALL LETTER L WITH CEDILLA. :-) > >> --- >> gio/gdesktopappinfo.c | 17 +++++++++++++++-- >> 1 file changed, 15 insertions(+), 2 deletions(-) > > I like that it=E2=80=99s short and sweet, nice! I thought too, but it doesn't work, because these entries never make it to XDG_DATA_DIRS in the first place, at least for the system profile. I also gave a try to 1) a modified version of your patch that added support for /run/current-system and 2) your patch unmodified with inconclusive results so far. I did see things being scanned in response to /run/current-system changing, but I believe this was because I goofed up the dir path to "/run/current-system/share" (it should have been ""/run/current-system/profile/share"), and there's some code gdesktopappinfo.c (desktop_file_dir_get_alternative_dir) that sets the monitored directory to a parent when the directory doesn't exist. In either version, strace failed to show any activity upon recreating the ~/.guix-profile (that is /root/.guix-profile since I was testing as root in the VM) link, different to what you had found. So, to be continued... Maxim From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 10 10:24:10 2020 Received: (at 36376) by debbugs.gnu.org; 10 Nov 2020 15:24:10 +0000 Received: from localhost ([127.0.0.1]:38648 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kcVVB-0005lW-Nn for submit@debbugs.gnu.org; Tue, 10 Nov 2020 10:24:09 -0500 Received: from eggs.gnu.org ([209.51.188.92]:49652) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kcVVA-0005lG-8A; Tue, 10 Nov 2020 10:24:08 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:34304) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kcVV3-0006sa-Fk; Tue, 10 Nov 2020 10:24:01 -0500 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=44716 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kcVV0-0006xD-2l; Tue, 10 Nov 2020 10:23:59 -0500 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Maxim Cournoyer Subject: Re: bug#36376: Application menu of desktop environment not automatically updated References: <871rzhn483.fsf@gnu.org> <87o8keawju.fsf@gnu.org> <87d00swboe.fsf@gmail.com> <878sbexylp.fsf@gnu.org> <87r1p6tiut.fsf@gmail.com> Date: Tue, 10 Nov 2020 16:23:55 +0100 In-Reply-To: <87r1p6tiut.fsf@gmail.com> (Maxim Cournoyer's message of "Fri, 06 Nov 2020 13:56:10 -0500") Message-ID: <87lff9nsl0.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 36376 Cc: Leo Prikler , 35594@debbugs.gnu.org, 36376@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi Maxim, So I went further to test the initial GLib patch I posted in =E2=80=9Creal conditions=E2=80=9D. =E2=80=98guix system vm-image=E2=80=99 takes an awful lot of time for big i= mages; I patiently waited for completion for an image of =E2=80=98desktop.tmpl=E2=80= =99, but then its root file system turned out to be too small for me to run =E2=80=98guix install=E2=80=99. So instead I tried this: 1. =E2=80=98guix system vm desktop.tmpl=E2=80=99; 2. =E2=80=98guix install inkscape -p /tmp/test=E2=80=99 on my actual mach= ine; 3. Start the GNOME VM created above; 4. Inside the VM, search for Inkscape, notice it=E2=80=99s not there; 5. Inside the VM, have ~/.guix-profile point to the profile created on the host above, and notice that Inkscape becomes available. Video! mpv http://web.fdn.fr/~lcourtes/tmp/gnome-desktop-app-detection.webm So I think we should include this fix in 1.2. What do people think? The main downside is extra grafting, which means extra disk and CPU usage for our users. However, libx11 (11K dependents) is also grafted, so it shouldn=E2=80=99t make things worse (GLib has 6K dependents). Maxim, did you have a variant of the GLib patch that also checks /run/current-system? Thanks, Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 10 12:49:12 2020 Received: (at 36376) by debbugs.gnu.org; 10 Nov 2020 17:49:12 +0000 Received: from localhost ([127.0.0.1]:38832 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kcXlX-0000zE-Nl for submit@debbugs.gnu.org; Tue, 10 Nov 2020 12:49:12 -0500 Received: from mail-qk1-f173.google.com ([209.85.222.173]:33634) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kcXlW-0000yu-CD; Tue, 10 Nov 2020 12:49:10 -0500 Received: by mail-qk1-f173.google.com with SMTP id l2so12307187qkf.0; Tue, 10 Nov 2020 09:49:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=AWv0EOPHdsIvm3TQn2LuYMB3+hb9ro80ANCUBKwOOkY=; b=h+DD7slxo0w67uxjSpTgKzAJpuQwfqBiur0G+TSTquHluIxVg/FeUMb4RaxAvdyoAe ZqtbNQMvG0+YYqTItxr3OUjduRM953AwCQczad4Ms57+5UZ4/asKg/eDejfpBJ+9XaUW rhzpJQh8KuuYVgd91Kc7FfsWzx2d1xtCvdv5mT64R8fg/Eg6NuWrxVWLFUrX/K+OfMyw iaLVuRxOJcl7kQkL1JRu4UdlU3SE8nlIaXdy1uxeGeU22HAJENVAvQk0VcftGQzgMX+Y JStdPofNgiYfCj4YHxG6xet/3F8OZa0OXauC67z+6HujMQIsQPrPtAhroc+QpImQ2jd7 DL7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=AWv0EOPHdsIvm3TQn2LuYMB3+hb9ro80ANCUBKwOOkY=; b=FXCMn7fRZ1iUu+ggjjV466CpqkoXi4O1RYfgT2TrKkWNNWAPEsxp6iNanzldYdVNQv gLunSR0vpSetJj1wY8lYrpLcDK1y02rSwawZNmYkJhiPsDw+5QORKuJcx19MOVhUWXqR bfQhuoYA/nUoNzdn9nQHlgcFR9RtUHowhitr/ma+tXQ65ltP7+b8v9qoHNFAvG01DSOS lQfCAg8Cu+aJORBo6rjFhc585aoGQGtufLZJerIT/KWTqoJyOqx24s75LirRuONAkJz7 OSbqnufQYBxP+1IgTHnIL5ZD2S68PJEsfevtqmsHDosO53tzk74dUHXdW2v2f72/2X3O edWQ== X-Gm-Message-State: AOAM533tGbvnQjX1AEJpZWe2nHU34ub7tbkpAr4NmUnJa1BsDXY5YJcF z2T1LCw482HRsUHb6+B/SmZhLjg34d2v7hAWw/8= X-Google-Smtp-Source: ABdhPJzKyS+nZeNsBKjd3zmzi+RMTPRnaPKjrfy1KvRRfBbEC0Bj8wZpIxStHpA4dqcbFvgUcJmP6xu88ShYhZmu3jc= X-Received: by 2002:a37:a54f:: with SMTP id o76mr18179072qke.201.1605030544722; Tue, 10 Nov 2020 09:49:04 -0800 (PST) MIME-Version: 1.0 References: <871rzhn483.fsf@gnu.org> <87o8keawju.fsf@gnu.org> <87d00swboe.fsf@gmail.com> <878sbexylp.fsf@gnu.org> <87r1p6tiut.fsf@gmail.com> <87lff9nsl0.fsf@gnu.org> In-Reply-To: <87lff9nsl0.fsf@gnu.org> From: zimoun Date: Tue, 10 Nov 2020 18:48:53 +0100 Message-ID: Subject: Re: bug#36376: Application menu of desktop environment not automatically updated To: =?UTF-8?Q?Ludovic_Court=C3=A8s?= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 36376 Cc: 36376@debbugs.gnu.org, Leo Prikler , 35594@debbugs.gnu.org, Maxim Cournoyer X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Tue, 10 Nov 2020 at 16:25, Ludovic Court=C3=A8s wrote: > Video! H=C3=A9h=C3=A9! Nice :-) > So I think we should include this fix in 1.2. What do people think? You mean only the initial patch. If it works in "real conditions" for bob on 'antelope' (desktop.tmpl), then it would nice to have for 1.2, > The main downside is extra grafting, which means extra disk and CPU > usage for our users. However, libx11 (11K dependents) is also grafted, > so it shouldn=E2=80=99t make things worse (GLib has 6K dependents). No free lunch. :-) Is it really slow or acceptable? All the best, simon From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 10 16:23:40 2020 Received: (at 36376) by debbugs.gnu.org; 10 Nov 2020 21:23:40 +0000 Received: from localhost ([127.0.0.1]:39179 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kcb76-0006Z3-31 for submit@debbugs.gnu.org; Tue, 10 Nov 2020 16:23:40 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53522) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kcb75-0006Yl-Gb; Tue, 10 Nov 2020 16:23:39 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:41714) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kcb6t-0006u9-1B; Tue, 10 Nov 2020 16:23:27 -0500 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=46970 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kcb6o-0007AD-Va; Tue, 10 Nov 2020 16:23:23 -0500 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: zimoun Subject: Re: bug#36376: Application menu of desktop environment not automatically updated References: <871rzhn483.fsf@gnu.org> <87o8keawju.fsf@gnu.org> <87d00swboe.fsf@gmail.com> <878sbexylp.fsf@gnu.org> <87r1p6tiut.fsf@gmail.com> <87lff9nsl0.fsf@gnu.org> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 20 Brumaire an 229 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Tue, 10 Nov 2020 22:23:21 +0100 In-Reply-To: (zimoun's message of "Tue, 10 Nov 2020 18:48:53 +0100") Message-ID: <871rh0oqie.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 36376 Cc: 36376@debbugs.gnu.org, Leo Prikler , 35594@debbugs.gnu.org, Maxim Cournoyer X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, zimoun skribis: > On Tue, 10 Nov 2020 at 16:25, Ludovic Court=C3=A8s wrote: [...] >> The main downside is extra grafting, which means extra disk and CPU >> usage for our users. However, libx11 (11K dependents) is also grafted, >> so it shouldn=E2=80=99t make things worse (GLib has 6K dependents). > > No free lunch. :-) > Is it really slow or acceptable? If you=E2=80=99re installing a graphical applications, it=E2=80=99s already= being grafted, so the extra graft doesn=E2=80=99t make a difference. Non-graphical applications that depend on GLib will now need to be grafted, but I think there aren=E2=80=99t many of them, and they too might = also be grafted for other reasons. Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 12 10:56:27 2020 Received: (at 36376) by debbugs.gnu.org; 12 Nov 2020 15:56:27 +0000 Received: from localhost ([127.0.0.1]:45392 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kdExT-0006q3-VZ for submit@debbugs.gnu.org; Thu, 12 Nov 2020 10:56:27 -0500 Received: from eggs.gnu.org ([209.51.188.92]:34270) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kdExP-0006pk-Bj; Thu, 12 Nov 2020 10:56:22 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:54776) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kdExI-00073Z-E6; Thu, 12 Nov 2020 10:56:12 -0500 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=56842 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kdExF-00051s-Oj; Thu, 12 Nov 2020 10:56:11 -0500 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Maxim Cournoyer Subject: Re: bug#36376: Application menu of desktop environment not automatically updated References: <871rzhn483.fsf@gnu.org> <87o8keawju.fsf@gnu.org> <87d00swboe.fsf@gmail.com> <878sbexylp.fsf@gnu.org> <87r1p6tiut.fsf@gmail.com> <87lff9nsl0.fsf@gnu.org> Date: Thu, 12 Nov 2020 16:56:07 +0100 In-Reply-To: <87lff9nsl0.fsf@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s=22'?= =?utf-8?Q?s?= message of "Tue, 10 Nov 2020 16:23:55 +0100") Message-ID: <87d00iin6w.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 36376 Cc: Leo Prikler , 35594@debbugs.gnu.org, 36376@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi! Ludovic Court=C3=A8s skribis: > So I went further to test the initial GLib patch I posted in =E2=80=9Creal > conditions=E2=80=9D. I did some more testing using a similar workflow: this time I repeatedly changed the profile (installing/removing packages), which showed that the first patch was buggy (it would only notice the creation of ~/.guix-profile and nothing beyond that). This is in part due to the fact that =E2=80=98GFileMonitor=E2=80=99 follows= symlinks (it doesn=E2=80=99t pass the =E2=80=98IN_DONT_FOLLOW=E2=80=99 inotify flag). T= hus, when it monitors ~/.guix-profile, it=E2=80=99s really monitoring /gnu/store/=E2=80=A6-profil= e, which never changes. So with this new patch it=E2=80=99s monitoring /var/guix/profiles/per-user/= USER and /var/guix/profiles instead, which correctly detects changes. It detects a bit =E2=80=9Ctoo much=E2=80=9D (for instance, running =E2=80=98gu= ix pull=E2=80=99 triggers the inotify hook because it changes /var/guix/profiles/per-user/USER/current-guix) but that=E2=80=99s probably = OK. If you=E2=80=99re using GNOME, Xfce, or another GLib-based desktop environm= ent, I=E2=80=99d welcome tests on the bare metal! Just apply the patch on a che= ckout of =E2=80=98master=E2=80=99 and run: sudo -E ./pre-inst-env guix system reconfigure =E2=80=A6 If there are no objections, I=E2=80=99d like to apply this patch shortly so= we can go ahead with a last round of pre-release tests. Ludo=E2=80=99. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-gnu-glib-Graft-patch-to-detect-changes-to-the-instal.patch Content-Description: the patch >From 7d03b2b823951219ece46c7f34e25ae36a8ba12c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Thu, 12 Nov 2020 16:35:24 +0100 Subject: [PATCH] gnu: glib: Graft patch to detect changes to the installed applications. Fixes . Reported by sirgazil and others. * gnu/packages/patches/glib-appinfo-watch.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/glib.scm (glib)[replacement]: New field. (glib-with-gio-patch): New variable. (glib-with-documentation): Use 'package/inherit'. --- gnu/local.mk | 1 + gnu/packages/glib.scm | 14 ++- gnu/packages/patches/glib-appinfo-watch.patch | 92 +++++++++++++++++++ 3 files changed, 105 insertions(+), 2 deletions(-) create mode 100644 gnu/packages/patches/glib-appinfo-watch.patch diff --git a/gnu/local.mk b/gnu/local.mk index d5a13cbdbd..2301a04d2f 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1050,6 +1050,7 @@ dist_patch_DATA = \ %D%/packages/patches/ghostscript-no-header-id.patch \ %D%/packages/patches/ghostscript-no-header-uuid.patch \ %D%/packages/patches/ghostscript-no-header-creationdate.patch \ + %D%/packages/patches/glib-appinfo-watch.patch \ %D%/packages/patches/glib-tests-timer.patch \ %D%/packages/patches/glibc-CVE-2018-11236.patch \ %D%/packages/patches/glibc-CVE-2018-11237.patch \ diff --git a/gnu/packages/glib.scm b/gnu/packages/glib.scm index 901222476a..43523e516d 100644 --- a/gnu/packages/glib.scm +++ b/gnu/packages/glib.scm @@ -181,6 +181,7 @@ shared NFS home directories.") (package (name "glib") (version "2.62.6") + (replacement glib-with-gio-patch) (source (origin (method url-fetch) (uri (string-append "mirror://gnome/sources/" @@ -387,11 +388,20 @@ dynamic loading, and an object system.") (home-page "https://developer.gnome.org/glib/") (license license:lgpl2.1+))) +(define glib-with-gio-patch + ;; GLib with a fix for . + ;; TODO: Fold into 'glib' above in the next rebuild cycle. + (package + (inherit glib) + (source (origin + (inherit (package-source glib)) + (patches (cons (search-patch "glib-appinfo-watch.patch") + (origin-patches (package-source glib)))))))) + (define-public glib-with-documentation ;; glib's doc must be built in a separate package since it requires gtk-doc, ;; which in turn depends on glib. - (package - (inherit glib) + (package/inherit glib (properties (alist-delete 'hidden? (package-properties glib))) (outputs (cons "doc" (package-outputs glib))) ; 20 MiB of GTK-Doc reference (native-inputs diff --git a/gnu/packages/patches/glib-appinfo-watch.patch b/gnu/packages/patches/glib-appinfo-watch.patch new file mode 100644 index 0000000000..638a5e0949 --- /dev/null +++ b/gnu/packages/patches/glib-appinfo-watch.patch @@ -0,0 +1,92 @@ +This patch lets GLib's GDesktopAppInfo API watch and notice changes +to the Guix user and system profiles. That way, the list of available +applications shown by the desktop environment is immediately updated +when the user runs "guix install", "guix remove", or "guix system +reconfigure" (see ). + +It does so by monitoring /var/guix/profiles (for changes to the system +profile) and /var/guix/profiles/per-user/USER (for changes to the user +profile) and crawling their share/applications sub-directory when +changes happen. + +diff --git a/gio/gdesktopappinfo.c b/gio/gdesktopappinfo.c +index f1e2fdd..095c110 100644 +--- a/gio/gdesktopappinfo.c ++++ b/gio/gdesktopappinfo.c +@@ -148,6 +148,7 @@ typedef struct + gchar *alternatively_watching; + gboolean is_config; + gboolean is_setup; ++ gchar *guix_profile_watch_dir; + GFileMonitor *monitor; + GHashTable *app_names; + GHashTable *mime_tweaks; +@@ -180,6 +181,7 @@ desktop_file_dir_unref (DesktopFileDir *dir) + { + desktop_file_dir_reset (dir); + g_free (dir->path); ++ g_free (dir->guix_profile_watch_dir); + g_free (dir); + } + } +@@ -204,6 +206,13 @@ desktop_file_dir_get_alternative_dir (DesktopFileDir *dir) + { + gchar *parent; + ++ /* If DIR is a profile, watch the specified directory--e.g., ++ * /var/guix/profiles/per-user/$USER/ for the user profile. Do not watch ++ * ~/.guix-profile or /run/current-system/profile because GFileMonitor does ++ * not pass IN_DONT_FOLLOW and thus cannot notice any change. */ ++ if (dir->guix_profile_watch_dir != NULL) ++ return g_strdup (dir->guix_profile_watch_dir); ++ + /* If the directory itself exists then we need no alternative. */ + if (g_access (dir->path, R_OK | X_OK) == 0) + return NULL; +@@ -249,11 +258,11 @@ desktop_file_dir_changed (GFileMonitor *monitor, + * + * If this is a notification for a parent directory (because the + * desktop directory didn't exist) then we shouldn't fire the signal +- * unless something actually changed. ++ * unless something actually changed or it's in /var/guix/profiles. + */ + g_mutex_lock (&desktop_file_dir_lock); + +- if (dir->alternatively_watching) ++ if (dir->alternatively_watching && dir->guix_profile_watch_dir == NULL) + { + gchar *alternative_dir; + +@@ -1555,6 +1564,32 @@ desktop_file_dirs_lock (void) + for (i = 0; dirs[i]; i++) + g_ptr_array_add (desktop_file_dirs, desktop_file_dir_new (dirs[i])); + ++ { ++ /* Monitor the system and user profile under /var/guix/profiles and ++ * treat modifications to them as if they were modifications to their ++ * /share sub-directory. */ ++ const gchar *user; ++ DesktopFileDir *system_profile_dir, *user_profile_dir; ++ ++ system_profile_dir = ++ desktop_file_dir_new ("/var/guix/profiles/system/profile/share"); ++ system_profile_dir->guix_profile_watch_dir = g_strdup ("/var/guix/profiles"); ++ g_ptr_array_add (desktop_file_dirs, desktop_file_dir_ref (system_profile_dir)); ++ ++ user = g_get_user_name (); ++ if (user != NULL) ++ { ++ gchar *profile_dir, *user_data_dir; ++ ++ profile_dir = g_build_filename ("/var/guix/profiles/per-user", user, NULL); ++ user_data_dir = g_build_filename (profile_dir, "guix-profile", "share", NULL); ++ user_profile_dir = desktop_file_dir_new (user_data_dir); ++ user_profile_dir->guix_profile_watch_dir = profile_dir; ++ g_ptr_array_add (desktop_file_dirs, desktop_file_dir_ref (user_profile_dir)); ++ g_free (user_data_dir); ++ } ++ } ++ + /* The list of directories will never change after this, unless + * g_get_user_config_dir() changes due to %G_TEST_OPTION_ISOLATE_DIRS. */ + desktop_file_dirs_config_dir = user_config_dir; -- 2.29.2 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 13 15:39:00 2020 Received: (at 36376-done) by debbugs.gnu.org; 13 Nov 2020 20:39:00 +0000 Received: from localhost ([127.0.0.1]:49416 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kdfqS-0007ed-4Z for submit@debbugs.gnu.org; Fri, 13 Nov 2020 15:38:59 -0500 Received: from eggs.gnu.org ([209.51.188.92]:47698) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kdfqN-0007eI-1x; Fri, 13 Nov 2020 15:38:54 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:39910) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kdfqF-0000fm-UQ; Fri, 13 Nov 2020 15:38:43 -0500 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=38016 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kdfqF-00022W-Cz; Fri, 13 Nov 2020 15:38:43 -0500 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Maxim Cournoyer Subject: Re: bug#35594: bug#36376: Application menu of desktop environment not automatically updated References: <871rzhn483.fsf@gnu.org> <87o8keawju.fsf@gnu.org> <87d00swboe.fsf@gmail.com> <878sbexylp.fsf@gnu.org> <87r1p6tiut.fsf@gmail.com> <87lff9nsl0.fsf@gnu.org> <87d00iin6w.fsf@gnu.org> Date: Fri, 13 Nov 2020 21:38:41 +0100 In-Reply-To: <87d00iin6w.fsf@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s=22'?= =?utf-8?Q?s?= message of "Thu, 12 Nov 2020 16:56:07 +0100") Message-ID: <87a6vlat66.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 36376-done Cc: Leo Prikler , 36376-done@debbugs.gnu.org, 35594-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Ludovic Court=C3=A8s skribis: >>>From 7d03b2b823951219ece46c7f34e25ae36a8ba12c Mon Sep 17 00:00:00 2001 > From: =3D?UTF-8?q?Ludovic=3D20Court=3DC3=3DA8s?=3D > Date: Thu, 12 Nov 2020 16:35:24 +0100 > Subject: [PATCH] gnu: glib: Graft patch to detect changes to the installed > applications. > > Fixes . > Reported by sirgazil and others. > > * gnu/packages/patches/glib-appinfo-watch.patch: New file. > * gnu/local.mk (dist_patch_DATA): Add it. > * gnu/packages/glib.scm (glib)[replacement]: New field. > (glib-with-gio-patch): New variable. > (glib-with-documentation): Use 'package/inherit'. Pushed as ae10ec441aa524bf267f9cefd4a319b44d0b8b44 (version-1.2.0). Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 16 23:57:33 2020 Received: (at 36376) by debbugs.gnu.org; 17 Nov 2020 04:57:33 +0000 Received: from localhost ([127.0.0.1]:58041 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ket3c-0004uK-Sb for submit@debbugs.gnu.org; Mon, 16 Nov 2020 23:57:33 -0500 Received: from mail-qv1-f66.google.com ([209.85.219.66]:47050) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ket3Y-0004u0-Gk; Mon, 16 Nov 2020 23:57:31 -0500 Received: by mail-qv1-f66.google.com with SMTP id r12so10030752qvq.13; Mon, 16 Nov 2020 20:57:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=yhMlf/JNRiKsnlOh27ToU6cC0XGJm+ns0LmNRNTfgCs=; b=nhUuZq6odN+MZVnbbkv4k0rX+QqC5aa5tEKPET+5BP4XQo1P4eB1iAit4Tg2HeBT0t 1o3PW6eftNbIzNVJ5CaQFBiW8wN21tqye+zIqH2dBg/7zRCvXSWwiDUerab9ubHTZHLd 9F6UEoaAngKVntsv9erI62EN/aDZpmrrU5RBukiMmftGtzX2KAPSqUGTZoO4p/GTwApl Fl7gekMQNAzbhDAG64PILoRqE2qcMWnPN8U6lLf5SthoJYvkknFEQtbFk7NGqTBXi8C+ b0w7dgnCYZHQeFwKvfaM6/ll7vG49/Gk2HvTVdIoPExts0r9fwsf4c79a9YcEv2ieHVt FCuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=yhMlf/JNRiKsnlOh27ToU6cC0XGJm+ns0LmNRNTfgCs=; b=l548cZsCehS2fGT53dgfyv4mfvA5s7JkaGo374bJjC/Xl4lRhnKmfCaWHS7UEkFw6G oBk4c8wdBnxTuqCgxHn2JQFsbzJTzZnmBdKyAp9QZZcwYGuNuOsHdhF/jcSWDw5coSu4 mfgw0ZhZY9nn9423YJ8E1urqFU9MfvyGfqiFCIswhw2cck1V3ujBiAWqMNqzaDoe7i/s qnN6rafrUq5DfccAjXBFSqPK6RFKGO6mvMNN3561x2hn4MiXRkEXxs/rrxm0S5C7CRvJ 7ruy33JCdtwvnSF+I2nbZ+MDjFV1dZkUeHEZTnFcY2q6W+2O2fZcV91fS9WUVICxt9gV 0fVw== X-Gm-Message-State: AOAM532fXjvt7hHq5pGxyhXw8ukFvx8LxkwKxXnNQy6MJOKiuZk0c4RQ NVXbAnzhglqdcwA422hvy9DhmCtioXU= X-Google-Smtp-Source: ABdhPJx5cHl1YTZM+lfqTs6imzkiDbRKc2Xqg1iqgLMflz1IFNkdcLoJxh4if1CfPtQ6qdLhSTtdyw== X-Received: by 2002:a0c:e585:: with SMTP id t5mr18454770qvm.6.1605589042438; Mon, 16 Nov 2020 20:57:22 -0800 (PST) Received: from hurd (dsl-205-236-230-198.b2b2c.ca. [205.236.230.198]) by smtp.gmail.com with ESMTPSA id o125sm13544914qke.56.2020.11.16.20.57.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Nov 2020 20:57:21 -0800 (PST) From: Maxim Cournoyer To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: bug#36376: Application menu of desktop environment not automatically updated References: <871rzhn483.fsf@gnu.org> <87o8keawju.fsf@gnu.org> <87d00swboe.fsf@gmail.com> <878sbexylp.fsf@gnu.org> <87r1p6tiut.fsf@gmail.com> <87lff9nsl0.fsf@gnu.org> <87d00iin6w.fsf@gnu.org> Date: Mon, 16 Nov 2020 23:57:20 -0500 In-Reply-To: <87d00iin6w.fsf@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s=22'?= =?utf-8?Q?s?= message of "Thu, 12 Nov 2020 16:56:07 +0100") Message-ID: <875z64d1hr.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 36376 Cc: Leo Prikler , 35594@debbugs.gnu.org, 36376@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello Ludovic! Ludovic Court=C3=A8s writes: [...] > So with this new patch it=E2=80=99s monitoring /var/guix/profiles/per-use= r/USER > and /var/guix/profiles instead, which correctly detects changes. It > detects a bit =E2=80=9Ctoo much=E2=80=9D (for instance, running =E2=80=98= guix pull=E2=80=99 triggers the > inotify hook because it changes > /var/guix/profiles/per-user/USER/current-guix) but that=E2=80=99s probabl= y OK. > > If you=E2=80=99re using GNOME, Xfce, or another GLib-based desktop enviro= nment, > I=E2=80=99d welcome tests on the bare metal! Just apply the patch on a c= heckout > of =E2=80=98master=E2=80=99 and run: I've now done so! It works :-)! I do have noticed something a bit off, see the comments below. [...] > diff --git a/gnu/packages/patches/glib-appinfo-watch.patch b/gnu/packages= /patches/glib-appinfo-watch.patch > new file mode 100644 > index 0000000000..638a5e0949 > --- /dev/null > +++ b/gnu/packages/patches/glib-appinfo-watch.patch > @@ -0,0 +1,92 @@ > +This patch lets GLib's GDesktopAppInfo API watch and notice changes > +to the Guix user and system profiles. That way, the list of available > +applications shown by the desktop environment is immediately updated > +when the user runs "guix install", "guix remove", or "guix system > +reconfigure" (see ). > + > +It does so by monitoring /var/guix/profiles (for changes to the system > +profile) and /var/guix/profiles/per-user/USER (for changes to the user > +profile) and crawling their share/applications sub-directory when > +changes happen. > + > +diff --git a/gio/gdesktopappinfo.c b/gio/gdesktopappinfo.c > +index f1e2fdd..095c110 100644 > +--- a/gio/gdesktopappinfo.c > ++++ b/gio/gdesktopappinfo.c > +@@ -148,6 +148,7 @@ typedef struct > + gchar *alternatively_watching; > + gboolean is_config; > + gboolean is_setup; > ++ gchar *guix_profile_watch_dir; > + GFileMonitor *monitor; > + GHashTable *app_names; > + GHashTable *mime_tweaks; > +@@ -180,6 +181,7 @@ desktop_file_dir_unref (DesktopFileDir *dir) > + { > + desktop_file_dir_reset (dir); > + g_free (dir->path); > ++ g_free (dir->guix_profile_watch_dir); > + g_free (dir); > + } > + } > +@@ -204,6 +206,13 @@ desktop_file_dir_get_alternative_dir (DesktopFileDi= r *dir) > + { > + gchar *parent; > + > ++ /* If DIR is a profile, watch the specified directory--e.g., > ++ * /var/guix/profiles/per-user/$USER/ for the user profile. Do not w= atch > ++ * ~/.guix-profile or /run/current-system/profile because GFileMonito= r does > ++ * not pass IN_DONT_FOLLOW and thus cannot notice any change. */ > ++ if (dir->guix_profile_watch_dir !=3D NULL) > ++ return g_strdup (dir->guix_profile_watch_dir); > ++ > + /* If the directory itself exists then we need no alternative. */ > + if (g_access (dir->path, R_OK | X_OK) =3D=3D 0) > + return NULL; > +@@ -249,11 +258,11 @@ desktop_file_dir_changed (GFileMonitor *monit= or, > + * > + * If this is a notification for a parent directory (because the > + * desktop directory didn't exist) then we shouldn't fire the signal > +- * unless something actually changed. > ++ * unless something actually changed or it's in /var/guix/profiles. > + */ > + g_mutex_lock (&desktop_file_dir_lock); > + > +- if (dir->alternatively_watching) > ++ if (dir->alternatively_watching && dir->guix_profile_watch_dir =3D=3D= NULL) ^^^^^^ Why is this needed/desirable? OK, I think I get it. The API seems to imply that users (such as gnome-shell) need to keep asking about a desktop directory entry as they are otherwise "forgotten". Since we are inserting entries at the level of glib ourselves, these will never be asked for by gnome-shell, so must not be cleared. Is that correct? > + { > + gchar *alternative_dir; > + > +@@ -1555,6 +1564,32 @@ desktop_file_dirs_lock (void) > + for (i =3D 0; dirs[i]; i++) > + g_ptr_array_add (desktop_file_dirs, desktop_file_dir_new (dirs[= i])); > + > ++ { > ++ /* Monitor the system and user profile under /var/guix/profiles= and > ++ * treat modifications to them as if they were modifications to= their > ++ * /share sub-directory. */ > ++ const gchar *user; > ++ DesktopFileDir *system_profile_dir, *user_profile_dir; > ++ > ++ system_profile_dir =3D > ++ desktop_file_dir_new ("/var/guix/profiles/system/profile/shar= e"); > ++ system_profile_dir->guix_profile_watch_dir =3D g_strdup ("/var/= guix/profiles"); > ++ g_ptr_array_add (desktop_file_dirs, desktop_file_dir_ref (syste= m_profile_dir)); > ++ > ++ user =3D g_get_user_name (); This seems to get the user of the running glib application; e.g. for GNOME Shell it returns 'gdm'... > ++ if (user !=3D NULL) > ++ { > ++ gchar *profile_dir, *user_data_dir; > ++ > ++ profile_dir =3D g_build_filename ("/var/guix/profiles/per-u= ser", user, NULL); > ++ user_data_dir =3D g_build_filename (profile_dir, "guix-prof= ile", "share", NULL); > ++ user_profile_dir =3D desktop_file_dir_new (user_data_dir); > ++ user_profile_dir->guix_profile_watch_dir =3D profile_dir; > ++ g_ptr_array_add (desktop_file_dirs, desktop_file_dir_ref (u= ser_profile_dir)); > ++ g_free (user_data_dir); > ++ } > ++ } > ++ ...which means the above puts the watch on the "/var/guix/profiles/per-user/gdm" directory, which doesn't exist. sudo strace -f -s200 -p$(pgrep gnome-shell | head -n1) reports entries such as: --8<---------------cut here---------------start------------->8--- 92 00:48:47 poll([{fd=3D6, events=3DPOLLIN}, {fd=3D7, events=3DPOLLIN}, {= fd=3D9, events=3DPOLLIN}, {fd=3D19, events=3DPOLLIN}, {fd=3D28, events=3DPO= LLIN}], 5, -1 390 00:48:47 <... poll resumed>) =3D 0 (Timeout) 390 00:48:47 inotify_add_watch(17, "/var/guix/profiles/per-user/gdm", IN_= MODIFY|IN_ATTRIB|IN_CLOSE_WRITE|IN_MOVED_FROM|IN_MOVED_TO|IN_CREATE|IN_DELE= TE|IN_DELETE_SELF|IN_MOVE_SELF|IN_UNMOUNT|IN_ONLYDIR) =3D -1 ENOENT (No suc= h file or directory) 390 00:48:47 poll([{fd=3D3, events=3DPOLLIN}, {fd=3D17, events=3DPOLLIN}]= , 2, 3996) =3D 0 (Timeout) 390 00:48:51 inotify_add_watch(17, "/var/guix/profiles/per-user/gdm", IN_= MODIFY|IN_ATTRIB|IN_CLOSE_WRITE|IN_MOVED_FROM|IN_MOVED_TO|IN_CREATE|IN_DELE= TE|IN_DELETE_SELF|IN_MOVE_SELF|IN_UNMOUNT|IN_ONLYDIR) =3D -1 ENOENT (No suc= h file or directory) 390 00:48:51 poll([{fd=3D3, events=3DPOLLIN}, {fd=3D17, events=3DPOLLIN}]= , 2, 3998) =3D 0 (Timeout) 390 00:48:55 inotify_add_watch(17, "/var/guix/profiles/per-user/gdm", IN_= MODIFY|IN_ATTRIB|IN_CLOSE_WRITE|IN_MOVED_FROM|IN_MOVED_TO|IN_CREATE|IN_DELE= TE|IN_DELETE_SELF|IN_MOVE_SELF|IN_UNMOUNT|IN_ONLYDIR) =3D -1 ENOENT (No suc= h file or directory) --8<---------------cut here---------------end--------------->8--- The fallback mechanism should have been disabled in desktop_file_dir_changed (dir->guix-profile_watch_dir !=3D NULL so desktop_file_dir_get_alternative_dir doesn't get called), so it seems this shouldn't work. Could it be that the watches used by glib implement a recursive inotify-based watch and that it works because any changes under the /var/guix/profiles directory get picked up, including those of user profiles. The sources seem to suggest so, for example in gio/inotify/inotify-path.c. If that is the case, it could lead to a new interesting problems: applications from other users could end up being shown inadvertently. I'll try to validate the above hypothesis, but this takes time. In any case, the current situation is already an improvement, so thank you for your efforts! Maxim From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 17 04:09:01 2020 Received: (at 36376) by debbugs.gnu.org; 17 Nov 2020 09:09:01 +0000 Received: from localhost ([127.0.0.1]:58277 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kewyy-0002o6-Ry for submit@debbugs.gnu.org; Tue, 17 Nov 2020 04:09:01 -0500 Received: from eggs.gnu.org ([209.51.188.92]:41954) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kewyx-0002nq-08; Tue, 17 Nov 2020 04:08:59 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:50810) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kewyp-0002hE-Pi; Tue, 17 Nov 2020 04:08:51 -0500 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=53968 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kewyp-0004n9-Bb; Tue, 17 Nov 2020 04:08:51 -0500 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Maxim Cournoyer Subject: Re: bug#36376: Application menu of desktop environment not automatically updated References: <871rzhn483.fsf@gnu.org> <87o8keawju.fsf@gnu.org> <87d00swboe.fsf@gmail.com> <878sbexylp.fsf@gnu.org> <87r1p6tiut.fsf@gmail.com> <87lff9nsl0.fsf@gnu.org> <87d00iin6w.fsf@gnu.org> <875z64d1hr.fsf@gmail.com> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 27 Brumaire an 229 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Tue, 17 Nov 2020 10:08:49 +0100 In-Reply-To: <875z64d1hr.fsf@gmail.com> (Maxim Cournoyer's message of "Mon, 16 Nov 2020 23:57:20 -0500") Message-ID: <87eekstkny.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 36376 Cc: Leo Prikler , 35594@debbugs.gnu.org, 36376@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi Maxim, Maxim Cournoyer skribis: > Ludovic Court=C3=A8s writes: > > [...] > >> So with this new patch it=E2=80=99s monitoring /var/guix/profiles/per-us= er/USER >> and /var/guix/profiles instead, which correctly detects changes. It >> detects a bit =E2=80=9Ctoo much=E2=80=9D (for instance, running =E2=80= =98guix pull=E2=80=99 triggers the >> inotify hook because it changes >> /var/guix/profiles/per-user/USER/current-guix) but that=E2=80=99s probab= ly OK. >> >> If you=E2=80=99re using GNOME, Xfce, or another GLib-based desktop envir= onment, >> I=E2=80=99d welcome tests on the bare metal! Just apply the patch on a = checkout >> of =E2=80=98master=E2=80=99 and run: > > I've now done so! It works :-)! I do have noticed something a bit off, > see the comments below. Thanks for testing! >> +@@ -249,11 +258,11 @@ desktop_file_dir_changed (GFileMonitor *moni= tor, >> + * >> + * If this is a notification for a parent directory (because the >> + * desktop directory didn't exist) then we shouldn't fire the signal >> +- * unless something actually changed. >> ++ * unless something actually changed or it's in /var/guix/profiles. >> + */ >> + g_mutex_lock (&desktop_file_dir_lock); >> + >> +- if (dir->alternatively_watching) >> ++ if (dir->alternatively_watching && dir->guix_profile_watch_dir =3D= =3D NULL) > ^^^^^^ > Why is this needed/desirable? As the comment above states it, the =E2=80=98if=E2=80=99 is here so that th= e =E2=80=9Cchanged=E2=80=9D signal is not fired when we=E2=80=99re just watching a parent directory. However, in our case, =E2=80=98dir->alternatively_watching !=3D NULL=E2=80= =99 possibly means that we=E2=80=99re watching a Guix profile, in which case we do want = to fire the =E2=80=9Cchanged=E2=80=9D signal. This =E2=80=9C&&=E2=80=9D allows us to disambiguate between =E2=80=9Cwatchi= ng a parent directory=E2=80=9D and =E2=80=9Cwatching a Guix profile=E2=80=9D. >> +@@ -1555,6 +1564,32 @@ desktop_file_dirs_lock (void) >> + for (i =3D 0; dirs[i]; i++) >> + g_ptr_array_add (desktop_file_dirs, desktop_file_dir_new (dirs= [i])); >> + >> ++ { >> ++ /* Monitor the system and user profile under /var/guix/profile= s and >> ++ * treat modifications to them as if they were modifications t= o their >> ++ * /share sub-directory. */ >> ++ const gchar *user; >> ++ DesktopFileDir *system_profile_dir, *user_profile_dir; >> ++ >> ++ system_profile_dir =3D >> ++ desktop_file_dir_new ("/var/guix/profiles/system/profile/sha= re"); >> ++ system_profile_dir->guix_profile_watch_dir =3D g_strdup ("/var= /guix/profiles"); >> ++ g_ptr_array_add (desktop_file_dirs, desktop_file_dir_ref (syst= em_profile_dir)); >> ++ >> ++ user =3D g_get_user_name (); > > This seems to get the user of the running glib application; e.g. for > GNOME Shell it returns 'gdm'... > >> ++ if (user !=3D NULL) >> ++ { >> ++ gchar *profile_dir, *user_data_dir; >> ++ >> ++ profile_dir =3D g_build_filename ("/var/guix/profiles/per-= user", user, NULL); >> ++ user_data_dir =3D g_build_filename (profile_dir, "guix-pro= file", "share", NULL); >> ++ user_profile_dir =3D desktop_file_dir_new (user_data_dir); >> ++ user_profile_dir->guix_profile_watch_dir =3D profile_dir; >> ++ g_ptr_array_add (desktop_file_dirs, desktop_file_dir_ref (= user_profile_dir)); >> ++ g_free (user_data_dir); >> ++ } >> ++ } >> ++ > > ...which means the above puts the watch on the > "/var/guix/profiles/per-user/gdm" directory, which doesn't exist. Yes, that profile is typically never populated. > sudo strace -f -s200 -p$(pgrep gnome-shell | head -n1) reports entries > such as: > > 92 00:48:47 poll([{fd=3D6, events=3DPOLLIN}, {fd=3D7, events=3DPOLLIN},= {fd=3D9, events=3DPOLLIN}, {fd=3D19, events=3DPOLLIN}, {fd=3D28, events=3D= POLLIN}], 5, -1 > 390 00:48:47 <... poll resumed>) =3D 0 (Timeout) > 390 00:48:47 inotify_add_watch(17, "/var/guix/profiles/per-user/gdm", I= N_MODIFY|IN_ATTRIB|IN_CLOSE_WRITE|IN_MOVED_FROM|IN_MOVED_TO|IN_CREATE|IN_DE= LETE|IN_DELETE_SELF|IN_MOVE_SELF|IN_UNMOUNT|IN_ONLYDIR) =3D -1 ENOENT (No s= uch file or directory) > 390 00:48:47 poll([{fd=3D3, events=3DPOLLIN}, {fd=3D17, events=3DPOLLIN= }], 2, 3996) =3D 0 (Timeout) > 390 00:48:51 inotify_add_watch(17, "/var/guix/profiles/per-user/gdm", I= N_MODIFY|IN_ATTRIB|IN_CLOSE_WRITE|IN_MOVED_FROM|IN_MOVED_TO|IN_CREATE|IN_DE= LETE|IN_DELETE_SELF|IN_MOVE_SELF|IN_UNMOUNT|IN_ONLYDIR) =3D -1 ENOENT (No s= uch file or directory) > 390 00:48:51 poll([{fd=3D3, events=3DPOLLIN}, {fd=3D17, events=3DPOLLIN= }], 2, 3998) =3D 0 (Timeout) > 390 00:48:55 inotify_add_watch(17, "/var/guix/profiles/per-user/gdm", I= N_MODIFY|IN_ATTRIB|IN_CLOSE_WRITE|IN_MOVED_FROM|IN_MOVED_TO|IN_CREATE|IN_DE= LETE|IN_DELETE_SELF|IN_MOVE_SELF|IN_UNMOUNT|IN_ONLYDIR) =3D -1 ENOENT (No s= uch file or directory) > > The fallback mechanism should have been disabled in > desktop_file_dir_changed (dir->guix-profile_watch_dir !=3D NULL so > desktop_file_dir_get_alternative_dir doesn't get called), so it seems > this shouldn't work. What shouldn=E2=80=99t work? We keep adding a watch on a non-existent directory, but I think that=E2=80= =99s fine. > Could it be that the watches used by glib implement a recursive > inotify-based watch and that it works because any changes under the > /var/guix/profiles directory get picked up, including those of user > profiles. The sources seem to suggest so, for example in > gio/inotify/inotify-path.c. If that is the case, it could lead to a new > interesting problems: applications from other users could end up being > shown inadvertently. We=E2=80=99re watching /var/guix/profiles (for the system profile) and /var/guix/profiles/per-user/USER, but .desktop files are loaded from the user=E2=80=99s own profile, so that should be fine. Thanks a lot for looking into this! Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 17 23:34:52 2020 Received: (at 36376) by debbugs.gnu.org; 18 Nov 2020 04:34:52 +0000 Received: from localhost ([127.0.0.1]:33710 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kfFBE-0006sa-EY for submit@debbugs.gnu.org; Tue, 17 Nov 2020 23:34:52 -0500 Received: from mail-qt1-f176.google.com ([209.85.160.176]:39618) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kfFBC-0006sI-Qo; Tue, 17 Nov 2020 23:34:51 -0500 Received: by mail-qt1-f176.google.com with SMTP id b16so761682qtb.6; Tue, 17 Nov 2020 20:34:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=Bd9oIEjSyZuk6aWNKTNmB+GXKPMIrMh25apWZUMsk30=; b=oFgZxTYDU7qGHgYnLcWtJAw/du+wBKrj62NkvMosYerZq6bwYhrokL1C6p56zktYFz WGqaOCfkONQKbXHeqIQDWPMwJrm8E3dre8qKK51iYNT+2vASC28KjBVPedUpTHLw7y4G LjhwYNx8fwWY137SEEVDXV2HUy2MfE3z4tbisVvLc7x+w5oj+U2GWZkycpnlSei78slK i0EuwzFTSRyHi5p+zEGr5FWr47rjkHHbWaWi2GFLqxWtTZ61lS7lIKAsUl2Vs3KPtt8w 74IbjQDajOr3IifH3kIvGPeXImLs8PsUgYSufg6KYWhHQJeepOhwKUVvD5XxULoetM/e qfJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=Bd9oIEjSyZuk6aWNKTNmB+GXKPMIrMh25apWZUMsk30=; b=J9qXW7ZQJD/BXxfxfF+yCyq3/zRQf4ZJjSsiPVoiPGG1AR3I2dTdUIG0+u5gnbmDxj 8JFL93Rs/3z3B4zEQx5ZSXXGyDjULPVibJNjgXtZ5gF6xXowR9uJ9AmXBTJQ2wbc7eBC Jbok0bdr2iUz/pdGZiItZuZDNK7mcPlvMn4KfBO6LlKALfSevco3CK/MBtYbEyI73ULX qVPEQa5B2PIhnm+dxxP8+kjbadw2xGx1cSean6DESGN2eQB5MnxgAJ9B+8oQjuq3Ujme HZnLjrJB29zl14LHXEYvpRiIYUe0bO7CYRD4QOYId9ICtq4WMistPE40u1pr1sCAKv6T 64wg== X-Gm-Message-State: AOAM5308Afs0dCWicoVhgSJY4Ktx0SYNW7eUBr55hZ+BYsfJWvBvYBeX 5Xhdpcl1/4T/Ol4xTjJm4aMwVJ1gElIaJw== X-Google-Smtp-Source: ABdhPJxYpy/zWreOpA2IGi9YisQ4UgjTOSA2BMhUtUp/o5kk7X8gZ0jcZaeHwzHFMuXAjr3LeDKeJQ== X-Received: by 2002:ac8:7b30:: with SMTP id l16mr2668636qtu.360.1605674084874; Tue, 17 Nov 2020 20:34:44 -0800 (PST) Received: from hurd (dsl-205-236-230-198.b2b2c.ca. [205.236.230.198]) by smtp.gmail.com with ESMTPSA id 137sm15908441qkj.109.2020.11.17.20.34.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Nov 2020 20:34:44 -0800 (PST) From: Maxim Cournoyer To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: bug#36376: Application menu of desktop environment not automatically updated References: <871rzhn483.fsf@gnu.org> <87o8keawju.fsf@gnu.org> <87d00swboe.fsf@gmail.com> <878sbexylp.fsf@gnu.org> <87r1p6tiut.fsf@gmail.com> <87lff9nsl0.fsf@gnu.org> <87d00iin6w.fsf@gnu.org> <875z64d1hr.fsf@gmail.com> <87eekstkny.fsf@gnu.org> Date: Tue, 17 Nov 2020 23:34:42 -0500 In-Reply-To: <87eekstkny.fsf@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s=22'?= =?utf-8?Q?s?= message of "Tue, 17 Nov 2020 10:08:49 +0100") Message-ID: <87d00b8eql.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 36376 Cc: Leo Prikler , 35594@debbugs.gnu.org, 36376@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello Ludovic! Ludovic Court=C3=A8s writes: > Hi Maxim, > > Maxim Cournoyer skribis: > >> Ludovic Court=C3=A8s writes: [...] >>> +@@ -249,11 +258,11 @@ desktop_file_dir_changed (GFileMonitor *mon= itor, >>> + * >>> + * If this is a notification for a parent directory (because the >>> + * desktop directory didn't exist) then we shouldn't fire the signal >>> +- * unless something actually changed. >>> ++ * unless something actually changed or it's in /var/guix/profiles. >>> + */ >>> + g_mutex_lock (&desktop_file_dir_lock); >>> + >>> +- if (dir->alternatively_watching) >>> ++ if (dir->alternatively_watching && dir->guix_profile_watch_dir =3D= =3D NULL) >> ^^^^^^ >> Why is this needed/desirable? > > As the comment above states it, the =E2=80=98if=E2=80=99 is here so that = the =E2=80=9Cchanged=E2=80=9D > signal is not fired when we=E2=80=99re just watching a parent directory. > > However, in our case, =E2=80=98dir->alternatively_watching !=3D NULL=E2= =80=99 possibly > means that we=E2=80=99re watching a Guix profile, in which case we do wan= t to > fire the =E2=80=9Cchanged=E2=80=9D signal. > > This =E2=80=9C&&=E2=80=9D allows us to disambiguate between =E2=80=9Cwatc= hing a parent > directory=E2=80=9D and =E2=80=9Cwatching a Guix profile=E2=80=9D. Yes, this makes sense. I got confused by the wording of the (existing) comment that mentions "unless something actually changed". I used to think this meant the contents of whatever directory is being watched, but looking more closely, it's really just about if the parent directory of a non-existing data directory changed... Makes senses, we don't want that. >>> +@@ -1555,6 +1564,32 @@ desktop_file_dirs_lock (void) >>> + for (i =3D 0; dirs[i]; i++) >>> + g_ptr_array_add (desktop_file_dirs, desktop_file_dir_new (dir= s[i])); >>> + >>> ++ { >>> ++ /* Monitor the system and user profile under /var/guix/profil= es and >>> ++ * treat modifications to them as if they were modifications = to their >>> ++ * /share sub-directory. */ >>> ++ const gchar *user; >>> ++ DesktopFileDir *system_profile_dir, *user_profile_dir; >>> ++ >>> ++ system_profile_dir =3D >>> ++ desktop_file_dir_new ("/var/guix/profiles/system/profile/sh= are"); >>> ++ system_profile_dir->guix_profile_watch_dir =3D g_strdup ("/va= r/guix/profiles"); >>> ++ g_ptr_array_add (desktop_file_dirs, desktop_file_dir_ref (sys= tem_profile_dir)); >>> ++ >>> ++ user =3D g_get_user_name (); >> >> This seems to get the user of the running glib application; e.g. for >> GNOME Shell it returns 'gdm'... >> >>> ++ if (user !=3D NULL) >>> ++ { >>> ++ gchar *profile_dir, *user_data_dir; >>> ++ >>> ++ profile_dir =3D g_build_filename ("/var/guix/profiles/per= -user", user, NULL); >>> ++ user_data_dir =3D g_build_filename (profile_dir, "guix-pr= ofile", "share", NULL); >>> ++ user_profile_dir =3D desktop_file_dir_new (user_data_dir); >>> ++ user_profile_dir->guix_profile_watch_dir =3D profile_dir; >>> ++ g_ptr_array_add (desktop_file_dirs, desktop_file_dir_ref = (user_profile_dir)); >>> ++ g_free (user_data_dir); >>> ++ } >>> ++ } >>> ++ >> >> ...which means the above puts the watch on the >> "/var/guix/profiles/per-user/gdm" directory, which doesn't exist. > > Yes, that profile is typically never populated. Ah, I now understand the source of my confusion; there are multiple gnome-shell instances (components?) running, one apparently started by the greeter (GDM), which doesn't have a profile, and others started by the users which logged in. Thanks again for the fix and explanations! Maxim From unknown Wed Jun 18 23:11:34 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 16 Dec 2020 12:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator